diff --git a/CMakeLists.txt b/CMakeLists.txt index c2686243e0fee4ddaa329b138ff04c1da3bcc4c4..dda5b08694d2c1ccfccccec4fe53b2bdb053dc91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,6 @@ set (CMAKE_CXX_EXTENSIONS OFF) add_definitions (-DIPPL_LINUX -DIPPL_STRINGSTREAM) add_definitions (-DIPPL_MPI -DMPICH_SKIP_MPICXX -DIPPL_DONT_POOL) add_definitions (-DIPPL_USE_XDIV_RNG -DPETE_BITWISE_COPY) -add_definitions (-DIPPL_HAS_TEMPLATED_COMPLEX) add_definitions (-DIPPL_USE_PARTIAL_SPECIALIZATION) add_definitions (-Drestrict=__restrict__ -DNOCTAssert) diff --git a/ippl/src/AppTypes/dcomplex.h b/ippl/src/AppTypes/dcomplex.h index 8334a2291d479701ca426af0815d52b395d81c89..6a38639f0e4075770af297f7ab1ed3afa137849d 100644 --- a/ippl/src/AppTypes/dcomplex.h +++ b/ippl/src/AppTypes/dcomplex.h @@ -23,8 +23,6 @@ // include standard complex header file #include <complex> -#ifdef IPPL_HAS_TEMPLATED_COMPLEX - // KAI and others have a templated complex class #ifdef IPPL_USE_SINGLE_PRECISION typedef std::complex<float> dcomplex; @@ -32,20 +30,4 @@ typedef std::complex<float> dcomplex; typedef std::complex<double> dcomplex; #endif -typedef std::complex<float> fComplex; - -#else - -// This assumes that all other compilers have the old non-templated -// complex type which is like complex<double> in the draft standard. -typedef std::complex dcomplex; - -#endif // IPPL_HAS_TEMPLATED_COMPLEX - #endif // DCOMPLEX_H - -/*************************************************************************** - * $RCSfile: dcomplex.h,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:24 $ - * IPPL_VERSION_ID: $Id: dcomplex.h,v 1.1.1.1 2003/01/23 07:40:24 adelmann Exp $ - ***************************************************************************/ \ No newline at end of file diff --git a/ippl/src/FFT/CMakeLists.txt b/ippl/src/FFT/CMakeLists.txt index f39436f450d3017717f12cdeef055b77c83404eb..da9c15401efc216a3f6c437e79f8340f8cd79e17 100644 --- a/ippl/src/FFT/CMakeLists.txt +++ b/ippl/src/FFT/CMakeLists.txt @@ -1,22 +1,20 @@ -SET (_SRCS - fftpack.cpp +set (_SRCS + fftpack.cpp ) -SET (_HDRS - f2c.h +set (_HDRS FFTBase.hpp FFTBase.h FFT.hpp FFT.h fftpack_FFT.h - SCSL_FFT.h ) -INCLUDE_DIRECTORIES ( +include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} -) + ) -ADD_IPPL_SOURCES (${_SRCS}) -ADD_IPPL_HEADERS (${_HDRS}) +add_ippl_sources (${_SRCS}) +add_ippl_headers (${_HDRS}) -INSTALL (FILES ${_HDRS} DESTINATION include/FFT) +#install (FILES ${_HDRS} DESTINATION include/FFT) diff --git a/ippl/src/FFT/FFT.h b/ippl/src/FFT/FFT.h index d02cf22fd541ea2207a8339599b2a4d5865506b5..7eb051e2334e0f704b8382fd6e78f6a85813c5a4 100644 --- a/ippl/src/FFT/FFT.h +++ b/ippl/src/FFT/FFT.h @@ -1,21 +1,23 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -//-------------------------------------------------------------------------- -// Class FFT -//-------------------------------------------------------------------------- +// +// IPPL FFT +// +// Copyright (c) 2008-2018 +// Paul Scherrer Institut, Villigen PSI, Switzerland +// All rights reserved. +// +// OPAL is licensed under GNU GPL version 3. +// + +/** + The FFT class performs complex-to-complex, real-to-complex, or sine + transforms on IPPL Fields. FFT is templated on the type of transform + to be performed, the dimensionality of the Field to transform, and the + floating-point precision type of the Field (float or double). +*/ #ifndef IPPL_FFT_FFT_H #define IPPL_FFT_FFT_H -// include files #include "FFT/FFTBase.h" #ifdef IPPL_DKS @@ -29,12 +31,6 @@ template <class T, unsigned Dim> class BareField; template <class T, unsigned Dim> class LField; -/** - The FFT class performs complex-to-complex, real-to-complex, or sine - transforms on IPPL Fields. FFT is templated on the type of transform - to be performed, the dimensionality of the Field to transform, and the - floating-point precision type of the Field (float or double). -*/ /** Tag classes for CC type of Fourier transforms @@ -55,7 +51,6 @@ class SineTransform {}; template <class Transform, size_t Dim, class T> class FFT : public FFTBase<Dim,T> {}; - /** complex-to-complex FFT class */ @@ -64,239 +59,237 @@ class FFT<CCTransform,Dim,T> : public FFTBase<Dim,T> { private: #ifdef IPPL_DKS - DKSOPAL base; + DKSOPAL base; #endif public: - // typedefs - typedef FieldLayout<Dim> Layout_t; - typedef std::complex<T> Complex_t; - typedef BareField<Complex_t,Dim> ComplexField_t; - typedef LField<Complex_t,Dim> ComplexLField_t; - typedef typename FFTBase<Dim,T>::Domain_t Domain_t; - - /** Create a new FFT object with the given domain for the input Field. - Specify which dimensions to transform along. - Optional argument compressTemps indicates whether or not to compress - temporary Fields in between uses. - */ - FFT(const Domain_t& cdomain, const bool transformTheseDims[Dim], - const bool& compressTemps=false); - - /** - Create a new FFT object of type CCTransform, with a - given domain. Default case of transforming along all dimensions. - Note this was formerly in the .cpp file, but the IBM linker - could not find it! - */ - FFT(const Domain_t& cdomain, const bool& compressTemps=false) + typedef FieldLayout<Dim> Layout_t; + typedef std::complex<T> Complex_t; + typedef BareField<Complex_t,Dim> ComplexField_t; + typedef LField<Complex_t,Dim> ComplexLField_t; + typedef typename FFTBase<Dim,T>::Domain_t Domain_t; + + /** Create a new FFT object with the given domain for the input Field. + Specify which dimensions to transform along. + Optional argument compressTemps indicates whether or not to compress + temporary Fields in between uses. + */ + FFT(const Domain_t& cdomain, const bool transformTheseDims[Dim], + const bool& compressTemps=false); + + /** + Create a new FFT object of type CCTransform, with a + given domain. Default case of transforming along all dimensions. + Note this was formerly in the .cpp file, but the IBM linker + could not find it! + */ +FFT(const Domain_t& cdomain, const bool& compressTemps=false) : FFTBase<Dim,T>(FFT<CCTransform,Dim,T>::ccFFT, cdomain,compressTemps) { - // construct array of axis lengths - int lengths[Dim]; - size_t d; - for (d=0; d<Dim; ++d) - lengths[d] = cdomain[d].length(); - - // construct array of transform types for FFT Engine, compute normalization - int transformTypes[Dim]; - T& normFact = this->getNormFact(); - normFact = 1.0; - for (d=0; d<Dim; ++d) { - transformTypes[d] = FFTBase<Dim,T>::ccFFT; // all transforms are complex-to-complex - normFact /= lengths[d]; - } + // construct array of axis lengths + int lengths[Dim]; + size_t d; + for (d=0; d<Dim; ++d) + lengths[d] = cdomain[d].length(); + + // construct array of transform types for FFT Engine, compute normalization + int transformTypes[Dim]; + T& normFact = this->getNormFact(); + normFact = 1.0; + for (d=0; d<Dim; ++d) { + transformTypes[d] = FFTBase<Dim,T>::ccFFT; // all transforms are complex-to-complex + normFact /= lengths[d]; + } #ifdef IPPL_DKS #ifdef IPPL_DKS_OPENCL - INFOMSG("Init DKS base opencl" << endl); - base.setAPI("OpenCL", 6); - base.setDevice("-gpu", 4); - base.initDevice(); + INFOMSG("Init DKS base opencl" << endl); + base.setAPI("OpenCL", 6); + base.setDevice("-gpu", 4); + base.initDevice(); #endif #ifdef IPPL_DKS_CUDA - INFOMSG("Init DKS base cuda" << endl); - base.setAPI("Cuda", 4); - base.setDevice("-gpu", 4); - base.initDevice(); + INFOMSG("Init DKS base cuda" << endl); + base.setAPI("Cuda", 4); + base.setDevice("-gpu", 4); + base.initDevice(); #endif #ifdef IPPL_DKS_MIC - INFOMSG("Init DKS base MIC" << endl); - base.setAPI("OpenMP", 6); - base.setDevice("-mic", 4); - base.initDevice(); + INFOMSG("Init DKS base MIC" << endl); + base.setAPI("OpenMP", 6); + base.setDevice("-mic", 4); + base.initDevice(); #endif #endif - - // set up FFT Engine - this->getEngine().setup(Dim, transformTypes, lengths); - // set up the temporary fields - setup(); - } - - - // Destructor - ~FFT(void); - - /** Do the FFT: specify +1 or -1 to indicate forward or inverse - transform, or specify the user-defined name string for the direction. - User provides separate input and output fields - optional argument constInput indicates whether or not to treat the - input Field argument f as const. If not, we can use it as a temporary - in order to avoid an additional data transpose. - */ - void transform(int direction, ComplexField_t& f, ComplexField_t& g, - const bool& constInput=false); - /** - invoke using string for direction name - */ - void transform(const char* directionName, ComplexField_t& f, - ComplexField_t& g, const bool& constInput=false); - - /** overloaded versions which perform the FFT "in place" - */ - void transform(int direction, ComplexField_t& f); - - void transform(const char* directionName, ComplexField_t& f) { - // invoke in-place transform function using direction name string - int direction = this->getDirection(directionName); - - // Check domain of incoming Field - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); - - // Common loop iterate and other vars: - size_t d; - int idim; // idim loops over the number of transform dims. - int begdim, enddim; // beginning and end of transform dim loop - size_t nTransformDims = this->numTransformDims(); - // Field* for temp Field management: - ComplexField_t* temp = &f; - // Local work array passed to FFT: - Complex_t* localdata; - - // Loop over the dimensions be transformed: - begdim = (direction == +1) ? 0 : (nTransformDims-1); - enddim = (direction == +1) ? nTransformDims : -1; - for (idim = begdim; idim != enddim; idim += direction) { + // set up FFT Engine + this->getEngine().setup(Dim, transformTypes, lengths); + // set up the temporary fields + setup(); + } + + + // Destructor + ~FFT(void); + + /** Do the FFT: specify +1 or -1 to indicate forward or inverse + transform, or specify the user-defined name string for the direction. + User provides separate input and output fields + optional argument constInput indicates whether or not to treat the + input Field argument f as const. If not, we can use it as a temporary + in order to avoid an additional data transpose. + */ + void transform(int direction, ComplexField_t& f, ComplexField_t& g, + const bool& constInput=false); + /** + invoke using string for direction name + */ + void transform(const char* directionName, ComplexField_t& f, + ComplexField_t& g, const bool& constInput=false); + + /** overloaded versions which perform the FFT "in place" + */ + void transform(int direction, ComplexField_t& f); + + void transform(const char* directionName, ComplexField_t& f) { + // invoke in-place transform function using direction name string + int direction = this->getDirection(directionName); + + // Check domain of incoming Field + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); + + // Common loop iterate and other vars: + size_t d; + int idim; // idim loops over the number of transform dims. + int begdim, enddim; // beginning and end of transform dim loop + size_t nTransformDims = this->numTransformDims(); + // Field* for temp Field management: + ComplexField_t* temp = &f; + // Local work array passed to FFT: + Complex_t* localdata; + + // Loop over the dimensions be transformed: + begdim = (direction == +1) ? 0 : (nTransformDims-1); + enddim = (direction == +1) ? nTransformDims : -1; + for (idim = begdim; idim != enddim; idim += direction) { - // Now do the serial transforms along this dimension: - - bool skipTranspose = false; - // if this is the first transform dimension, we might be able - // to skip the transpose into the first temporary Field - if (idim == begdim) { - // get domain for comparison - const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && - (in_dom[0].length() == first_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); - } - - // if this is the last transform dimension, we might be able - // to skip the last temporary and transpose right into f - if (idim == enddim-direction) { - // get domain for comparison - const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(last_dom[0])) && - (in_dom[0].length() == last_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); - } - - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && temp != &f) *temp = 0; - temp = tempFields_m[idim]; // Field* management aid - } - else if (idim == enddim-direction && temp != &f) { - // last transform and we can skip the last temporary field - // so do the transpose here using f instead - - // transpose and permute to Field with transform dim first - f[in_dom] = (*temp)[temp->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps()) *temp = 0; - temp = &f; // Field* management aid - } + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the first transform dimension, we might be able + // to skip the transpose into the first temporary Field + if (idim == begdim) { + // get domain for comparison + const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && + (in_dom[0].length() == first_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); + } + + // if this is the last transform dimension, we might be able + // to skip the last temporary and transpose right into f + if (idim == enddim-direction) { + // get domain for comparison + const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(last_dom[0])) && + (in_dom[0].length() == last_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = + (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && temp != &f) *temp = 0; + temp = tempFields_m[idim]; // Field* management aid + } + else if (idim == enddim-direction && temp != &f) { + // last transform and we can skip the last temporary field + // so do the transpose here using f instead + + // transpose and permute to Field with transform dim first + f[in_dom] = (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps()) *temp = 0; + temp = &f; // Field* management aid + } - // Loop over all the Vnodes, working on the LField in each. - typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); - for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - ComplexLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdata = ldf->getP(); - - // Do 1D complex-to-complex FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - this->getEngine().callFFT(idim, direction, localdata); - // advance the data pointer - localdata += length; - } // loop over 1D strips - } // loop over all the LFields + // Loop over all the Vnodes, working on the LField in each. + typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); + for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + ComplexLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdata = ldf->getP(); + + // Do 1D complex-to-complex FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + this->getEngine().callFFT(idim, direction, localdata); + // advance the data pointer + localdata += length; + } // loop over 1D strips + } // loop over all the LFields - } // loop over all transformed dimensions + } // loop over all transformed dimensions - // skip final assignment and compress if we used f as final temporary - if (temp != &f) { + // skip final assignment and compress if we used f as final temporary + if (temp != &f) { - // Now assign back into original Field, and compress last temp's storage: - f[in_dom] = (*temp)[temp->getLayout().getDomain()]; - if (this->compressTemps()) *temp = 0; + // Now assign back into original Field, and compress last temp's storage: + f[in_dom] = (*temp)[temp->getLayout().getDomain()]; + if (this->compressTemps()) *temp = 0; - } + } - // Normalize: - if (direction == +1) - f *= Complex_t(this->getNormFact(), 0.0); - return; - } + // Normalize: + if (direction == +1) + f *= Complex_t(this->getNormFact(), 0.0); + return; + } private: - /** - setup performs all the initializations necessary after the transform - directions have been specified. - */ - void setup(void); - - /** - How the temporary field's are laid out; these are computed from the - input Field's domain. This will be allocated as an array of FieldLayouts - with nTransformDims elements. Each is SERIAL along the zeroth dimension - and the axes are permuted so that the transform direction is first - */ - Layout_t** tempLayouts_m; - - /** The array of temporary fields, one for each transform direction - These use the corresponding tempLayouts. - */ - ComplexField_t** tempFields_m; + /** + setup performs all the initializations necessary after the transform + directions have been specified. + */ + void setup(void); + + /** + How the temporary field's are laid out; these are computed from the + input Field's domain. This will be allocated as an array of FieldLayouts + with nTransformDims elements. Each is SERIAL along the zeroth dimension + and the axes are permuted so that the transform direction is first + */ + Layout_t** tempLayouts_m; + + /** The array of temporary fields, one for each transform direction + These use the corresponding tempLayouts. + */ + ComplexField_t** tempFields_m; }; @@ -307,14 +300,14 @@ private: template <size_t Dim, class T> inline void FFT<CCTransform,Dim,T>::transform( - const char* directionName, - typename FFT<CCTransform,Dim,T>::ComplexField_t& f, - typename FFT<CCTransform,Dim,T>::ComplexField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<CCTransform,Dim,T>::ComplexField_t& f, + typename FFT<CCTransform,Dim,T>::ComplexField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } @@ -326,71 +319,71 @@ class FFT<CCTransform,1U,T> : public FFTBase<1U,T> { public: - // typedefs - typedef FieldLayout<1U> Layout_t; - typedef std::complex<T> Complex_t; - typedef BareField<Complex_t,1U> ComplexField_t; - typedef LField<Complex_t,1U> ComplexLField_t; - typedef typename FFTBase<1U,T>::Domain_t Domain_t; - - // Constructors: - - /** Create a new FFT object with the given domain for the input Field. - Specify which dimensions to transform along. - Optional argument compressTemps indicates whether or not to compress - temporary Fields in between uses. - */ - FFT(const Domain_t& cdomain, const bool transformTheseDims[1U], - const bool& compressTemps=false); - /** Create a new FFT object with the given domain for the input Field. - Transform along all dimensions. - Optional argument compressTemps indicates whether or not to compress - temporary Fields in between uses. - - */ - FFT(const Domain_t& cdomain, const bool& compressTemps=false); - - // Destructor - ~FFT(void); - - /** Do the FFT: specify +1 or -1 to indicate forward or inverse - transform, or specify the user-defined name string for the direction. - User provides separate input and output fields - optional argument constInput indicates whether or not to treat the - input Field argument f as const. If not, we can use it as a temporary - in order to avoid an additional data transpose. - */ - void transform(int direction, ComplexField_t& f, ComplexField_t& g, - const bool& constInput=false); - /** - invoke using string for direction name - */ - void transform(const char* directionName, ComplexField_t& f, - ComplexField_t& g, const bool& constInput=false); - - /** - overloaded versions which perform the FFT "in place" - */ - void transform(int direction, ComplexField_t& f); - void transform(const char* directionName, ComplexField_t& f); + // typedefs + typedef FieldLayout<1U> Layout_t; + typedef std::complex<T> Complex_t; + typedef BareField<Complex_t,1U> ComplexField_t; + typedef LField<Complex_t,1U> ComplexLField_t; + typedef typename FFTBase<1U,T>::Domain_t Domain_t; + + // Constructors: + + /** Create a new FFT object with the given domain for the input Field. + Specify which dimensions to transform along. + Optional argument compressTemps indicates whether or not to compress + temporary Fields in between uses. + */ + FFT(const Domain_t& cdomain, const bool transformTheseDims[1U], + const bool& compressTemps=false); + /** Create a new FFT object with the given domain for the input Field. + Transform along all dimensions. + Optional argument compressTemps indicates whether or not to compress + temporary Fields in between uses. + + */ + FFT(const Domain_t& cdomain, const bool& compressTemps=false); + + // Destructor + ~FFT(void); + + /** Do the FFT: specify +1 or -1 to indicate forward or inverse + transform, or specify the user-defined name string for the direction. + User provides separate input and output fields + optional argument constInput indicates whether or not to treat the + input Field argument f as const. If not, we can use it as a temporary + in order to avoid an additional data transpose. + */ + void transform(int direction, ComplexField_t& f, ComplexField_t& g, + const bool& constInput=false); + /** + invoke using string for direction name + */ + void transform(const char* directionName, ComplexField_t& f, + ComplexField_t& g, const bool& constInput=false); + + /** + overloaded versions which perform the FFT "in place" + */ + void transform(int direction, ComplexField_t& f); + void transform(const char* directionName, ComplexField_t& f); private: - /** - setup performs all the initializations necessary after the transform - directions have been specified. - */ - void setup(void); + /** + setup performs all the initializations necessary after the transform + directions have been specified. + */ + void setup(void); - /** - The temporary field layout - */ - Layout_t* tempLayouts_m; + /** + The temporary field layout + */ + Layout_t* tempLayouts_m; - /** - The temporary field - */ - ComplexField_t* tempFields_m; + /** + The temporary field + */ + ComplexField_t* tempFields_m; }; @@ -403,14 +396,14 @@ private: template <class T> inline void FFT<CCTransform,1U,T>::transform( - const char* directionName, - typename FFT<CCTransform,1U,T>::ComplexField_t& f, - typename FFT<CCTransform,1U,T>::ComplexField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<CCTransform,1U,T>::ComplexField_t& f, + typename FFT<CCTransform,1U,T>::ComplexField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } /** @@ -419,12 +412,12 @@ FFT<CCTransform,1U,T>::transform( template <class T> inline void FFT<CCTransform,1U,T>::transform( - const char* directionName, - typename FFT<CCTransform,1U,T>::ComplexField_t& f) + const char* directionName, + typename FFT<CCTransform,1U,T>::ComplexField_t& f) { - int dir = this->getDirection(directionName); - transform(dir, f); - return; + int dir = this->getDirection(directionName); + transform(dir, f); + return; } @@ -438,109 +431,109 @@ private: public: - // typedefs - typedef FieldLayout<Dim> Layout_t; - typedef BareField<T,Dim> RealField_t; - typedef LField<T,Dim> RealLField_t; - typedef std::complex<T> Complex_t; - typedef BareField<Complex_t,Dim> ComplexField_t; - typedef LField<Complex_t,Dim> ComplexLField_t; - typedef typename FFTBase<Dim, T>::Domain_t Domain_t; - - // Constructors: - - /** Create a new FFT object with the given domains for input/output Fields - Specify which dimensions to transform along. - Optional argument compress indicates whether or not to compress - temporary Fields in between uses. - */ - FFT(const Domain_t& rdomain, const Domain_t& cdomain, - const bool transformTheseDims[Dim], const bool& compressTemps=false); - - /** - Same as above, but transform all dims: - */ - FFT(const Domain_t& rdomain, const Domain_t& cdomain, - const bool& compressTemps=false, int serialAxes = 1); - - // Destructor - ~FFT(void); - - /** real-to-complex FFT: specify +1 or -1 to indicate forward or inverse - transform, or specify the user-defined name string for the direction. - Supply a second BareField to store the output. - optional argument constInput indicates whether or not to treat the - input Field argument f as const. If not, we can use it as a temporary - in order to avoid an additional data transpose. - */ - void transform(int direction, RealField_t& f, ComplexField_t& g, - const bool& constInput=false); - void transform(const char* directionName, RealField_t& f, - ComplexField_t& g, const bool& constInput=false); - - /** real-to-complex FFT on GPU: transfer the real field to GPU execute FFT - return the pointer to memory on GPU where complex results are stored - */ + // typedefs + typedef FieldLayout<Dim> Layout_t; + typedef BareField<T,Dim> RealField_t; + typedef LField<T,Dim> RealLField_t; + typedef std::complex<T> Complex_t; + typedef BareField<Complex_t,Dim> ComplexField_t; + typedef LField<Complex_t,Dim> ComplexLField_t; + typedef typename FFTBase<Dim, T>::Domain_t Domain_t; + + // Constructors: + + /** Create a new FFT object with the given domains for input/output Fields + Specify which dimensions to transform along. + Optional argument compress indicates whether or not to compress + temporary Fields in between uses. + */ + FFT(const Domain_t& rdomain, const Domain_t& cdomain, + const bool transformTheseDims[Dim], const bool& compressTemps=false); + + /** + Same as above, but transform all dims: + */ + FFT(const Domain_t& rdomain, const Domain_t& cdomain, + const bool& compressTemps=false, int serialAxes = 1); + + // Destructor + ~FFT(void); + + /** real-to-complex FFT: specify +1 or -1 to indicate forward or inverse + transform, or specify the user-defined name string for the direction. + Supply a second BareField to store the output. + optional argument constInput indicates whether or not to treat the + input Field argument f as const. If not, we can use it as a temporary + in order to avoid an additional data transpose. + */ + void transform(int direction, RealField_t& f, ComplexField_t& g, + const bool& constInput=false); + void transform(const char* directionName, RealField_t& f, + ComplexField_t& g, const bool& constInput=false); + + /** real-to-complex FFT on GPU: transfer the real field to GPU execute FFT + return the pointer to memory on GPU where complex results are stored + */ #ifdef IPPL_DKS - void transformDKSRC(int direction, RealField_t &f, void* real_ptr, void* comp_ptr, - DKSOPAL &dksbase, int streamId = -1, const bool& constInput=false); + void transformDKSRC(int direction, RealField_t &f, void* real_ptr, void* comp_ptr, + DKSOPAL &dksbase, int streamId = -1, const bool& constInput=false); #endif - /** complex-to-real FFT - Same as above, but with input and output field types reversed. - */ - void transform(int direction, ComplexField_t& f, RealField_t& g, - const bool& constInput=false); - void transform(const char* directionName, ComplexField_t& f, - RealField_t& g, const bool& constInput=false); + /** complex-to-real FFT + Same as above, but with input and output field types reversed. + */ + void transform(int direction, ComplexField_t& f, RealField_t& g, + const bool& constInput=false); + void transform(const char* directionName, ComplexField_t& f, + RealField_t& g, const bool& constInput=false); - /** complex-to-real FFT on GPU: pass pointer to GPU memory where complex field - is stored, do the inverse FFT and transfer real field back to host memory - */ + /** complex-to-real FFT on GPU: pass pointer to GPU memory where complex field + is stored, do the inverse FFT and transfer real field back to host memory + */ #ifdef IPPL_DKS - void transformDKSCR(int direction, RealField_t& g, void* real_ptr, void* comp_ptr, - DKSOPAL &dksbase, int streamId = -1, const bool& constInput=false); + void transformDKSCR(int direction, RealField_t& g, void* real_ptr, void* comp_ptr, + DKSOPAL &dksbase, int streamId = -1, const bool& constInput=false); #endif private: - /** - setup performs all the initializations necessary after the transform - directions have been specified. - */ - void setup(void); - - /** How the temporary fields are laid out; these are computed from the - input Field's domain. This will be allocated as an array of FieldLayouts - with nTransformDims elements. Each is SERIAL along the zeroth dimension - and the axes are permuted so that the transform direction is first - */ - Layout_t** tempLayouts_m; - - /** - extra layout for the one real Field needed - */ - Layout_t* tempRLayout_m; - - /** The array of temporary fields, one for each transform direction - These use the corresponding tempLayouts. - */ - ComplexField_t** tempFields_m; - - /** - We need one real internal Field in this case. - */ - RealField_t* tempRField_m; - - /** - domain of the resulting complex fields - const Domain_t& complexDomain_m; - */ - Domain_t complexDomain_m; - - /** - number of axes to make serial - */ - int serialAxes_m; + /** + setup performs all the initializations necessary after the transform + directions have been specified. + */ + void setup(void); + + /** How the temporary fields are laid out; these are computed from the + input Field's domain. This will be allocated as an array of FieldLayouts + with nTransformDims elements. Each is SERIAL along the zeroth dimension + and the axes are permuted so that the transform direction is first + */ + Layout_t** tempLayouts_m; + + /** + extra layout for the one real Field needed + */ + Layout_t* tempRLayout_m; + + /** The array of temporary fields, one for each transform direction + These use the corresponding tempLayouts. + */ + ComplexField_t** tempFields_m; + + /** + We need one real internal Field in this case. + */ + RealField_t* tempRField_m; + + /** + domain of the resulting complex fields + const Domain_t& complexDomain_m; + */ + Domain_t complexDomain_m; + + /** + number of axes to make serial + */ + int serialAxes_m; }; // Inline function definitions @@ -551,14 +544,14 @@ private: template <size_t Dim, class T> inline void FFT<RCTransform,Dim,T>::transform( - const char* directionName, - typename FFT<RCTransform,Dim,T>::RealField_t& f, - typename FFT<RCTransform,Dim,T>::ComplexField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<RCTransform,Dim,T>::RealField_t& f, + typename FFT<RCTransform,Dim,T>::ComplexField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } /** @@ -567,14 +560,14 @@ FFT<RCTransform,Dim,T>::transform( template <size_t Dim, class T> inline void FFT<RCTransform,Dim,T>::transform( - const char* directionName, - typename FFT<RCTransform,Dim,T>::ComplexField_t& f, - typename FFT<RCTransform,Dim,T>::RealField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<RCTransform,Dim,T>::ComplexField_t& f, + typename FFT<RCTransform,Dim,T>::RealField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } @@ -586,87 +579,87 @@ class FFT<RCTransform,1U,T> : public FFTBase<1U,T> { public: - // typedefs - typedef FieldLayout<1U> Layout_t; - typedef BareField<T,1U> RealField_t; - typedef LField<T,1U> RealLField_t; - typedef std::complex<T> Complex_t; - typedef BareField<Complex_t,1U> ComplexField_t; - typedef LField<Complex_t,1U> ComplexLField_t; - typedef typename FFTBase<1U,T>::Domain_t Domain_t; - - // Constructors: - - /** - Create a new FFT object with the given domains for input/output Fields - Specify which dimensions to transform along. - Optional argument compress indicates whether or not to compress - temporary Fields in between uses. - */ - FFT(const Domain_t& rdomain, const Domain_t& cdomain, - const bool transformTheseDims[1U], const bool& compressTemps=false); - /** - Same as above, but transform all dims: - */ - FFT(const Domain_t& rdomain, const Domain_t& cdomain, - const bool& compressTemps=false); - - /** - Destructor - */ - ~FFT(void); - - /** - real-to-complex FFT: specify +1 or -1 to indicate forward or inverse - transform, or specify the user-defined name string for the direction. - Supply a second BareField to store the output. - optional argument constInput indicates whether or not to treat the - input Field argument f as const. If not, we can use it as a temporary - in order to avoid an additional data transpose. - */ - void transform(int direction, RealField_t& f, ComplexField_t& g, - const bool& constInput=false); - void transform(const char* directionName, RealField_t& f, - ComplexField_t& g, const bool& constInput=false); - - /** - complex-to-real FFT - Same as above, but with input and output field types reversed. - */ - void transform(int direction, ComplexField_t& f, RealField_t& g, - const bool& constInput=false); - void transform(const char* directionName, ComplexField_t& f, - RealField_t& g, const bool& constInput=false); + // typedefs + typedef FieldLayout<1U> Layout_t; + typedef BareField<T,1U> RealField_t; + typedef LField<T,1U> RealLField_t; + typedef std::complex<T> Complex_t; + typedef BareField<Complex_t,1U> ComplexField_t; + typedef LField<Complex_t,1U> ComplexLField_t; + typedef typename FFTBase<1U,T>::Domain_t Domain_t; + + // Constructors: + + /** + Create a new FFT object with the given domains for input/output Fields + Specify which dimensions to transform along. + Optional argument compress indicates whether or not to compress + temporary Fields in between uses. + */ + FFT(const Domain_t& rdomain, const Domain_t& cdomain, + const bool transformTheseDims[1U], const bool& compressTemps=false); + /** + Same as above, but transform all dims: + */ + FFT(const Domain_t& rdomain, const Domain_t& cdomain, + const bool& compressTemps=false); + + /** + Destructor + */ + ~FFT(void); + + /** + real-to-complex FFT: specify +1 or -1 to indicate forward or inverse + transform, or specify the user-defined name string for the direction. + Supply a second BareField to store the output. + optional argument constInput indicates whether or not to treat the + input Field argument f as const. If not, we can use it as a temporary + in order to avoid an additional data transpose. + */ + void transform(int direction, RealField_t& f, ComplexField_t& g, + const bool& constInput=false); + void transform(const char* directionName, RealField_t& f, + ComplexField_t& g, const bool& constInput=false); + + /** + complex-to-real FFT + Same as above, but with input and output field types reversed. + */ + void transform(int direction, ComplexField_t& f, RealField_t& g, + const bool& constInput=false); + void transform(const char* directionName, ComplexField_t& f, + RealField_t& g, const bool& constInput=false); private: - /** - setup performs all the initializations necessary after the transform - directions have been specified. - */ - void setup(void); - - /** - The temporary field layout - */ - Layout_t* tempLayouts_m; - - /** - The temporary field - */ - ComplexField_t* tempFields_m; - - /** - Real field layout - */ - Layout_t* tempRLayout_m; - - /** - We need one real internal Field in this case. - domain of the resulting complex fields - */ - // const Domain_t& complexDomain_m; - Domain_t complexDomain_m; + /** + setup performs all the initializations necessary after the transform + directions have been specified. + */ + void setup(void); + + /** + The temporary field layout + */ + Layout_t* tempLayouts_m; + + /** + The temporary field + */ + ComplexField_t* tempFields_m; + + /** + Real field layout + */ + Layout_t* tempRLayout_m; + + /** + We need one real internal Field in this case. + domain of the resulting complex fields + */ + // const Domain_t& complexDomain_m; + Domain_t complexDomain_m; }; /** @@ -675,14 +668,14 @@ private: template <class T> inline void FFT<RCTransform,1U,T>::transform( - const char* directionName, - typename FFT<RCTransform,1U,T>::RealField_t& f, - typename FFT<RCTransform,1U,T>::ComplexField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<RCTransform,1U,T>::RealField_t& f, + typename FFT<RCTransform,1U,T>::ComplexField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } /** @@ -691,14 +684,14 @@ FFT<RCTransform,1U,T>::transform( template <class T> inline void FFT<RCTransform,1U,T>::transform( - const char* directionName, - typename FFT<RCTransform,1U,T>::ComplexField_t& f, - typename FFT<RCTransform,1U,T>::RealField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<RCTransform,1U,T>::ComplexField_t& f, + typename FFT<RCTransform,1U,T>::RealField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } /** @@ -709,138 +702,138 @@ class FFT<SineTransform,Dim,T> : public FFTBase<Dim,T> { public: - // typedefs - typedef FieldLayout<Dim> Layout_t; - typedef BareField<T,Dim> RealField_t; - typedef LField<T,Dim> RealLField_t; - typedef std::complex<T> Complex_t; - typedef BareField<Complex_t,Dim> ComplexField_t; - typedef LField<Complex_t,Dim> ComplexLField_t; - typedef typename FFTBase<Dim,T>::Domain_t Domain_t; - - /** Constructor for doing sine transform(s) followed by RC FFT - Create a new FFT object with the given domains for input/output Fields - Specify which dimensions to transform along. - Also specify which of these are sine transforms - Optional argument compress indicates whether or not to compress - temporary Fields in between uses. - */ - FFT(const Domain_t& rdomain, const Domain_t& cdomain, - const bool transformTheseDims[Dim], - const bool sineTransformDims[Dim], const bool& compressTemps=false); - /** - Same as above, but transform all dims: - */ - FFT(const Domain_t& rdomain, const Domain_t& cdomain, - const bool sineTransformDims[Dim], const bool& compressTemps=false); - /** - Separate constructors for doing only sine transforms - Create a new FFT object with the given domain for input/output Field - Specify which dimensions to transform along. - Optional argument compress indicates whether or not to compress - temporary Fields in between uses. - */ - FFT(const Domain_t& rdomain, const bool sineTransformDims[Dim], - const bool& compressTemps=false); - /** - Same as above, but transform all dims: - */ - FFT(const Domain_t& rdomain, const bool& compressTemps=false); - - ~FFT(void); - - /** - These transforms are for combinations of sine transforms and RC FFTs - - Do the FFT: specify +1 or -1 to indicate forward or inverse - transform, or specify the user-defined name string for the direction. - Supply a second BareField to store the output. - optional argument constInput indicates whether or not to treat the - input Field argument f as const. If not, we can use it as a temporary - in order to avoid an additional data transpose. - */ - void transform(int direction, RealField_t& f, ComplexField_t& g, - const bool& constInput=false); - void transform(const char* directionName, RealField_t& f, - ComplexField_t& g, const bool& constInput=false); - - /** - complex-to-real FFT, followed by sine transform(s) - Same as above, but with input and output field types reversed. - */ - void transform(int direction, ComplexField_t& f, RealField_t& g, - const bool& constInput=false); - void transform(const char* directionName, ComplexField_t& f, - RealField_t& g, const bool& constInput=false); - - /** - These transforms are for doing sine transforms only - sine transform: specify +1 or -1 to indicate forward or inverse - transform, or specify the user-defined name string for the direction. - Supply a second BareField to store the output. - optional argument constInput indicates whether or not to treat the - input Field argument f as const. If not, we can use it as a temporary - in order to avoid an additional data transpose. - */ - void transform(int direction, RealField_t& f, RealField_t& g, - const bool& constInput=false); - void transform(const char* directionName, RealField_t& f, - RealField_t& g, const bool& constInput=false); - - /** - In-place version of real-to-real transform - */ - void transform(int direction, RealField_t& f); - void transform(const char* directionName, RealField_t& f); + // typedefs + typedef FieldLayout<Dim> Layout_t; + typedef BareField<T,Dim> RealField_t; + typedef LField<T,Dim> RealLField_t; + typedef std::complex<T> Complex_t; + typedef BareField<Complex_t,Dim> ComplexField_t; + typedef LField<Complex_t,Dim> ComplexLField_t; + typedef typename FFTBase<Dim,T>::Domain_t Domain_t; + + /** Constructor for doing sine transform(s) followed by RC FFT + Create a new FFT object with the given domains for input/output Fields + Specify which dimensions to transform along. + Also specify which of these are sine transforms + Optional argument compress indicates whether or not to compress + temporary Fields in between uses. + */ + FFT(const Domain_t& rdomain, const Domain_t& cdomain, + const bool transformTheseDims[Dim], + const bool sineTransformDims[Dim], const bool& compressTemps=false); + /** + Same as above, but transform all dims: + */ + FFT(const Domain_t& rdomain, const Domain_t& cdomain, + const bool sineTransformDims[Dim], const bool& compressTemps=false); + /** + Separate constructors for doing only sine transforms + Create a new FFT object with the given domain for input/output Field + Specify which dimensions to transform along. + Optional argument compress indicates whether or not to compress + temporary Fields in between uses. + */ + FFT(const Domain_t& rdomain, const bool sineTransformDims[Dim], + const bool& compressTemps=false); + /** + Same as above, but transform all dims: + */ + FFT(const Domain_t& rdomain, const bool& compressTemps=false); + + ~FFT(void); + + /** + These transforms are for combinations of sine transforms and RC FFTs + + Do the FFT: specify +1 or -1 to indicate forward or inverse + transform, or specify the user-defined name string for the direction. + Supply a second BareField to store the output. + optional argument constInput indicates whether or not to treat the + input Field argument f as const. If not, we can use it as a temporary + in order to avoid an additional data transpose. + */ + void transform(int direction, RealField_t& f, ComplexField_t& g, + const bool& constInput=false); + void transform(const char* directionName, RealField_t& f, + ComplexField_t& g, const bool& constInput=false); + + /** + complex-to-real FFT, followed by sine transform(s) + Same as above, but with input and output field types reversed. + */ + void transform(int direction, ComplexField_t& f, RealField_t& g, + const bool& constInput=false); + void transform(const char* directionName, ComplexField_t& f, + RealField_t& g, const bool& constInput=false); + + /** + These transforms are for doing sine transforms only + sine transform: specify +1 or -1 to indicate forward or inverse + transform, or specify the user-defined name string for the direction. + Supply a second BareField to store the output. + optional argument constInput indicates whether or not to treat the + input Field argument f as const. If not, we can use it as a temporary + in order to avoid an additional data transpose. + */ + void transform(int direction, RealField_t& f, RealField_t& g, + const bool& constInput=false); + void transform(const char* directionName, RealField_t& f, + RealField_t& g, const bool& constInput=false); + + /** + In-place version of real-to-real transform + */ + void transform(int direction, RealField_t& f); + void transform(const char* directionName, RealField_t& f); private: - /** - setup performs all the initializations necessary after the transform - directions have been specified. - */ - void setup(void); + /** + setup performs all the initializations necessary after the transform + directions have been specified. + */ + void setup(void); - /** - which dimensions are sine transformed - */ - bool sineTransformDims_m[Dim]; + /** + which dimensions are sine transformed + */ + bool sineTransformDims_m[Dim]; - /** - number of sine transforms to perform - */ - size_t numSineTransforms_m; + /** + number of sine transforms to perform + */ + size_t numSineTransforms_m; - /** - layouts for temporary Fields: SERIAL along the zeroth dimension, with - the axes are permuted so that the transform direction is first + /** + layouts for temporary Fields: SERIAL along the zeroth dimension, with + the axes are permuted so that the transform direction is first - layouts for the temporary complex Fields - */ + layouts for the temporary complex Fields + */ - Layout_t** tempLayouts_m; + Layout_t** tempLayouts_m; - /** - layouts for the temporary real Fields - */ - Layout_t** tempRLayouts_m; + /** + layouts for the temporary real Fields + */ + Layout_t** tempRLayouts_m; - /** The array of temporary complex Fields - These use the corresponding tempLayouts. - */ - ComplexField_t** tempFields_m; + /** The array of temporary complex Fields + These use the corresponding tempLayouts. + */ + ComplexField_t** tempFields_m; - /** The array of temporary real Fields - These use the corresponding tempRLayouts. - */ - RealField_t** tempRFields_m; + /** The array of temporary real Fields + These use the corresponding tempRLayouts. + */ + RealField_t** tempRFields_m; - /** - domain of the resulting complex Field for real-to-complex transform - */ - const Domain_t* complexDomain_m; + /** + domain of the resulting complex Field for real-to-complex transform + */ + const Domain_t* complexDomain_m; }; /** @@ -849,14 +842,14 @@ private: template <size_t Dim, class T> inline void FFT<SineTransform,Dim,T>::transform( - const char* directionName, - typename FFT<SineTransform,Dim,T>::RealField_t& f, - typename FFT<SineTransform,Dim,T>::ComplexField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<SineTransform,Dim,T>::RealField_t& f, + typename FFT<SineTransform,Dim,T>::ComplexField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } /** @@ -865,14 +858,14 @@ FFT<SineTransform,Dim,T>::transform( template <size_t Dim, class T> inline void FFT<SineTransform,Dim,T>::transform( - const char* directionName, - typename FFT<SineTransform,Dim,T>::ComplexField_t& f, - typename FFT<SineTransform,Dim,T>::RealField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<SineTransform,Dim,T>::ComplexField_t& f, + typename FFT<SineTransform,Dim,T>::RealField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } /** @@ -881,14 +874,14 @@ FFT<SineTransform,Dim,T>::transform( template <size_t Dim, class T> inline void FFT<SineTransform,Dim,T>::transform( - const char* directionName, - typename FFT<SineTransform,Dim,T>::RealField_t& f, - typename FFT<SineTransform,Dim,T>::RealField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<SineTransform,Dim,T>::RealField_t& f, + typename FFT<SineTransform,Dim,T>::RealField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } /** @@ -897,12 +890,12 @@ FFT<SineTransform,Dim,T>::transform( template <size_t Dim, class T> inline void FFT<SineTransform,Dim,T>::transform( - const char* directionName, - typename FFT<SineTransform,Dim,T>::RealField_t& f) + const char* directionName, + typename FFT<SineTransform,Dim,T>::RealField_t& f) { - int dir = this->getDirection(directionName); - transform(dir, f); - return; + int dir = this->getDirection(directionName); + transform(dir, f); + return; } @@ -914,64 +907,64 @@ class FFT<SineTransform,1U,T> : public FFTBase<1U,T> { public: - typedef FieldLayout<1U> Layout_t; - typedef BareField<T,1U> RealField_t; - typedef LField<T,1U> RealLField_t; - typedef typename FFTBase<1U,T>::Domain_t Domain_t; - - /** - Constructors for doing only sine transforms - Create a new FFT object with the given domain for input/output Field - specify which dimensions to transform along. - Optional argument compress indicates whether or not to compress - temporary Fields in between uses. - */ - FFT(const Domain_t& rdomain, const bool sineTransformDims[1U], - const bool& compressTemps=false); - /** - Same as above, but transform all dims: - */ - FFT(const Domain_t& rdomain, const bool& compressTemps=false); - - - ~FFT(void); - - /** - sine transform: specify +1 or -1 to indicate forward or inverse - transform, or specify the user-defined name string for the direction. - Supply a second BareField to store the output. - optional argument constInput indicates whether or not to treat the - input Field argument f as const. If not, we can use it as a temporary - in order to avoid an additional data transpose. - */ - void transform(int direction, RealField_t& f, RealField_t& g, - const bool& constInput=false); - void transform(const char* directionName, RealField_t& f, - RealField_t& g, const bool& constInput=false); - - /** - In-place version of real-to-real transform - */ - void transform(int direction, RealField_t& f); - void transform(const char* directionName, RealField_t& f); + typedef FieldLayout<1U> Layout_t; + typedef BareField<T,1U> RealField_t; + typedef LField<T,1U> RealLField_t; + typedef typename FFTBase<1U,T>::Domain_t Domain_t; + + /** + Constructors for doing only sine transforms + Create a new FFT object with the given domain for input/output Field + specify which dimensions to transform along. + Optional argument compress indicates whether or not to compress + temporary Fields in between uses. + */ + FFT(const Domain_t& rdomain, const bool sineTransformDims[1U], + const bool& compressTemps=false); + /** + Same as above, but transform all dims: + */ + FFT(const Domain_t& rdomain, const bool& compressTemps=false); + + + ~FFT(void); + + /** + sine transform: specify +1 or -1 to indicate forward or inverse + transform, or specify the user-defined name string for the direction. + Supply a second BareField to store the output. + optional argument constInput indicates whether or not to treat the + input Field argument f as const. If not, we can use it as a temporary + in order to avoid an additional data transpose. + */ + void transform(int direction, RealField_t& f, RealField_t& g, + const bool& constInput=false); + void transform(const char* directionName, RealField_t& f, + RealField_t& g, const bool& constInput=false); + + /** + In-place version of real-to-real transform + */ + void transform(int direction, RealField_t& f); + void transform(const char* directionName, RealField_t& f); private: - /** - setup performs all the initializations necessary after the transform - directions have been specified. - */ - void setup(void); + /** + setup performs all the initializations necessary after the transform + directions have been specified. + */ + void setup(void); - /** - The temporary real Field layout - */ - Layout_t* tempRLayouts_m; + /** + The temporary real Field layout + */ + Layout_t* tempRLayouts_m; - /** - The temporary real Field - */ - RealField_t* tempRFields_m; + /** + The temporary real Field + */ + RealField_t* tempRFields_m; }; @@ -981,14 +974,14 @@ private: template <class T> inline void FFT<SineTransform,1U,T>::transform( - const char* directionName, - typename FFT<SineTransform,1U,T>::RealField_t& f, - typename FFT<SineTransform,1U,T>::RealField_t& g, - const bool& constInput) + const char* directionName, + typename FFT<SineTransform,1U,T>::RealField_t& f, + typename FFT<SineTransform,1U,T>::RealField_t& g, + const bool& constInput) { - int dir = this->getDirection(directionName); - transform(dir, f, g, constInput); - return; + int dir = this->getDirection(directionName); + transform(dir, f, g, constInput); + return; } /** @@ -997,20 +990,19 @@ FFT<SineTransform,1U,T>::transform( template <class T> inline void FFT<SineTransform,1U,T>::transform( - const char* directionName, - typename FFT<SineTransform,1U,T>::RealField_t& f) + const char* directionName, + typename FFT<SineTransform,1U,T>::RealField_t& f) { - int dir = this->getDirection(directionName); - transform(dir, f); - return; + int dir = this->getDirection(directionName); + transform(dir, f); + return; } #include "FFT/FFT.hpp" #endif // IPPL_FFT_FFT_H -/*************************************************************************** - * $RCSfile: FFT.h,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $ - * IPPL_VERSION_ID: $Id: FFT.h,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ - ***************************************************************************/ - - +// vi: set et ts=4 sw=4 sts=4: +// Local Variables: +// mode:c +// c-basic-offset: 4 +// indent-tabs-mode:nil +// End: diff --git a/ippl/src/FFT/FFT.hpp b/ippl/src/FFT/FFT.hpp index 4c29efba63ad1d1d27867d1461a5dc7bc6af4318..a7a422ba57a5c6d2079d42cead8bed6595d6dea3 100644 --- a/ippl/src/FFT/FFT.hpp +++ b/ippl/src/FFT/FFT.hpp @@ -1,28 +1,17 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// include files +// +// IPPL FFT +// +// Copyright (c) 2008-2018 +// Paul Scherrer Institut, Villigen PSI, Switzerland +// All rights reserved. +// +// OPAL is licensed under GNU GPL version 3. +// + +/** + Implementations for FFT constructor/destructor and transforms +*/ + #include "FFT/FFT.h" #include "FieldLayout/FieldLayout.h" #include "Field/BareField.h" @@ -34,129 +23,96 @@ #define FFTDBG(x) #endif - -/** - FFT.cpp: implementations for FFT constructor/destructor and transforms -*/ - - //============================================================================= // FFT CCTransform Constructors //============================================================================= /** - Create a new FFT object of type CCTransform, with a - given domain. Also specify which dimensions to transform along. + Create a new FFT object of type CCTransform, with a + given domain. Also specify which dimensions to transform along. */ template <size_t Dim, class T> FFT<CCTransform,Dim,T>::FFT( - const typename FFT<CCTransform,Dim,T>::Domain_t& cdomain, - const bool transformTheseDims[Dim], - const bool& compressTemps) - : FFTBase<Dim,T>(FFT<CCTransform,Dim,T>::ccFFT, cdomain, - transformTheseDims, compressTemps) + const typename FFT<CCTransform,Dim,T>::Domain_t& cdomain, + const bool transformTheseDims[Dim], + const bool& compressTemps) +: FFTBase<Dim,T>(FFT<CCTransform,Dim,T>::ccFFT, cdomain, + transformTheseDims, compressTemps) { -/* -#ifdef IPPL_DKS -#ifdef IPPL_DKS_OPENCL - INFOMSG("Init DKS base opencl" << endl); - base.setAPI("OpenCL", 6); - base.setDevice("-gpu", 4); - base.initDevice(); - -#endif - -#ifdef IPPL_DKS_CUDA - INFOMSG("Init DKS base cuda" << endl); - base.setAPI("Cuda", 4); - base.setDevice("-gpu", 4); - base.initDevice(); -#endif - -#ifdef IPPL_DKS_MIC - INFOMSG("Init DKS base MIC" << endl); - base.setAPI("OpenMP", 6); - base.setDevice("-mic", 4); - base.initDevice(); -#endif -#endif -*/ - - // construct array of axis lengths - size_t nTransformDims = this->numTransformDims(); - int* lengths = new int[nTransformDims]; - size_t d; - for (d=0; d<nTransformDims; ++d) - lengths[d] = cdomain[this->activeDimension(d)].length(); - - // construct array of transform types for FFT Engine, compute normalization - int* transformTypes = new int[nTransformDims]; - T& normFact = this->getNormFact(); - normFact = 1.0; - for (d=0; d<nTransformDims; ++d) { - transformTypes[d] = FFTBase<Dim,T>::ccFFT; // all transforms are complex-to-complex - normFact /= lengths[d]; - } - - // set up FFT Engine - this->getEngine().setup(nTransformDims, transformTypes, lengths); - delete [] transformTypes; - delete [] lengths; - // set up the temporary fields - setup(); + // construct array of axis lengths + size_t nTransformDims = this->numTransformDims(); + int* lengths = new int[nTransformDims]; + size_t d; + for (d=0; d<nTransformDims; ++d) + lengths[d] = cdomain[this->activeDimension(d)].length(); + + // construct array of transform types for FFT Engine, compute normalization + int* transformTypes = new int[nTransformDims]; + T& normFact = this->getNormFact(); + normFact = 1.0; + for (d=0; d<nTransformDims; ++d) { + transformTypes[d] = FFTBase<Dim,T>::ccFFT; // all transforms are complex-to-complex + normFact /= lengths[d]; + } + + // set up FFT Engine + this->getEngine().setup(nTransformDims, transformTypes, lengths); + delete [] transformTypes; + delete [] lengths; + // set up the temporary fields + setup(); } - /** - setup performs all the initializations necessary after the transform - directions have been specified. + setup performs all the initializations necessary after the transform + directions have been specified. */ template <size_t Dim, class T> void FFT<CCTransform,Dim,T>::setup(void) { - // Tau profiling - - - size_t d, activeDim; - size_t nTransformDims = this->numTransformDims(); - // Set up the arrays of temporary Fields and FieldLayouts: - e_dim_tag serialParallel[Dim]; // Specifies SERIAL, PARALLEL dims in temp - // make zeroth dimension always SERIAL - serialParallel[0] = SERIAL; - // all other dimensions parallel - for (d=1; d<Dim; ++d) - serialParallel[d] = PARALLEL; - - tempLayouts_m = new Layout_t*[nTransformDims]; - tempFields_m = new ComplexField_t*[nTransformDims]; - - // loop over transform dimensions - for (size_t dim=0; dim<nTransformDims; ++dim) { - // get number of dimension to be transformed - activeDim = this->activeDimension(dim); - // Get input Field's domain - const Domain_t& ndic = this->getDomain(); - // make new domain with permuted Indexes, activeDim first - Domain_t ndip; - ndip[0] = ndic[activeDim]; - for (d=1; d<Dim; ++d) { - size_t nextDim = activeDim + d; - if (nextDim >= Dim) nextDim -= Dim; - ndip[d] = ndic[nextDim]; - } - // generate temporary field layout - tempLayouts_m[dim] = new Layout_t(ndip, serialParallel, this->transVnodes()); - // generate temporary Field - tempFields_m[dim] = new ComplexField_t(*tempLayouts_m[dim]); - // If user requests no intermediate compression, uncompress right now: - if (!this->compressTemps()) (*tempFields_m[dim]).Uncompress(); - } + // Tau profiling + - return; + size_t d, activeDim; + size_t nTransformDims = this->numTransformDims(); + // Set up the arrays of temporary Fields and FieldLayouts: + e_dim_tag serialParallel[Dim]; // Specifies SERIAL, PARALLEL dims in temp + // make zeroth dimension always SERIAL + serialParallel[0] = SERIAL; + // all other dimensions parallel + for (d=1; d<Dim; ++d) + serialParallel[d] = PARALLEL; + + tempLayouts_m = new Layout_t*[nTransformDims]; + tempFields_m = new ComplexField_t*[nTransformDims]; + + // loop over transform dimensions + for (size_t dim=0; dim<nTransformDims; ++dim) { + // get number of dimension to be transformed + activeDim = this->activeDimension(dim); + // Get input Field's domain + const Domain_t& ndic = this->getDomain(); + // make new domain with permuted Indexes, activeDim first + Domain_t ndip; + ndip[0] = ndic[activeDim]; + for (d=1; d<Dim; ++d) { + size_t nextDim = activeDim + d; + if (nextDim >= Dim) nextDim -= Dim; + ndip[d] = ndic[nextDim]; + } + // generate temporary field layout + tempLayouts_m[dim] = new Layout_t(ndip, serialParallel, this->transVnodes()); + // generate temporary Field + tempFields_m[dim] = new ComplexField_t(*tempLayouts_m[dim]); + // If user requests no intermediate compression, uncompress right now: + if (!this->compressTemps()) (*tempFields_m[dim]).Uncompress(); + } + + return; } //----------------------------------------------------------------------------- @@ -166,22 +122,22 @@ FFT<CCTransform,Dim,T>::setup(void) template <size_t Dim, class T> FFT<CCTransform,Dim,T>::~FFT(void) { - // Tau profiling - - /* - #ifdef IPPL_OPENCL - base.ocl_cleanUp(); - #endif - */ - - // delete arrays of temporary fields and field layouts - size_t nTransformDims = this->numTransformDims(); - for (size_t d=0; d<nTransformDims; ++d) { - delete tempFields_m[d]; - delete tempLayouts_m[d]; - } - delete [] tempFields_m; - delete [] tempLayouts_m; + // Tau profiling + + /* + #ifdef IPPL_OPENCL + base.ocl_cleanUp(); + #endif + */ + + // delete arrays of temporary fields and field layouts + size_t nTransformDims = this->numTransformDims(); + for (size_t d=0; d<nTransformDims; ++d) { + delete tempFields_m[d]; + delete tempLayouts_m[d]; + } + delete [] tempFields_m; + delete [] tempLayouts_m; } @@ -192,313 +148,247 @@ FFT<CCTransform,Dim,T>::~FFT(void) { template <size_t Dim, class T> void FFT<CCTransform,Dim,T>::transform( - int direction, - typename FFT<CCTransform,Dim,T>::ComplexField_t& f, - typename FFT<CCTransform,Dim,T>::ComplexField_t& g, - const bool& constInput) + int direction, + typename FFT<CCTransform,Dim,T>::ComplexField_t& f, + typename FFT<CCTransform,Dim,T>::ComplexField_t& g, + const bool& constInput) { - // indicate we're doing another FFT - //INCIPPLSTAT(incFFTs); - - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && - this->checkDomain(this->getDomain(),out_dom), true); - - // Common loop iterate and other vars: - size_t d; - int idim; // idim loops over the number of transform dims. - int begdim, enddim; // beginning and end of transform dim loop - size_t nTransformDims = this->numTransformDims(); - // Field* for temp Field management: - ComplexField_t* temp = &f; - // Local work array passed to FFT: - Complex_t* localdata; - - // Loop over the dimensions be transformed: - begdim = (direction == +1) ? 0 : static_cast<int>(nTransformDims-1); - enddim = (direction == +1) ? static_cast<int>(nTransformDims) : -1; - for (idim = begdim; idim != enddim; idim += direction) { - - // Now do the serial transforms along this dimension: - - bool skipTranspose = false; - // if this is the first transform dimension, we might be able - // to skip the transpose into the first temporary Field - if (idim == begdim && !constInput) { - // get domain for comparison - const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && - (in_dom[0].length() == first_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); - } - - // if this is the last transform dimension, we might be able - // to skip the last temporary and transpose right into g - if (idim == enddim-direction) { - // get the domain for comparison - const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (out_dom[0].sameBase(last_dom[0])) && - (out_dom[0].length() == last_dom[0].length()) && - (out_layout.getDistribution(0) == SERIAL) && - (g.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); - } - - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && temp != &f) *temp = 0; - temp = tempFields_m[idim]; // Field* management aid - } - else if (idim == enddim-direction && temp != &g) { - // last transform and we can skip the last temporary field - // so do the transpose here using g instead - - // transpose and permute to Field with transform dim first - g[out_dom] = (*temp)[temp->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && temp != &f) *temp = 0; - temp = &g; // Field* management aid - } - - // Loop over all the Vnodes, working on the LField in each. - typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); - for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - ComplexLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdata = ldf->getP(); - - // Do 1D complex-to-complex FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - this->getEngine().callFFT(idim, direction, localdata); - // advance the data pointer - localdata += length; - } // loop over 1D strips - } // loop over all the LFields - - } // loop over all transformed dimensions - - // skip final assignment and compress if we used g as final temporary - if (temp != &g) { - - // Now assign into output Field, and compress last temp's storage: - g[out_dom] = (*temp)[temp->getLayout().getDomain()]; - if (this->compressTemps() && temp != &f) *temp = 0; - - } - - // Normalize: - if (direction == +1) - g *= Complex_t(this->getNormFact(), 0.0); + // indicate we're doing another FFT + //INCIPPLSTAT(incFFTs); + + // Check domain of incoming Fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); + PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && + this->checkDomain(this->getDomain(),out_dom), true); + + // Common loop iterate and other vars: + size_t d; + int idim; // idim loops over the number of transform dims. + int begdim, enddim; // beginning and end of transform dim loop + size_t nTransformDims = this->numTransformDims(); + // Field* for temp Field management: + ComplexField_t* temp = &f; + // Local work array passed to FFT: + Complex_t* localdata; + + // Loop over the dimensions be transformed: + begdim = (direction == +1) ? 0 : static_cast<int>(nTransformDims-1); + enddim = (direction == +1) ? static_cast<int>(nTransformDims) : -1; + for (idim = begdim; idim != enddim; idim += direction) { + + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the first transform dimension, we might be able + // to skip the transpose into the first temporary Field + if (idim == begdim && !constInput) { + // get domain for comparison + const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && + (in_dom[0].length() == first_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); + } + + // if this is the last transform dimension, we might be able + // to skip the last temporary and transpose right into g + if (idim == enddim-direction) { + // get the domain for comparison + const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (out_dom[0].sameBase(last_dom[0])) && + (out_dom[0].length() == last_dom[0].length()) && + (out_layout.getDistribution(0) == SERIAL) && + (g.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = + (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && temp != &f) *temp = 0; + temp = tempFields_m[idim]; // Field* management aid + } + else if (idim == enddim-direction && temp != &g) { + // last transform and we can skip the last temporary field + // so do the transpose here using g instead + + // transpose and permute to Field with transform dim first + g[out_dom] = (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && temp != &f) *temp = 0; + temp = &g; // Field* management aid + } + + // Loop over all the Vnodes, working on the LField in each. + typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); + for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + ComplexLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdata = ldf->getP(); + + // Do 1D complex-to-complex FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + this->getEngine().callFFT(idim, direction, localdata); + // advance the data pointer + localdata += length; + } // loop over 1D strips + } // loop over all the LFields + + } // loop over all transformed dimensions + + // skip final assignment and compress if we used g as final temporary + if (temp != &g) { + + // Now assign into output Field, and compress last temp's storage: + g[out_dom] = (*temp)[temp->getLayout().getDomain()]; + if (this->compressTemps() && temp != &f) *temp = 0; + + } + + // Normalize: + if (direction == +1) + g *= Complex_t(this->getNormFact(), 0.0); - return; + return; } -//----------------------------------------------------------------------------- -// "in-place" FFT; specify +1 or -1 to indicate forward or inverse transform. -//----------------------------------------------------------------------------- -/* -#ifdef IPPL_DKS -template <unsigned Dim, class T> -void -FFT<CCTransform, Dim, T>::transform( - int direction, - typename FFT<CCTransform,Dim,T>::ComplexField_t& f) -{ - - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - PAssert(this->checkDomain(this->getDomain(),in_dom)); - - //Field* for temp Field management: - ComplexField_t* temp = &f; - //Local work array to get data from ComplexField - Complex_t* localdata; - - //long total_size = in_dom.size(); - - typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); - l_i = temp->begin_if(); - - //get the field - ComplexLField_t* ldf = (*l_i).second.get(); - //make sure we are uncomplressed - ldf->Uncompress(); - int N[3] = {ldf->size(0), ldf->size(1), ldf->size(2)}; - - localdata = ldf->getP(); - - // DKS part - int ierr; - void *mem_ptr; - int size = N[0]*N[1]*N[2]; - - base.setupFFT(3, N); - mem_ptr = base.allocateMemory<Complex_t>(size, ierr); - ierr = base.writeData<Complex_t>(mem_ptr, localdata, size); - - if (direction == 1) { - base.callFFT(mem_ptr, 3, N); - base.callNormalizeFFT(mem_ptr, 3, N); - } else { - base.callIFFT(mem_ptr, 3, N); - //base.callNormalizeFFT(mem_ptr, 3, N); - } - - - base.readData<Complex_t>(mem_ptr, localdata, size); - base.freeMemory<Complex_t>(mem_ptr, size); - - //assign back to the original Field - if (temp != &f) { - f[in_dom] = (*temp)[temp->getLayout().getDomain()]; - if(this->compressTemps()) *temp = 0; - } - - return; -} -#else -*/ template <size_t Dim, class T> void FFT<CCTransform,Dim,T>::transform( - int direction, - typename FFT<CCTransform,Dim,T>::ComplexField_t& f) + int direction, + typename FFT<CCTransform,Dim,T>::ComplexField_t& f) { - // indicate we're doing another FFT - // INCIPPLSTAT(incFFTs); - - // Check domain of incoming Field - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); - - // Common loop iterate and other vars: - size_t d; - int idim; // idim loops over the number of transform dims. - int begdim, enddim; // beginning and end of transform dim loop - size_t nTransformDims = this->numTransformDims(); - // Field* for temp Field management: - ComplexField_t* temp = &f; - // Local work array passed to FFT: - Complex_t* localdata; - - // Loop over the dimensions be transformed: - begdim = (direction == +1) ? 0 : static_cast<int>(nTransformDims-1); - enddim = (direction == +1) ? static_cast<int>(nTransformDims) : -1; - for (idim = begdim; idim != enddim; idim += direction) { - - // Now do the serial transforms along this dimension: - - bool skipTranspose = false; - // if this is the first transform dimension, we might be able - // to skip the transpose into the first temporary Field - if (idim == begdim) { - // get domain for comparison - const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && - (in_dom[0].length() == first_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); - } - - // if this is the last transform dimension, we might be able - // to skip the last temporary and transpose right into f - if (idim == enddim-direction) { - // get domain for comparison - const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(last_dom[0])) && - (in_dom[0].length() == last_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); - } - - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && temp != &f) *temp = 0; - temp = tempFields_m[idim]; // Field* management aid - } - else if (idim == enddim-direction && temp != &f) { - // last transform and we can skip the last temporary field - // so do the transpose here using f instead - - // transpose and permute to Field with transform dim first - f[in_dom] = (*temp)[temp->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps()) *temp = 0; - temp = &f; // Field* management aid - } - - // Loop over all the Vnodes, working on the LField in each. - typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); - for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - ComplexLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdata = ldf->getP(); - - // Do 1D complex-to-complex FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - this->getEngine().callFFT(idim, direction, localdata); - // advance the data pointer - localdata += length; - } // loop over 1D strips - } // loop over all the LFields - - - } // loop over all transformed dimensions - - // skip final assignment and compress if we used f as final temporary - if (temp != &f) { - - // Now assign back into original Field, and compress last temp's storage: - f[in_dom] = (*temp)[temp->getLayout().getDomain()]; - if (this->compressTemps()) *temp = 0; - - } - - // Normalize: - if (direction == +1) - f *= Complex_t(this->getNormFact(), 0.0); + // indicate we're doing another FFT + // INCIPPLSTAT(incFFTs); + + // Check domain of incoming Field + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); + + // Common loop iterate and other vars: + size_t d; + int idim; // idim loops over the number of transform dims. + int begdim, enddim; // beginning and end of transform dim loop + size_t nTransformDims = this->numTransformDims(); + // Field* for temp Field management: + ComplexField_t* temp = &f; + // Local work array passed to FFT: + Complex_t* localdata; + + // Loop over the dimensions be transformed: + begdim = (direction == +1) ? 0 : static_cast<int>(nTransformDims-1); + enddim = (direction == +1) ? static_cast<int>(nTransformDims) : -1; + for (idim = begdim; idim != enddim; idim += direction) { + + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the first transform dimension, we might be able + // to skip the transpose into the first temporary Field + if (idim == begdim) { + // get domain for comparison + const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && + (in_dom[0].length() == first_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); + } + + // if this is the last transform dimension, we might be able + // to skip the last temporary and transpose right into f + if (idim == enddim-direction) { + // get domain for comparison + const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(last_dom[0])) && + (in_dom[0].length() == last_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<CCTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = + (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && temp != &f) *temp = 0; + temp = tempFields_m[idim]; // Field* management aid + } + else if (idim == enddim-direction && temp != &f) { + // last transform and we can skip the last temporary field + // so do the transpose here using f instead + + // transpose and permute to Field with transform dim first + f[in_dom] = (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps()) *temp = 0; + temp = &f; // Field* management aid + } + + // Loop over all the Vnodes, working on the LField in each. + typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); + for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + ComplexLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdata = ldf->getP(); + + // Do 1D complex-to-complex FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + this->getEngine().callFFT(idim, direction, localdata); + // advance the data pointer + localdata += length; + } // loop over 1D strips + } // loop over all the LFields + + + } // loop over all transformed dimensions + + // skip final assignment and compress if we used f as final temporary + if (temp != &f) { + + // Now assign back into original Field, and compress last temp's storage: + f[in_dom] = (*temp)[temp->getLayout().getDomain()]; + if (this->compressTemps()) *temp = 0; + + } + + // Normalize: + if (direction == +1) + f *= Complex_t(this->getNormFact(), 0.0); - return; + return; } -//#endif //============================================================================= // 1D FFT CCTransform Constructors @@ -511,32 +401,32 @@ FFT<CCTransform,Dim,T>::transform( template <class T> FFT<CCTransform,1U,T>::FFT( - const typename FFT<CCTransform,1U,T>::Domain_t& cdomain, - const bool transformTheseDims[1U], const bool& compressTemps) - : FFTBase<1U,T>(FFT<CCTransform,1U,T>::ccFFT, cdomain, - transformTheseDims, compressTemps) + const typename FFT<CCTransform,1U,T>::Domain_t& cdomain, + const bool transformTheseDims[1U], const bool& compressTemps) +: FFTBase<1U,T>(FFT<CCTransform,1U,T>::ccFFT, cdomain, + transformTheseDims, compressTemps) { - // Tau profiling + // Tau profiling - size_t nTransformDims = 1U; - // get axis length - int length; - length = cdomain[0].length(); + size_t nTransformDims = 1U; + // get axis length + int length; + length = cdomain[0].length(); - // get transform type for FFT Engine, compute normalization - int transformType; - transformType = FFTBase<1U,T>::ccFFT; // all transforms are complex-to-complex - T& normFact = this->getNormFact(); - normFact = 1.0 / length; + // get transform type for FFT Engine, compute normalization + int transformType; + transformType = FFTBase<1U,T>::ccFFT; // all transforms are complex-to-complex + T& normFact = this->getNormFact(); + normFact = 1.0 / length; - // set up FFT Engine - this->getEngine().setup(nTransformDims, &transformType, &length); - // set up the temporary fields - setup(); + // set up FFT Engine + this->getEngine().setup(nTransformDims, &transformType, &length); + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -546,30 +436,27 @@ FFT<CCTransform,1U,T>::FFT( template <class T> FFT<CCTransform,1U,T>::FFT( - const typename FFT<CCTransform,1U,T>::Domain_t& cdomain, - const bool& compressTemps) - : FFTBase<1U,T>(FFT<CCTransform,1U,T>::ccFFT, cdomain, compressTemps) + const typename FFT<CCTransform,1U,T>::Domain_t& cdomain, + const bool& compressTemps) +: FFTBase<1U,T>(FFT<CCTransform,1U,T>::ccFFT, cdomain, compressTemps) { - // Tau profiling - - - + // Tau profiling - // get axis length - int length; - length = cdomain[0].length(); + // get axis length + int length; + length = cdomain[0].length(); - // get transform type for FFT Engine, compute normalization - int transformType; - transformType = FFTBase<1U,T>::ccFFT; // all transforms are complex-to-complex - T& normFact = this->getNormFact(); - normFact = 1.0 / length; + // get transform type for FFT Engine, compute normalization + int transformType; + transformType = FFTBase<1U,T>::ccFFT; // all transforms are complex-to-complex + T& normFact = this->getNormFact(); + normFact = 1.0 / length; - // set up FFT Engine - this->getEngine().setup(1U, &transformType, &length); - // set up the temporary fields - setup(); + // set up FFT Engine + this->getEngine().setup(1U, &transformType, &length); + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -581,21 +468,18 @@ template <class T> void FFT<CCTransform,1U,T>::setup(void) { - // Tau profiling + // Tau profiling + // Get input Field's domain + const Domain_t& ndic = this->getDomain(); + // generate temporary field layout + tempLayouts_m = new Layout_t(ndic[0], PARALLEL, 1); + // generate temporary Field + tempFields_m = new ComplexField_t(*tempLayouts_m); + // If user requests no intermediate compression, uncompress right now: + if (!this->compressTemps()) tempFields_m->Uncompress(); - - - // Get input Field's domain - const Domain_t& ndic = this->getDomain(); - // generate temporary field layout - tempLayouts_m = new Layout_t(ndic[0], PARALLEL, 1); - // generate temporary Field - tempFields_m = new ComplexField_t(*tempLayouts_m); - // If user requests no intermediate compression, uncompress right now: - if (!this->compressTemps()) tempFields_m->Uncompress(); - - return; + return; } //----------------------------------------------------------------------------- @@ -605,14 +489,14 @@ FFT<CCTransform,1U,T>::setup(void) template <class T> FFT<CCTransform,1U,T>::~FFT(void) { - // Tau profiling + // Tau profiling - // delete temporary fields and field layouts - delete tempFields_m; - delete tempLayouts_m; + // delete temporary fields and field layouts + delete tempFields_m; + delete tempLayouts_m; } @@ -623,107 +507,107 @@ FFT<CCTransform,1U,T>::~FFT(void) { template <class T> void FFT<CCTransform,1U,T>::transform( - int direction, - typename FFT<CCTransform,1U,T>::ComplexField_t& f, - typename FFT<CCTransform,1U,T>::ComplexField_t& g, - const bool& constInput) + int direction, + typename FFT<CCTransform,1U,T>::ComplexField_t& f, + typename FFT<CCTransform,1U,T>::ComplexField_t& g, + const bool& constInput) { - // indicate we're doing another FFT - // INCIPPLSTAT(incFFTs); + // indicate we're doing another FFT + // INCIPPLSTAT(incFFTs); - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && - this->checkDomain(this->getDomain(),out_dom), true); + // Check domain of incoming Fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); + PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && + this->checkDomain(this->getDomain(),out_dom), true); - // Field* for temp Field management: - ComplexField_t* temp = &f; - // Local work array passed to FFT: - Complex_t* localdata; + // Field* for temp Field management: + ComplexField_t* temp = &f; + // Local work array passed to FFT: + Complex_t* localdata; - // Now do the serial transforms along this dimension: + // Now do the serial transforms along this dimension: - // get temp domain for comparison - const Domain_t& temp_dom = tempLayouts_m->getDomain(); + // get temp domain for comparison + const Domain_t& temp_dom = tempLayouts_m->getDomain(); - bool skipTranspose = false; - // if this is the first transform dimension, we might be able - // to skip the transpose into the first temporary Field - if (!constInput) { - // check that zeroth axis is the same, has one vnode, + bool skipTranspose = false; + // if this is the first transform dimension, we might be able + // to skip the transpose into the first temporary Field + if (!constInput) { + // check that zeroth axis is the same, has one vnode, + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(temp_dom[0])) && + (in_dom[0].length() == temp_dom[0].length()) && + (in_layout.numVnodes() == 1) && + (f.getGC() == FFT<CCTransform,1U,T>::nullGC) ); + } + + bool skipFinal; + // we might be able + // to skip the last temporary and transpose right into g + + // check that zeroth axis is the same, has one vnode // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(temp_dom[0])) && - (in_dom[0].length() == temp_dom[0].length()) && - (in_layout.numVnodes() == 1) && - (f.getGC() == FFT<CCTransform,1U,T>::nullGC) ); - } - - bool skipFinal; - // we might be able - // to skip the last temporary and transpose right into g - - // check that zeroth axis is the same, has one vnode - // and that there are no guard cells - skipFinal = ( (out_dom[0].sameBase(temp_dom[0])) && - (out_dom[0].length() == temp_dom[0].length()) && - (out_layout.numVnodes() == 1) && - (g.getGC() == FFT<CCTransform,1U,T>::nullGC) ); - - if (!skipTranspose) { - // assign to Field with proper layout - (*tempFields_m) = (*temp); - temp = tempFields_m; // Field* management aid - } - if (skipFinal) { - // we can skip the last temporary field - // so do the transpose here using g instead - - // assign to Field with proper layout - g = (*temp); + skipFinal = ( (out_dom[0].sameBase(temp_dom[0])) && + (out_dom[0].length() == temp_dom[0].length()) && + (out_layout.numVnodes() == 1) && + (g.getGC() == FFT<CCTransform,1U,T>::nullGC) ); - // Compress out previous iterate's storage: - if (this->compressTemps() && temp != &f) *temp = 0; - temp = &g; // Field* management aid - } + if (!skipTranspose) { + // assign to Field with proper layout + (*tempFields_m) = (*temp); + temp = tempFields_m; // Field* management aid + } + if (skipFinal) { + // we can skip the last temporary field + // so do the transpose here using g instead + // assign to Field with proper layout + g = (*temp); + // Compress out previous iterate's storage: + if (this->compressTemps() && temp != &f) *temp = 0; + temp = &g; // Field* management aid + } - // should be only one LField! - typename ComplexField_t::const_iterator_if l_i = temp->begin_if(); - if (l_i != temp->end_if()) { - // Get the LField - ComplexLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdata = ldf->getP(); - // Do the 1D FFT: - this->getEngine().callFFT(0, direction, localdata); - } + // should be only one LField! + typename ComplexField_t::const_iterator_if l_i = temp->begin_if(); + if (l_i != temp->end_if()) { + // Get the LField + ComplexLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdata = ldf->getP(); + // Do the 1D FFT: + this->getEngine().callFFT(0, direction, localdata); + } - // skip final assignment and compress if we used g as final temporary - if (temp != &g) { - // Now assign into output Field, and compress last temp's storage: - g = (*temp); - if (this->compressTemps() && temp != &f) *temp = 0; - } + // skip final assignment and compress if we used g as final temporary + if (temp != &g) { + + // Now assign into output Field, and compress last temp's storage: + g = (*temp); + if (this->compressTemps() && temp != &f) *temp = 0; - // Normalize: - if (direction == +1) - g *= Complex_t(this->getNormFact(), 0.0); + } + + // Normalize: + if (direction == +1) + g *= Complex_t(this->getNormFact(), 0.0); - return; + return; } //----------------------------------------------------------------------------- @@ -733,79 +617,79 @@ FFT<CCTransform,1U,T>::transform( template <class T> void FFT<CCTransform,1U,T>::transform( - int direction, - typename FFT<CCTransform,1U,T>::ComplexField_t& f) + int direction, + typename FFT<CCTransform,1U,T>::ComplexField_t& f) { - // indicate we're doing another FFT - // INCIPPLSTAT(incFFTs); + // indicate we're doing another FFT + // INCIPPLSTAT(incFFTs); - // Check domain of incoming Field - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); + // Check domain of incoming Field + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); - // Field* for temp Field management: - ComplexField_t* temp = &f; - // Local work array passed to FFT: - Complex_t* localdata; + // Field* for temp Field management: + ComplexField_t* temp = &f; + // Local work array passed to FFT: + Complex_t* localdata; - // Now do the serial transforms along this dimension: + // Now do the serial transforms along this dimension: - // get domain for comparison - const Domain_t& temp_dom = tempLayouts_m->getDomain(); + // get domain for comparison + const Domain_t& temp_dom = tempLayouts_m->getDomain(); - bool skipTranspose; - // we might be able - // to skip the transpose into the first temporary Field + bool skipTranspose; + // we might be able + // to skip the transpose into the first temporary Field - // check that zeroth axis is the same, has one vnode, - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(temp_dom[0])) && - (in_dom[0].length() == temp_dom[0].length()) && - (in_layout.numVnodes() == 1) && - (f.getGC() == FFT<CCTransform,1U,T>::nullGC) ); + // check that zeroth axis is the same, has one vnode, + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(temp_dom[0])) && + (in_dom[0].length() == temp_dom[0].length()) && + (in_layout.numVnodes() == 1) && + (f.getGC() == FFT<CCTransform,1U,T>::nullGC) ); - if (!skipTranspose) { - // assign to Field with proper layout - (*tempFields_m) = (*temp); - temp = tempFields_m; // Field* management aid - } + if (!skipTranspose) { + // assign to Field with proper layout + (*tempFields_m) = (*temp); + temp = tempFields_m; // Field* management aid + } - // should be only one LField! - typename ComplexField_t::const_iterator_if l_i = temp->begin_if(); - if (l_i != temp->end_if()) { - // Get the LField - ComplexLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdata = ldf->getP(); + // should be only one LField! + typename ComplexField_t::const_iterator_if l_i = temp->begin_if(); + if (l_i != temp->end_if()) { + // Get the LField + ComplexLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdata = ldf->getP(); - // Do the 1D FFT: - this->getEngine().callFFT(0, direction, localdata); - } + // Do the 1D FFT: + this->getEngine().callFFT(0, direction, localdata); + } - // skip final assignment and compress if we used f as final temporary - if (temp != &f) { + // skip final assignment and compress if we used f as final temporary + if (temp != &f) { - // Now assign back into original Field, and compress last temp's storage: - f = (*temp); - if (this->compressTemps()) *temp = 0; + // Now assign back into original Field, and compress last temp's storage: + f = (*temp); + if (this->compressTemps()) *temp = 0; - } + } - // Normalize: - if (direction == +1) - f *= Complex_t(this->getNormFact(), 0.0); + // Normalize: + if (direction == +1) + f *= Complex_t(this->getNormFact(), 0.0); - return; + return; } @@ -823,75 +707,38 @@ FFT<CCTransform,1U,T>::transform( template <size_t Dim, class T> FFT<RCTransform,Dim,T>::FFT( - const typename FFT<RCTransform,Dim,T>::Domain_t& rdomain, - const typename FFT<RCTransform,Dim,T>::Domain_t& cdomain, - const bool transformTheseDims[Dim], const bool& compressTemps) - : FFTBase<Dim,T>(FFT<RCTransform,Dim,T>::rcFFT, rdomain, - transformTheseDims, compressTemps), + const typename FFT<RCTransform,Dim,T>::Domain_t& rdomain, + const typename FFT<RCTransform,Dim,T>::Domain_t& cdomain, + const bool transformTheseDims[Dim], const bool& compressTemps) +: FFTBase<Dim,T>(FFT<RCTransform,Dim,T>::rcFFT, rdomain, + transformTheseDims, compressTemps), complexDomain_m(cdomain), serialAxes_m(1) { -/* -#ifdef IPPL_DKS -#ifdef IPPL_DKS_OPENCL - INFOMSG("Init DKS base opencl" << endl); - //base = DKSBase(); - base.setAPI("OpenCL", 6); - base.setDevice("-gpu", 4); - base.initDevice(); - -#endif - -#ifdef IPPL_DKS_CUDA - INFOMSG("Init DKS base cuda" << endl); - base.setAPI("Cuda", 4); - base.setDevice("-gpu", 4); - base.initDevice(); - - //create a stream for fft execution other than default - base.createStream(fftStreamId); - -#endif - -#ifdef IPPL_DKS_MIC - INFOMSG("Init DKS base MIC" << endl); - base.setAPI("OpenMP", 6); - base.setDevice("-mic", 4); - base.initDevice(); - - int dimsize[Dim]; - for (int d=0; d<Dim; ++d) - dimsize[d] = rdomain[d].length(); - - base.setupFFTRC(Dim, dimsize); - base.setupFFTCR(Dim, dimsize,1./(dimsize[0]*dimsize[1]*dimsize[2])); -#endif -#endif -*/ - // construct array of axis lengths - size_t nTransformDims = this->numTransformDims(); - int* lengths = new int[nTransformDims]; - size_t d; - for (d=0; d<nTransformDims; ++d) - lengths[d] = rdomain[this->activeDimension(d)].length(); - - // construct array of transform types for FFT Engine, compute normalization - int* transformTypes = new int[nTransformDims]; - T& normFact = this->getNormFact(); - normFact = 1.0; - transformTypes[0] = FFTBase<Dim,T>::rcFFT; // first transform is real-to-complex - normFact /= lengths[0]; - for (d=1; d<nTransformDims; ++d) { - transformTypes[d] = FFTBase<Dim,T>::ccFFT; // all other transforms are complex-to-complex - normFact /= lengths[d]; - } - - // set up FFT Engine - this->getEngine().setup(nTransformDims, transformTypes, lengths); - delete [] transformTypes; - delete [] lengths; - - // set up the temporary fields - setup(); + // construct array of axis lengths + size_t nTransformDims = this->numTransformDims(); + int* lengths = new int[nTransformDims]; + size_t d; + for (d=0; d<nTransformDims; ++d) + lengths[d] = rdomain[this->activeDimension(d)].length(); + + // construct array of transform types for FFT Engine, compute normalization + int* transformTypes = new int[nTransformDims]; + T& normFact = this->getNormFact(); + normFact = 1.0; + transformTypes[0] = FFTBase<Dim,T>::rcFFT; // first transform is real-to-complex + normFact /= lengths[0]; + for (d=1; d<nTransformDims; ++d) { + transformTypes[d] = FFTBase<Dim,T>::ccFFT; // all other transforms are complex-to-complex + normFact /= lengths[d]; + } + + // set up FFT Engine + this->getEngine().setup(nTransformDims, transformTypes, lengths); + delete [] transformTypes; + delete [] lengths; + + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -901,74 +748,37 @@ FFT<RCTransform,Dim,T>::FFT( template <size_t Dim, class T> FFT<RCTransform,Dim,T>::FFT( - const typename FFT<RCTransform,Dim,T>::Domain_t& rdomain, - const typename FFT<RCTransform,Dim,T>::Domain_t& cdomain, - const bool& compressTemps, - int serialAxes) - : FFTBase<Dim,T>(FFT<RCTransform,Dim,T>::rcFFT, rdomain, compressTemps), + const typename FFT<RCTransform,Dim,T>::Domain_t& rdomain, + const typename FFT<RCTransform,Dim,T>::Domain_t& cdomain, + const bool& compressTemps, + int serialAxes) +: FFTBase<Dim,T>(FFT<RCTransform,Dim,T>::rcFFT, rdomain, compressTemps), complexDomain_m(cdomain), serialAxes_m(serialAxes) { - // Tau profiling - -/* -#ifdef IPPL_DKS -#ifdef IPPL_DKS_OPENCL - INFOMSG("Init DKS base opencl" << endl); - base.setAPI("OpenCL", 6); - base.setDevice("-gpu", 4); - base.initDevice(); - -#endif - -#ifdef IPPL_DKS_CUDA - INFOMSG("Init DKS base cuda" << endl); - base.setAPI("Cuda", 4); - base.setDevice("-gpu", 4); - base.initDevice(); - base.setupFFT(0, NULL); - - base.createStream(fftStreamId); -#endif - + // Tau profiling -#ifdef IPPL_DKS_MIC - INFOMSG("Init DKS base MIC" << endl); - base.setAPI("OpenMP", 6); - base.setDevice("-mic", 4); - base.initDevice(); -//BENI: Setup MIC for RC FFT and CR FFT (creates the different handles) + // construct array of axis lengths + int lengths[Dim]; + size_t d; + for (d=0; d<Dim; ++d) + lengths[d] = rdomain[d].length(); + + // construct array of transform types for FFT Engine, compute normalization + int transformTypes[Dim]; + T& normFact = this->getNormFact(); + normFact = 1.0; + transformTypes[0] = FFTBase<Dim,T>::rcFFT; // first transform is real-to-complex + normFact /= lengths[0]; + for (d=1; d<Dim; ++d) { + transformTypes[d] = FFTBase<Dim,T>::ccFFT; // all other transforms are complex-to-complex + normFact /= lengths[d]; + } - int dimsize[Dim]; - for (int d=0; d<Dim; ++d) - dimsize[d] = rdomain[d].length(); + // set up FFT Engine + this->getEngine().setup(Dim, transformTypes, lengths); - base.setupFFTRC(Dim, dimsize); - base.setupFFTCR(Dim, dimsize,1./(dimsize[0]*dimsize[1]*dimsize[2])); -#endif -#endif -*/ - // construct array of axis lengths - int lengths[Dim]; - size_t d; - for (d=0; d<Dim; ++d) - lengths[d] = rdomain[d].length(); - - // construct array of transform types for FFT Engine, compute normalization - int transformTypes[Dim]; - T& normFact = this->getNormFact(); - normFact = 1.0; - transformTypes[0] = FFTBase<Dim,T>::rcFFT; // first transform is real-to-complex - normFact /= lengths[0]; - for (d=1; d<Dim; ++d) { - transformTypes[d] = FFTBase<Dim,T>::ccFFT; // all other transforms are complex-to-complex - normFact /= lengths[d]; - } - - // set up FFT Engine - this->getEngine().setup(Dim, transformTypes, lengths); - - // set up the temporary fields - setup(); + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -980,133 +790,133 @@ template <size_t Dim, class T> void FFT<RCTransform,Dim,T>::setup(void) { - // Tau profiling + // Tau profiling - PAssert_GT(serialAxes_m, 0); - PAssert_LT((size_t) serialAxes_m, Dim); + PAssert_GT(serialAxes_m, 0); + PAssert_LT((size_t) serialAxes_m, Dim); - size_t d, d2, activeDim; - size_t nTransformDims = this->numTransformDims(); + size_t d, d2, activeDim; + size_t nTransformDims = this->numTransformDims(); - // Set up the arrays of temporary Fields and FieldLayouts: + // Set up the arrays of temporary Fields and FieldLayouts: - // make first dimension(s) always SERIAL, all other dimensions parallel - // for the real FFT; make first serialAxes_m axes serial for others - e_dim_tag serialParallel[Dim]; - e_dim_tag NserialParallel[Dim]; - for (d=0; d < Dim; ++d) { - serialParallel[d] = (d == 0 ? SERIAL : PARALLEL); - NserialParallel[d] = (d < (size_t) serialAxes_m ? SERIAL : PARALLEL); - } - - // check that domain lengths agree between real and complex domains - const Domain_t& domain = this->getDomain(); - activeDim = this->activeDimension(0); - bool match = true; - for (d=0; d<Dim; ++d) { - if (d == activeDim) { - // real array length n, complex array length n/2+1 - if ( complexDomain_m[d].length() != - (domain[d].length()/2 + 1) ) match = false; - } - else { - // real and complex arrays should be same length for all other dims - if (complexDomain_m[d].length() != domain[d].length()) match = false; - } - } - PInsist(match, - "Domains provided for real and complex Fields are incompatible!"); - - // allocate arrays of temp fields and layouts for complex fields - tempLayouts_m = new Layout_t*[nTransformDims]; - tempFields_m = new ComplexField_t*[nTransformDims]; - - // set up the single temporary real field, with first dim serial, others par - - // make new domains with permuted Indexes, activeDim first - Domain_t ndip; - Domain_t ndipc; - ndip[0] = domain[activeDim]; - ndipc[0] = complexDomain_m[activeDim]; - for (d=1; d<Dim; ++d) { - size_t nextDim = activeDim + d; - if (nextDim >= Dim) nextDim -= Dim; - ndip[d] = domain[nextDim]; - ndipc[d] = complexDomain_m[nextDim]; - } - - // generate layout and object for temporary real field - tempRLayout_m = new Layout_t(ndip, serialParallel, this->transVnodes()); - tempRField_m = new RealField_t(*tempRLayout_m); - - // generate layout and object for first temporary complex Field - tempLayouts_m[0] = new Layout_t(ndipc, serialParallel, this->transVnodes()); - tempFields_m[0] = new ComplexField_t(*tempLayouts_m[0]); - - // determine the order in which dimensions will be transposed. Put - // the transposed dims first, and the others at the end. - int fftorder[Dim], tmporder[Dim]; - int nofft = nTransformDims; - for (d=0; d < nTransformDims; ++d) - fftorder[d] = this->activeDimension(d); - for (d=0; d < Dim; ++d) { - // see if the dth dimension is one to transform - bool active = false; - for (d2=0; d2 < nTransformDims; ++d2) { - if (this->activeDimension(d2) == d) { - active = true; - break; - } + // make first dimension(s) always SERIAL, all other dimensions parallel + // for the real FFT; make first serialAxes_m axes serial for others + e_dim_tag serialParallel[Dim]; + e_dim_tag NserialParallel[Dim]; + for (d=0; d < Dim; ++d) { + serialParallel[d] = (d == 0 ? SERIAL : PARALLEL); + NserialParallel[d] = (d < (size_t) serialAxes_m ? SERIAL : PARALLEL); } - if (!active) - // no it is not; put it at the bottom of list - fftorder[nofft++] = d; - } - - // But since the first FFT is done on a S,[P,P,...] field, permute - // the order of this to get the first activeDimension at the end. - nofft = fftorder[0]; - for (d=0; d < (Dim - 1); ++d) - fftorder[d] = fftorder[d+1]; - fftorder[Dim-1] = nofft; - - // now construct the remaining temporary complex fields - - // loop through and create actual permuted layouts, and also fields - size_t dim = 1; // already have one temp field - while (dim < nTransformDims) { - - int sp; - for (sp=0; sp < serialAxes_m && dim < nTransformDims; ++sp, ++dim) { - - // make new domain with permuted Indexes - for (d=0; d < Dim; ++d) - ndip[d] = complexDomain_m[fftorder[d]]; - - // generate layout and object for temporary complex Field - tempLayouts_m[dim] = new Layout_t(ndip, NserialParallel, this->transVnodes()); - tempFields_m[dim] = new ComplexField_t(*tempLayouts_m[dim]); - - // permute the fft order for the first 'serialAxes_m' axes - if (serialAxes_m > 1) { - tmporder[0] = fftorder[0]; - for (d=0; d < (size_t) (serialAxes_m-1); ++d) - fftorder[d] = fftorder[d+1]; - fftorder[serialAxes_m - 1] = tmporder[0]; - } + // check that domain lengths agree between real and complex domains + const Domain_t& domain = this->getDomain(); + activeDim = this->activeDimension(0); + bool match = true; + for (d=0; d<Dim; ++d) { + if (d == activeDim) { + // real array length n, complex array length n/2+1 + if ( complexDomain_m[d].length() != + (domain[d].length()/2 + 1) ) match = false; + } + else { + // real and complex arrays should be same length for all other dims + if (complexDomain_m[d].length() != domain[d].length()) match = false; + } } + PInsist(match, + "Domains provided for real and complex Fields are incompatible!"); + + // allocate arrays of temp fields and layouts for complex fields + tempLayouts_m = new Layout_t*[nTransformDims]; + tempFields_m = new ComplexField_t*[nTransformDims]; - // now, permute ALL the axes by serialAxes_m steps, to get the next - // set of axes in the first n serial slots - for (d=0; d < Dim; ++d) - tmporder[d] = fftorder[d]; - for (d=0; d < Dim; ++d) - fftorder[d] = tmporder[(d + serialAxes_m) % Dim]; - } + // set up the single temporary real field, with first dim serial, others par + + // make new domains with permuted Indexes, activeDim first + Domain_t ndip; + Domain_t ndipc; + ndip[0] = domain[activeDim]; + ndipc[0] = complexDomain_m[activeDim]; + for (d=1; d<Dim; ++d) { + size_t nextDim = activeDim + d; + if (nextDim >= Dim) nextDim -= Dim; + ndip[d] = domain[nextDim]; + ndipc[d] = complexDomain_m[nextDim]; + } + + // generate layout and object for temporary real field + tempRLayout_m = new Layout_t(ndip, serialParallel, this->transVnodes()); + tempRField_m = new RealField_t(*tempRLayout_m); + + // generate layout and object for first temporary complex Field + tempLayouts_m[0] = new Layout_t(ndipc, serialParallel, this->transVnodes()); + tempFields_m[0] = new ComplexField_t(*tempLayouts_m[0]); + + // determine the order in which dimensions will be transposed. Put + // the transposed dims first, and the others at the end. + int fftorder[Dim], tmporder[Dim]; + int nofft = nTransformDims; + for (d=0; d < nTransformDims; ++d) + fftorder[d] = this->activeDimension(d); + for (d=0; d < Dim; ++d) { + // see if the dth dimension is one to transform + bool active = false; + for (d2=0; d2 < nTransformDims; ++d2) { + if (this->activeDimension(d2) == d) { + active = true; + break; + } + } + + if (!active) + // no it is not; put it at the bottom of list + fftorder[nofft++] = d; + } + + // But since the first FFT is done on a S,[P,P,...] field, permute + // the order of this to get the first activeDimension at the end. + nofft = fftorder[0]; + for (d=0; d < (Dim - 1); ++d) + fftorder[d] = fftorder[d+1]; + fftorder[Dim-1] = nofft; + + // now construct the remaining temporary complex fields + + // loop through and create actual permuted layouts, and also fields + size_t dim = 1; // already have one temp field + while (dim < nTransformDims) { + + int sp; + for (sp=0; sp < serialAxes_m && dim < nTransformDims; ++sp, ++dim) { + + // make new domain with permuted Indexes + for (d=0; d < Dim; ++d) + ndip[d] = complexDomain_m[fftorder[d]]; + + // generate layout and object for temporary complex Field + tempLayouts_m[dim] = new Layout_t(ndip, NserialParallel, this->transVnodes()); + tempFields_m[dim] = new ComplexField_t(*tempLayouts_m[dim]); + + // permute the fft order for the first 'serialAxes_m' axes + if (serialAxes_m > 1) { + tmporder[0] = fftorder[0]; + for (d=0; d < (size_t) (serialAxes_m-1); ++d) + fftorder[d] = fftorder[d+1]; + fftorder[serialAxes_m - 1] = tmporder[0]; + } + } + + // now, permute ALL the axes by serialAxes_m steps, to get the next + // set of axes in the first n serial slots + for (d=0; d < Dim; ++d) + tmporder[d] = fftorder[d]; + for (d=0; d < Dim; ++d) + fftorder[d] = tmporder[(d + serialAxes_m) % Dim]; + } } @@ -1117,19 +927,19 @@ FFT<RCTransform,Dim,T>::setup(void) { template <size_t Dim, class T> FFT<RCTransform,Dim,T>::~FFT(void) { - // Tau profiling + // Tau profiling - // delete temporary fields and layouts - size_t nTransformDims = this->numTransformDims(); - for (size_t d=0; d<nTransformDims; ++d) { - delete tempFields_m[d]; - delete tempLayouts_m[d]; - } - delete [] tempFields_m; - delete [] tempLayouts_m; - delete tempRField_m; - delete tempRLayout_m; + // delete temporary fields and layouts + size_t nTransformDims = this->numTransformDims(); + for (size_t d=0; d<nTransformDims; ++d) { + delete tempFields_m[d]; + delete tempLayouts_m[d]; + } + delete [] tempFields_m; + delete [] tempLayouts_m; + delete tempRField_m; + delete tempRLayout_m; } @@ -1145,677 +955,386 @@ FFT<RCTransform,Dim,T>::~FFT(void) { template <size_t Dim, class T> void FFT<RCTransform,Dim,T>::transformDKSRC( - int direction, - typename FFT<RCTransform,Dim,T>::RealField_t& f, - void* real_ptr, - void* comp_ptr, - DKSOPAL &dksbase, - int streamId, - const bool& constInput) + int direction, + typename FFT<RCTransform,Dim,T>::RealField_t& f, + void* real_ptr, + void* comp_ptr, + DKSOPAL &dksbase, + int streamId, + const bool& constInput) { - //check the domain of incoming field - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - - PAssert_EQ( this->checkDomain(this->getDomain(), in_dom), true); - - size_t nTransformDims = this->numTransformDims(); - - //*** using tempRField_m and transposing f field ***// - /* - RealField_t* tempR = tempRField_m; + //check the domain of incoming field + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); - if (!constInput) { - // see if we can use input field f as a temporary - bool skipTemp = true; + PAssert_EQ( this->checkDomain(this->getDomain(), in_dom), true); - // more rigorous match required here; check that layouts are identical - if ( !(in_layout == *tempRLayout_m) ) { - skipTemp = false; - } else { - // make sure distributions match - for (unsigned d=0; d<Dim; ++d) - if (in_layout.getDistribution(d) != tempRLayout_m->getDistribution(d)) - skipTemp = false; - - // make sure vnode counts match - if (in_layout.numVnodes() != tempRLayout_m->numVnodes()) - skipTemp = false; - - // also make sure there are no guard cells - if (!(f.getGC() == FFT<RCTransform,Dim,T>::nullGC)) - skipTemp = false; - } + size_t nTransformDims = this->numTransformDims(); - // if we can skip using this temporary, set the tempr pointer to the - // original incoming field. otherwise, it will stay pointing at the - // temporary real field, and we'll need to do a transpose of the data - // from the original into the temporary. - if (skipTemp) - tempR = &f; - } - - // if we're not using input as a temporary ... - if (tempR != &f) { - // transpose and permute to real field with transform dim first - (*tempR)[tempR->getDomain()] = f[in_dom]; - } - */ - //*** just use f field as is and keep decomposition as defined in input file ***// - RealField_t* tempR = &f; - - typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); - rl_i = tempR->begin_if(); - - // get the lfields - RealLField_t* rldf = (*rl_i).second.get(); - // make sure we are uncompressed - rldf->Uncompress(); - // get the raw data pointers - T* localreal = rldf->getP(); - - /** get global dimensions of real domain and local dimensions of real subdomain - calc global dimensions of complex subdomain */ - int NR_l[Dim], NR_g[Dim], NC_g[Dim]; - for (size_t d = 0; d < Dim; d++) { - NR_l[d] = (int)rldf->size(d); - NR_g[d] = (int)tempR->getDomain()[d].length(); - NC_g[d] = NR_g[d]; - } - NC_g[0] = (NC_g[0] / 2) + 1; - - //get global and local domain sizes - int sizereal = NR_l[0]*NR_l[1]*NR_l[2]; - int totalreal = tempR->getDomain().size(); - //int totalcomp = NC_g[0]*NC_g[1]*NC_g[2]; - - //local vnodes get starting position for real field subdomains - int *idx = new int[Ippl::getNodes()]; - int *idy = new int[Ippl::getNodes()]; - int *idz = new int[Ippl::getNodes()]; - for (typename Layout_t::const_iterator_iv i_s = tempR->getLayout().begin_iv(); i_s != tempR->getLayout().end_iv(); ++i_s) { - Domain_t tmp = (*i_s).second->getDomain(); - int node = (*i_s).second->getNode(); - idx[node] = tmp[0].min(); - idy[node] = tmp[1].min(); - idz[node] = tmp[2].min(); - } - - //remote vnodes get starting position for real field subdomains - for (typename Layout_t::iterator_dv remote = tempR->getLayout().begin_rdv(); remote != tempR->getLayout().end_rdv(); ++remote) { - Domain_t tmp = (*remote).second->getDomain(); - int node = (*remote).second->getNode(); - idx[node] = tmp[0].min(); - idy[node] = tmp[1].min(); - idz[node] = tmp[2].min(); - } - - int id[3] = {idx[Ippl::myNode()], idy[Ippl::myNode()], idz[Ippl::myNode()]}; - - if (Ippl::myNode() == 0) { - - //if only one node is working do dksbase write otherwise use cuda aware mpi - if (Ippl::getNodes() > 1) { - - if (streamId == -1) { - //gather data from different mpi processes directly into gpu buffer - dksbase.gather3DData( real_ptr, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, - idx, idy, idz, - Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); - } else { - //gather data using CUDA IPC for async data transfer - dksbase.gather3DDataAsync<T>( real_ptr, localreal, NR_g, NR_l, id, streamId); - //sync needed to wait for data transfer to finish - dksbase.syncDevice(); - MPI_Barrier(Ippl::getComm()); - } + //*** just use f field as is and keep decomposition as defined in input file ***// + RealField_t* tempR = &f; - } else { - //write real data to device - dksbase.writeDataAsync<T>(real_ptr, localreal, totalreal, streamId); - //dksbase.writeData<T>(real_ptr, localreal, totalreal); - } + typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); + rl_i = tempR->begin_if(); - //call real to complex fft - dksbase.callR2CFFT(real_ptr, comp_ptr, nTransformDims, (int*)NR_g, streamId); + // get the lfields + RealLField_t* rldf = (*rl_i).second.get(); + // make sure we are uncompressed + rldf->Uncompress(); + // get the raw data pointers + T* localreal = rldf->getP(); - //normalize fft - if (direction == +1) - dksbase.callNormalizeFFT(comp_ptr, nTransformDims, (int*) NC_g, streamId); + /** get global dimensions of real domain and local dimensions of real subdomain + calc global dimensions of complex subdomain */ + int NR_l[Dim], NR_g[Dim], NC_g[Dim]; + for (size_t d = 0; d < Dim; d++) { + NR_l[d] = (int)rldf->size(d); + NR_g[d] = (int)tempR->getDomain()[d].length(); + NC_g[d] = NR_g[d]; + } + NC_g[0] = (NC_g[0] / 2) + 1; + + //get global and local domain sizes + int sizereal = NR_l[0]*NR_l[1]*NR_l[2]; + int totalreal = tempR->getDomain().size(); + //int totalcomp = NC_g[0]*NC_g[1]*NC_g[2]; + + //local vnodes get starting position for real field subdomains + int *idx = new int[Ippl::getNodes()]; + int *idy = new int[Ippl::getNodes()]; + int *idz = new int[Ippl::getNodes()]; + for (typename Layout_t::const_iterator_iv i_s = tempR->getLayout().begin_iv(); i_s != tempR->getLayout().end_iv(); ++i_s) { + Domain_t tmp = (*i_s).second->getDomain(); + int node = (*i_s).second->getNode(); + idx[node] = tmp[0].min(); + idy[node] = tmp[1].min(); + idz[node] = tmp[2].min(); + } + + //remote vnodes get starting position for real field subdomains + for (typename Layout_t::iterator_dv remote = tempR->getLayout().begin_rdv(); remote != tempR->getLayout().end_rdv(); ++remote) { + Domain_t tmp = (*remote).second->getDomain(); + int node = (*remote).second->getNode(); + idx[node] = tmp[0].min(); + idy[node] = tmp[1].min(); + idz[node] = tmp[2].min(); + } + + int id[3] = {idx[Ippl::myNode()], idy[Ippl::myNode()], idz[Ippl::myNode()]}; + + if (Ippl::myNode() == 0) { + + //if only one node is working do dksbase write otherwise use cuda aware mpi + if (Ippl::getNodes() > 1) { + + if (streamId == -1) { + //gather data from different mpi processes directly into gpu buffer + dksbase.gather3DData( real_ptr, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, + idx, idy, idz, + Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); + } else { + //gather data using CUDA IPC for async data transfer + dksbase.gather3DDataAsync<T>( real_ptr, localreal, NR_g, NR_l, id, streamId); + //sync needed to wait for data transfer to finish + dksbase.syncDevice(); + MPI_Barrier(Ippl::getComm()); + } + + } else { + //write real data to device + dksbase.writeDataAsync<T>(real_ptr, localreal, totalreal, streamId); + //dksbase.writeData<T>(real_ptr, localreal, totalreal); + } + + //call real to complex fft + dksbase.callR2CFFT(real_ptr, comp_ptr, nTransformDims, (int*)NR_g, streamId); + + //normalize fft + if (direction == +1) + dksbase.callNormalizeFFT(comp_ptr, nTransformDims, (int*) NC_g, streamId); - } else { - if (streamId == -1) { - //send data via gatherv to gpu controled by root process - dksbase.gather3DData( NULL, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, idx, idy, idz, - Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); } else { - //transfer data to device memory - dksbase.gather3DDataAsync<T>( real_ptr, localreal, NR_g, NR_l, id, streamId); - //sync needed to wait for data transfer to finish - dksbase.syncDevice(); - MPI_Barrier(Ippl::getComm()); - } - - } - /* end dks part */ - - // finish timing the whole mess + if (streamId == -1) { + //send data via gatherv to gpu controled by root process + dksbase.gather3DData( NULL, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, idx, idy, idz, + Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); + } else { + //transfer data to device memory + dksbase.gather3DDataAsync<T>( real_ptr, localreal, NR_g, NR_l, id, streamId); + //sync needed to wait for data transfer to finish + dksbase.syncDevice(); + MPI_Barrier(Ippl::getComm()); + } + + } + /* end dks part */ + + // finish timing the whole mess } #endif -/* -#ifdef IPPL_DKS -template <unsigned Dim, class T> +template <size_t Dim, class T> void FFT<RCTransform,Dim,T>::transform( - int direction, - typename FFT<RCTransform,Dim,T>::RealField_t& f, - typename FFT<RCTransform,Dim,T>::ComplexField_t& g, - const bool& constInput) + int direction, + typename FFT<RCTransform,Dim,T>::RealField_t& f, + typename FFT<RCTransform,Dim,T>::ComplexField_t& g, + const bool& constInput) { - // time the whole mess - static IpplTimings::TimerRef tottimer=IpplTimings::getTimer("RC-total-gpu"); - IpplTimings::startTimer(tottimer); + FFTDBG(Inform tmsg("FFT-RC-forward")); - // check domain of incoming fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); + // time the whole mess - PAssert( this->checkDomain(this->getDomain(),in_dom) && - this->checkDomain(complexDomain_m,out_dom) ); + // indicate we're doing another fft + // incipplstat(incffts); - RealField_t* tempR = tempRField_m; // field* management aid + // check domain of incoming fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); - if (!constInput) { - // see if we can use input field f as a temporary - bool skipTemp = true; - // more rigorous match required here; check that layouts are identical - if ( !(in_layout == *tempRLayout_m) ) { - skipTemp = false; - } else { - // make sure distributions match - for (unsigned d=0; d<Dim; ++d) - if (in_layout.getDistribution(d) != tempRLayout_m->getDistribution(d)) - skipTemp = false; - - // make sure vnode counts match - if (in_layout.numVnodes() != tempRLayout_m->numVnodes()) - skipTemp = false; - - // also make sure there are no guard cells - if (!(f.getGC() == FFT<RCTransform,Dim,T>::nullGC)) - skipTemp = false; - } + PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && + this->checkDomain(complexDomain_m,out_dom), true); - // if we can skip using this temporary, set the tempr pointer to the - // original incoming field. otherwise, it will stay pointing at the - // temporary real field, and we'll need to do a transpose of the data - // from the original into the temporary. - if (skipTemp) - tempR = &f; - } + // common loop iterate and other vars: + size_t d; + size_t idim; // idim loops over the number of transform dims. + size_t nTransformDims = this->numTransformDims(); - // if we're not using input as a temporary ... - if (tempR != &f) { - // transpose and permute to real field with transform dim first - (*tempR)[tempR->getDomain()] = f[in_dom]; - } + // handle first rc transform separately + idim = 0; - // field* for temp field management: - ComplexField_t* temp = tempFields_m[0]; + RealField_t* tempR = tempRField_m; // field* management aid + if (!constInput) { + // see if we can use input field f as a temporary + bool skipTemp = true; - // see if we can put final result directly into g. this is useful if - // we're doing just a 1d fft of one dimension of a multi-dimensional field. + // more rigorous match required here; check that layouts are identical + if ( !(in_layout == *tempRLayout_m) ) { + skipTemp = false; + } else { + // make sure distributions match + for (d=0; d<Dim; ++d) + if (in_layout.getDistribution(d) != tempRLayout_m->getDistribution(d)) + skipTemp = false; - unsigned nTransformDims = this->numTransformDims(); + // make sure vnode counts match + if (in_layout.numVnodes() != tempRLayout_m->numVnodes()) + skipTemp = false; - if (nTransformDims == 1) { // only a single rc transform - bool skipTemp = true; + // also make sure there are no guard cells + if (!(f.getGC() == FFT<RCTransform,Dim,T>::nullGC)) + skipTemp = false; + } - // more rigorous match required here; check that layouts are identical - if (!(out_layout == *tempLayouts_m[0])) { - skipTemp = false; - } else { - for (unsigned d=0; d<Dim; ++d) - if (out_layout.getDistribution(d) != tempLayouts_m[0]->getDistribution(d)) - skipTemp = false; + // if we can skip using this temporary, set the tempr pointer to the + // original incoming field. otherwise, it will stay pointing at the + // temporary real field, and we'll need to do a transpose of the data + // from the original into the temporary. + if (skipTemp) + tempR = &f; + } - if ( out_layout.numVnodes() != tempLayouts_m[0]->numVnodes() ) - skipTemp = false; + // if we're not using input as a temporary ... + if (tempR != &f) { - // also make sure there are no guard cells - if (!(g.getGC() == FFT<RCTransform,Dim,T>::nullGC)) - skipTemp = false; - // if we can skip using the temporary, set the pointer to the output - // field for the first fft to the second provided field (g) - if (skipTemp) - temp = &g; - } - } - - typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); - rl_i = tempR->begin_if(); - typename ComplexField_t::const_iterator_if cl_i = temp->end_if(); - cl_i = temp->begin_if(); - - // get the lfields - RealLField_t* rldf = (*rl_i).second.get(); - ComplexLField_t* cldf = (*cl_i).second.get(); - - // make sure we are uncompressed - rldf->Uncompress(); - cldf->Uncompress(); - - // get the raw data pointers - T* localreal = rldf->getP(); - Complex_t* localcomp = cldf->getP(); - - //get global dimensions of domain and local dimensions of subdomain - int NR_l[Dim], NC_l[Dim], NR_g[Dim], NC_g[Dim]; - for (unsigned d = 0; d < Dim; d++) { - NR_l[d] = (int)rldf->size(d); - NC_l[d] = (int)cldf->size(d); - NR_g[d] = (int)tempR->getDomain()[d].length(); - NC_g[d] = (int)temp->getDomain()[d].length(); - } - - //get global and local domain sizes - int sizereal = NR_l[0]*NR_l[1]*NR_l[2]; - int sizecomp = NC_l[0]*NC_l[1]*NC_l[2]; - - int totalreal = tempR->getDomain().size(); - int totalcomp = temp->getDomain().size(); - - - //local vnodes get starting position for real field subdomains - int *idx = new int[Ippl::getNodes()]; - int *idy = new int[Ippl::getNodes()]; - int *idz = new int[Ippl::getNodes()]; - for (typename Layout_t::const_iterator_iv i_s = tempR->getLayout().begin_iv(); i_s != tempR->getLayout().end_iv(); ++i_s) { - Domain_t tmp = (*i_s).second->getDomain(); - int node = (*i_s).second->getNode(); - idx[node] = tmp[0].min(); - idy[node] = tmp[1].min(); - idz[node] = tmp[2].min(); - } - - //remote vnodes get starting position for real field subdomains - for (typename Layout_t::iterator_dv remote = tempR->getLayout().begin_rdv(); remote != tempR->getLayout().end_rdv(); ++remote) { - Domain_t tmp = (*remote).second->getDomain(); - int node = (*remote).second->getNode(); - idx[node] = tmp[0].min(); - idy[node] = tmp[1].min(); - idz[node] = tmp[2].min(); - } - - //local vnodes get starting position - int *cidx = new int[Ippl::getNodes()]; - int *cidy = new int[Ippl::getNodes()]; - int *cidz = new int[Ippl::getNodes()]; - for (typename Layout_t::const_iterator_iv i_s = temp->getLayout().begin_iv(); i_s != temp->getLayout().end_iv(); ++i_s) { - Domain_t tmp = (*i_s).second->getDomain(); - int node = (*i_s).second->getNode(); - cidx[node] = tmp[0].min(); - cidy[node] = tmp[1].min(); - cidz[node] = tmp[2].min(); - } - - //remote vnodes get starting position - for (typename Layout_t::iterator_dv remote = temp->getLayout().begin_rdv(); remote != temp->getLayout().end_rdv(); ++remote) { - Domain_t tmp = (*remote).second->getDomain(); - int node = (*remote).second->getNode(); - cidx[node] = tmp[0].min(); - cidy[node] = tmp[1].min(); - cidz[node] = tmp[2].min(); - } - - //int id[3] = {idx[Ippl::myNode()], idy[Ippl::myNode()], idz[Ippl::myNode()]}; - //int cid[3] = {cidx[Ippl::myNode()], cidy[Ippl::myNode()], cidz[Ippl::myNode()]}; - - int ierr; - void *real_ptr, *comp_ptr; - - if (Ippl::myNode() == 0) { - - //allocate memory on device for real and complex arrays - real_ptr = base.allocateMemory<T>(totalreal, ierr); - comp_ptr = base.allocateMemory<Complex_t>(totalcomp, ierr); - - //if only one node is working do dksbase write otherwise use cuda aware mpi - if (Ippl::getNodes() > 1) { - //gather data from different mpi processes directly into gpu buffer - base.gather3DData( real_ptr, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, idx, idy, idz, - Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); + // transpose AND PERMUTE TO REAL FIELD WITH TRANSFORM DIM FIRST + FFTDBG(tmsg << "doing transpose of real field into temporary "); + FFTDBG(tmsg << "with layout = " << tempR->getLayout() << std::endl); + (*tempR)[tempR->getDomain()] = f[in_dom]; - } else { - //write real data to device - ierr = base.writeData<T>(real_ptr, localreal, totalreal); } - //call real to complex fft - base.callR2CFFT(real_ptr, comp_ptr, nTransformDims, (int*)NR_g); + // field* for temp field management: + ComplexField_t* temp = tempFields_m[0]; - //if only one node is working do dksbase read otherwise use cuda aware mpi - if (Ippl::getNodes() > 1) { - //scatter data to different mpi processes directly from gpu buffer - MPI_Barrier( Ippl::getComm() ); + // see if we can put final result directly into g. this is useful if + // we're doing just a 1d fft of one dimension of a multi-dimensional field. + if (nTransformDims == 1) { // only a single rc transform + bool skipTemp = true; - base.scatter3DData(comp_ptr, localcomp, sizecomp, MPI_DOUBLE_COMPLEX, NC_g, NC_l, cidx, cidy, - cidz, Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); + // more rigorous match required here; check that layouts are identical + if (!(out_layout == *tempLayouts_m[0])) { + skipTemp = false; + } else { + for (d=0; d<Dim; ++d) + if (out_layout.getDistribution(d) != + tempLayouts_m[0]->getDistribution(d)) + skipTemp = false; - } else { - //read complex data from device - base.readData<Complex_t>(comp_ptr, localcomp, totalcomp); + if ( out_layout.numVnodes() != tempLayouts_m[0]->numVnodes() ) + skipTemp = false; + + // also make sure there are no guard cells + if (!(g.getGC() == FFT<RCTransform,Dim,T>::nullGC)) + skipTemp = false; + + // if we can skip using the temporary, set the pointer to the output + // field for the first fft to the second provided field (g) + if (skipTemp) + temp = &g; + } } - //free device memory - base.freeMemory<T>(real_ptr, totalreal); - base.freeMemory<Complex_t>(comp_ptr, totalcomp); + FFTDBG(tmsg << "doing real->complex fft of first dimension ..." << std::endl); - } else { + // loop over all the vnodes, working on the lfield in each. + typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); + typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); + for (rl_i = tempR->begin_if(); rl_i != rl_end; ++rl_i, ++cl_i) { + // get the lfields + RealLField_t* rldf = (*rl_i).second.get(); + ComplexLField_t* cldf = (*cl_i).second.get(); - //send data via gatherv to gpu controled by root process - base.gather3DData( NULL, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, idx, idy, idz, - Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); - //receive data from gpu controled by root process - MPI_Barrier(Ippl::getComm()); - base.scatter3DData(NULL, localcomp, sizecomp, MPI_DOUBLE_COMPLEX, NC_g, NC_l, cidx, cidy, cidz, - Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); + // make sure we are uncompressed + rldf->Uncompress(); + cldf->Uncompress(); - } + // get the raw data pointers + T* localreal = rldf->getP(); + Complex_t* localcomp = cldf->getP(); - //assign complex field - if (temp != &g) { + // number of strips should be the same for real and complex lfields! + int nstrips = 1, lengthreal = rldf->size(0), lengthcomp = cldf->size(0); + for (d=1; d<Dim; ++d) + nstrips *= rldf->size(d); - (*tempFields_m[1])[tempLayouts_m[1]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; - temp = tempFields_m[1]; // field* management aid + for (int istrip=0; istrip<nstrips; ++istrip) { + // move the data into the complex strip, which is two reals longer + for (int ilen=0; ilen<lengthreal; ilen+=2) { + localcomp[ilen/2] = Complex_t(localreal[ilen],localreal[ilen+1]); + } - g[out_dom] = (*temp)[temp->getLayout().getDomain()]; - if (this->compressTemps()) *temp = 0; - } + // do the 1d real-to-complex fft: + // note that real-to-complex fft direction is always +1 + this->getEngine().callFFT(idim, +1, localcomp); - if (tempR != &f) { - if (this->compressTemps()) *tempR = 0; - } + // advance the data pointers + localreal += lengthreal; + localcomp += lengthcomp; + } // loop over 1d strips - // normalize: - //if (direction == +1) - // g = g * this->getNormFact(); + } // loop over all the lfields - // finish timing the whole mess - IpplTimings::stopTimer(tottimer); + // compress temporary storage + if (this->compressTemps() && tempR != &f) + *tempR = 0; -} -#else -*/ -template <size_t Dim, class T> -void -FFT<RCTransform,Dim,T>::transform( - int direction, - typename FFT<RCTransform,Dim,T>::RealField_t& f, - typename FFT<RCTransform,Dim,T>::ComplexField_t& g, - const bool& constInput) -{ - FFTDBG(Inform tmsg("FFT-RC-forward")); - - // time the whole mess - - // indicate we're doing another fft - // incipplstat(incffts); + // now proceed with the other complex-to-complex transforms - // check domain of incoming fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); + // local work array passed to fft: + Complex_t* localdata; + // loop over the remaining dimensions to be transformed: + for (idim = 1; idim < nTransformDims; ++idim) { - PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && - this->checkDomain(complexDomain_m,out_dom), true); + bool skipTranspose = false; - // common loop iterate and other vars: - size_t d; - size_t idim; // idim loops over the number of transform dims. - size_t nTransformDims = this->numTransformDims(); + // if this is the last transform dimension, we might be able + // to skip the last temporary and transpose right into g + if (idim == nTransformDims-1) { + // get the domain for comparison + const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); - // handle first rc transform separately - idim = 0; + // make sure there are no guard cells, and that the first + // axis matches what we expect and is serial. only need to + // check first axis since we're just fft'ing that one dimension. + skipTranspose = (g.getGC() == FFT<RCTransform,Dim,T>::nullGC && + out_dom[0].sameBase(last_dom[0]) && + out_dom[0].length() == last_dom[0].length() && + out_layout.getDistribution(0) == SERIAL); + } - RealField_t* tempR = tempRField_m; // field* management aid - if (!constInput) { - // see if we can use input field f as a temporary - bool skipTemp = true; - - // more rigorous match required here; check that layouts are identical - if ( !(in_layout == *tempRLayout_m) ) { - skipTemp = false; - } else { - // make sure distributions match - for (d=0; d<Dim; ++d) - if (in_layout.getDistribution(d) != tempRLayout_m->getDistribution(d)) - skipTemp = false; - - // make sure vnode counts match - if (in_layout.numVnodes() != tempRLayout_m->numVnodes()) - skipTemp = false; - - // also make sure there are no guard cells - if (!(f.getGC() == FFT<RCTransform,Dim,T>::nullGC)) - skipTemp = false; - } - - // if we can skip using this temporary, set the tempr pointer to the - // original incoming field. otherwise, it will stay pointing at the - // temporary real field, and we'll need to do a transpose of the data - // from the original into the temporary. - if (skipTemp) - tempR = &f; - } + if (!skipTranspose) { + // transpose and permute to field with transform dim first + FFTDBG(tmsg << "doing complex->complex transpose into field "); + FFTDBG(tmsg << "with layout = " << tempFields_m[idim]->getLayout()); + FFTDBG(tmsg << std::endl); - // if we're not using input as a temporary ... - if (tempR != &f) { + (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = + (*temp)[temp->getLayout().getDomain()]; + // compress out previous iterate's storage: + if (this->compressTemps()) + *temp = 0; + temp = tempFields_m[idim]; // field* management aid - // transpose AND PERMUTE TO REAL FIELD WITH TRANSFORM DIM FIRST - FFTDBG(tmsg << "doing transpose of real field into temporary "); - FFTDBG(tmsg << "with layout = " << tempR->getLayout() << std::endl); - (*tempR)[tempR->getDomain()] = f[in_dom]; + } else if (idim == nTransformDims-1) { + // last transform and we can skip the last temporary field + // so do the transpose here using g instead - } + // transpose and permute to field with transform dim first + FFTDBG(tmsg << "doing final complex->complex transpose "); + FFTDBG(tmsg << "into return "); + FFTDBG(tmsg << "with layout = " << g.getLayout()); + FFTDBG(tmsg << std::endl); - // field* for temp field management: - ComplexField_t* temp = tempFields_m[0]; + g[out_dom] = (*temp)[temp->getLayout().getDomain()]; - // see if we can put final result directly into g. this is useful if - // we're doing just a 1d fft of one dimension of a multi-dimensional field. - if (nTransformDims == 1) { // only a single rc transform - bool skipTemp = true; + // compress out previous iterate's storage: + if (this->compressTemps()) + *temp = 0; + temp = &g; // field* management aid - // more rigorous match required here; check that layouts are identical - if (!(out_layout == *tempLayouts_m[0])) { - skipTemp = false; - } else { - for (d=0; d<Dim; ++d) - if (out_layout.getDistribution(d) != - tempLayouts_m[0]->getDistribution(d)) - skipTemp = false; - - if ( out_layout.numVnodes() != tempLayouts_m[0]->numVnodes() ) - skipTemp = false; - - // also make sure there are no guard cells - if (!(g.getGC() == FFT<RCTransform,Dim,T>::nullGC)) - skipTemp = false; - - // if we can skip using the temporary, set the pointer to the output - // field for the first fft to the second provided field (g) - if (skipTemp) - temp = &g; - } - } + } - FFTDBG(tmsg << "doing real->complex fft of first dimension ..." << std::endl); - // loop over all the vnodes, working on the lfield in each. - typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); - typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); - for (rl_i = tempR->begin_if(); rl_i != rl_end; ++rl_i, ++cl_i) { - // get the lfields - RealLField_t* rldf = (*rl_i).second.get(); - ComplexLField_t* cldf = (*cl_i).second.get(); + FFTDBG(tmsg << "doing complex->complex fft of other dimension .." << std::endl); - // make sure we are uncompressed - rldf->Uncompress(); - cldf->Uncompress(); + // loop over all the vnodes, working on the lfield in each. + typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); + for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { + // get the lfield + ComplexLField_t* ldf = (*l_i).second.get(); - // get the raw data pointers - T* localreal = rldf->getP(); - Complex_t* localcomp = cldf->getP(); + // make sure we are uncompressed + ldf->Uncompress(); - // number of strips should be the same for real and complex lfields! - int nstrips = 1, lengthreal = rldf->size(0), lengthcomp = cldf->size(0); - for (d=1; d<Dim; ++d) - nstrips *= rldf->size(d); + // get the raw data pointer + localdata = ldf->getP(); + // do 1d complex-to-complex fft's on all the strips in the lfield: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) + nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // move the data into the complex strip, which is two reals longer - for (int ilen=0; ilen<lengthreal; ilen+=2) { - localcomp[ilen/2] = Complex_t(localreal[ilen],localreal[ilen+1]); - } + for (int istrip=0; istrip<nstrips; ++istrip) { + // do the 1D FFT: + //this->getEngine().callFFT(idim, direction, localdata); + this->getEngine().callFFT(idim, +1, localdata); - // do the 1d real-to-complex fft: - // note that real-to-complex fft direction is always +1 - this->getEngine().callFFT(idim, +1, localcomp); + // advance the data pointer + localdata += length; + } // loop over 1D strips + } // loop over all the LFields - // advance the data pointers - localreal += lengthreal; - localcomp += lengthcomp; - } // loop over 1d strips + } // loop over all transformed dimensions - } // loop over all the lfields - // compress temporary storage - if (this->compressTemps() && tempR != &f) - *tempR = 0; + // skip final assignment and compress if we used g as final temporary + if (temp != &g) { - // now proceed with the other complex-to-complex transforms - // local work array passed to fft: - Complex_t* localdata; + // Now assign into output Field, and compress last temp's storage: + FFTDBG(tmsg << "Doing cleanup complex->complex transpose "); + FFTDBG(tmsg << "into return "); + FFTDBG(tmsg << "with layout = " << g.getLayout()); + FFTDBG(tmsg << std::endl); - // loop over the remaining dimensions to be transformed: - for (idim = 1; idim < nTransformDims; ++idim) { + g[out_dom] = (*temp)[temp->getLayout().getDomain()]; - bool skipTranspose = false; + if (this->compressTemps()) *temp = 0; - // if this is the last transform dimension, we might be able - // to skip the last temporary and transpose right into g - if (idim == nTransformDims-1) { - // get the domain for comparison - const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); - - // make sure there are no guard cells, and that the first - // axis matches what we expect and is serial. only need to - // check first axis since we're just fft'ing that one dimension. - skipTranspose = (g.getGC() == FFT<RCTransform,Dim,T>::nullGC && - out_dom[0].sameBase(last_dom[0]) && - out_dom[0].length() == last_dom[0].length() && - out_layout.getDistribution(0) == SERIAL); } - if (!skipTranspose) { - // transpose and permute to field with transform dim first - FFTDBG(tmsg << "doing complex->complex transpose into field "); - FFTDBG(tmsg << "with layout = " << tempFields_m[idim]->getLayout()); - FFTDBG(tmsg << std::endl); - - (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; - - // compress out previous iterate's storage: - if (this->compressTemps()) - *temp = 0; - temp = tempFields_m[idim]; // field* management aid - - } else if (idim == nTransformDims-1) { - // last transform and we can skip the last temporary field - // so do the transpose here using g instead + // Normalize: + if (direction == +1) g = g * this->getNormFact(); - // transpose and permute to field with transform dim first - FFTDBG(tmsg << "doing final complex->complex transpose "); - FFTDBG(tmsg << "into return "); - FFTDBG(tmsg << "with layout = " << g.getLayout()); - FFTDBG(tmsg << std::endl); - - g[out_dom] = (*temp)[temp->getLayout().getDomain()]; - - // compress out previous iterate's storage: - if (this->compressTemps()) - *temp = 0; - temp = &g; // field* management aid - - } - - - FFTDBG(tmsg << "doing complex->complex fft of other dimension .." << std::endl); - - // loop over all the vnodes, working on the lfield in each. - typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); - for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { - // get the lfield - ComplexLField_t* ldf = (*l_i).second.get(); - - // make sure we are uncompressed - ldf->Uncompress(); - - // get the raw data pointer - localdata = ldf->getP(); - - // do 1d complex-to-complex fft's on all the strips in the lfield: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) - nstrips *= ldf->size(d); - - for (int istrip=0; istrip<nstrips; ++istrip) { - // do the 1D FFT: - //this->getEngine().callFFT(idim, direction, localdata); - this->getEngine().callFFT(idim, +1, localdata); - - // advance the data pointer - localdata += length; - } // loop over 1D strips - } // loop over all the LFields - - } // loop over all transformed dimensions - - - // skip final assignment and compress if we used g as final temporary - if (temp != &g) { - - - // Now assign into output Field, and compress last temp's storage: - FFTDBG(tmsg << "Doing cleanup complex->complex transpose "); - FFTDBG(tmsg << "into return "); - FFTDBG(tmsg << "with layout = " << g.getLayout()); - FFTDBG(tmsg << std::endl); - - g[out_dom] = (*temp)[temp->getLayout().getDomain()]; - - if (this->compressTemps()) *temp = 0; - - } - - // Normalize: - if (direction == +1) g = g * this->getNormFact(); - - // finish timing the whole mess + // finish timing the whole mess } //#endif @@ -1833,620 +1352,361 @@ FFT<RCTransform,Dim,T>::transform( template <size_t Dim, class T> void FFT<RCTransform,Dim,T>::transformDKSCR( - int direction, - RealField_t& g, - void* real_ptr, - void* comp_ptr, - DKSOPAL &dksbase, - int streamId, - const bool& constInput) + int direction, + RealField_t& g, + void* real_ptr, + void* comp_ptr, + DKSOPAL &dksbase, + int streamId, + const bool& constInput) { - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); - //if (Ippl::myNode() == 0) - // std::cout << "DEBUG INVERSE g: " << g.getLayout() << std::endl; + //if (Ippl::myNode() == 0) + // std::cout << "DEBUG INVERSE g: " << g.getLayout() << std::endl; - PAssert_EQ( this->checkDomain(this->getDomain(),out_dom), true); + PAssert_EQ( this->checkDomain(this->getDomain(),out_dom), true); - size_t nTransformDims = this->numTransformDims(); + size_t nTransformDims = this->numTransformDims(); - // see if we can put final result directly into g - RealField_t* tempR; - - /*** using tempRField_m and transposing to g field in the end ***/ - /* - bool skipTemp = true; - - // more rigorous match required here; check that layouts are identical - if (!(out_layout == *tempRLayout_m)) { - skipTemp = false; - } else { - for (unsigned d=0; d<Dim; ++d) - if (out_layout.getDistribution(d) != tempRLayout_m->getDistribution(d)) - skipTemp = false; - - if ( out_layout.numVnodes() != tempRLayout_m->numVnodes() ) - skipTemp = false; + // see if we can put final result directly into g + RealField_t* tempR; - // also make sure there are no guard cells - if (!(g.getGC() == FFT<RCTransform,Dim,T>::nullGC)) - skipTemp = false; - } - - if (skipTemp) + //***Use g as is and keep decomposition as defined in input file***/ tempR = &g; - else - tempR = tempRField_m; - */ - //***Use g as is and keep decomposition as defined in input file***/ - tempR = &g; - //if (Ippl::myNode() == 0) - // std::cout << "DEBUG INVERSE tempR: " << tempR->getLayout() << std::endl; - - - typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); - rl_i = tempR->begin_if(); - - // Get the LFields - RealLField_t* rldf = (*rl_i).second.get(); - // make sure we are uncompressed - rldf->Uncompress(); - - // get the raw data pointers - T* localreal = rldf->getP(); - - //get sizes of global domains and local subdomains - int NR_l[Dim], NR_g[Dim], NC_g[Dim]; - for (size_t d=0; d<Dim; d++) { - NR_l[d] = (int)rldf->size(d); - NR_g[d] = (int)tempR->getDomain()[d].length(); - NC_g[d] = NR_g[d]; - } - NC_g[0] = (NC_g[0] / 2) + 1; - - //get sizes of global and local domains - int totalreal = tempR->getDomain().size(); - - //local vnodes get starting position for real field subdomains - int *idx = new int[Ippl::getNodes()]; - int *idy = new int[Ippl::getNodes()]; - int *idz = new int[Ippl::getNodes()]; - for (typename Layout_t::const_iterator_iv i_s = tempR->getLayout().begin_iv(); i_s != tempR->getLayout().end_iv(); ++i_s) { - Domain_t tmp = (*i_s).second->getDomain(); - int node = (*i_s).second->getNode(); - idx[node] = tmp[0].min(); - idy[node] = tmp[1].min(); - idz[node] = tmp[2].min(); - } - - //remote vnodes get starting position for real field subdomains - for (typename Layout_t::iterator_dv remote = tempR->getLayout().begin_rdv(); remote != tempR->getLayout().end_rdv(); ++remote) { - Domain_t tmp = (*remote).second->getDomain(); - int node = (*remote).second->getNode(); - idx[node] = tmp[0].min(); - idy[node] = tmp[1].min(); - idz[node] = tmp[2].min(); - } - - int id[3] = {idx[Ippl::myNode()], idy[Ippl::myNode()], idz[Ippl::myNode()]}; - - /* DKS part */ - if (Ippl::myNode() == 0) { - - //call real to complex fft - dksbase.callC2RFFT(real_ptr, comp_ptr, nTransformDims, (int*)NR_g, streamId); - - //normalize - if (direction == +1) - dksbase.callNormalizeC2RFFT(real_ptr, nTransformDims, (int*)NR_g, streamId); - - if (Ippl::getNodes() > 1) { - dksbase.syncDevice(); - MPI_Barrier(Ippl::getComm()); - /* - dksbase.scatter3DData(real_ptr, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, - idx, idy, idz, Ippl::getNodes(), Ippl::myNode(), - 0, Ippl::getComm() ); - */ - dksbase.scatter3DDataAsync<T>(real_ptr, localreal, NR_g, NR_l, id); - MPI_Barrier(Ippl::getComm()); - dksbase.syncDevice(); - MPI_Barrier(Ippl::getComm()); - } else { - //read real data from device - dksbase.readDataAsync<T>(real_ptr, localreal, totalreal, streamId); - dksbase.syncDevice(); - //dksbase.readData<T>(real_ptr, localreal, totalreal); - } - } else { + typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); + rl_i = tempR->begin_if(); - //receive data from GPU controled by root process - MPI_Barrier(Ippl::getComm()); - /* - dksbase.scatter3DData(NULL, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, idx, idy, idz, - Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); - */ - dksbase.scatter3DDataAsync<T>(real_ptr, localreal, NR_g, NR_l, id); - MPI_Barrier(Ippl::getComm()); - dksbase.syncDevice(); - MPI_Barrier(Ippl::getComm()); - } - /* end dks part */ - - // Now assign into output Field, and compress last temp's storage: - if (tempR != &g) { - g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; - if (this->compressTemps()) *tempR = 0; - } - - // finish timing the whole mess -} -#endif - - -/* -#ifdef IPPL_DKS -template <unsigned Dim, class T> -void -FFT<RCTransform,Dim,T>::transform( - int direction, - typename FFT<RCTransform,Dim,T>::ComplexField_t& f, - typename FFT<RCTransform,Dim,T>::RealField_t& g, - const bool& constInput) -{ - - // time the whole mess - static IpplTimings::TimerRef tottimer=IpplTimings::getTimer("RC-total-gpu"); - IpplTimings::startTimer(tottimer); - - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - - PAssert( this->checkDomain(complexDomain_m,in_dom) && - this->checkDomain(this->getDomain(),out_dom) ); - - - - unsigned nTransformDims = this->numTransformDims(); - // Field* for temp Field management: - ComplexField_t* temp = &f; - - // get domain for comparison - const Domain_t& first_dom = tempLayouts_m[0]->getDomain(); - - bool skipTranspose = true; - - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && - (in_dom[0].length() == first_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<RCTransform,Dim,T>::nullGC) ); - - - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempFields_m[0])[tempLayouts_m[0]->getDomain()] = (*temp)[temp->getLayout().getDomain()]; - - //Compress out previous iterate's storage: - if (this->compressTemps() && temp != &f) - *temp = 0; - temp = tempFields_m[0]; // Field* management aid - } - - - // see if we can put final result directly into g - RealField_t* tempR; - bool skipTemp = true; - - // more rigorous match required here; check that layouts are identical - if (!(out_layout == *tempRLayout_m)) { - skipTemp = false; - } else { - for (unsigned d=0; d<Dim; ++d) - if (out_layout.getDistribution(d) != tempRLayout_m->getDistribution(d)) - skipTemp = false; - - if ( out_layout.numVnodes() != tempRLayout_m->numVnodes() ) - skipTemp = false; + // Get the LFields + RealLField_t* rldf = (*rl_i).second.get(); + // make sure we are uncompressed + rldf->Uncompress(); - // also make sure there are no guard cells - if (!(g.getGC() == FFT<RCTransform,Dim,T>::nullGC)) - skipTemp = false; - } + // get the raw data pointers + T* localreal = rldf->getP(); - if (skipTemp) - tempR = &g; - else - tempR = tempRField_m; - - - //unsigned nTransformDims = this->numTransformDims(); - //RealField_t* tempR = &g; - //ComplexField_t* temp = &f; - - - typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); - rl_i = tempR->begin_if(); - typename ComplexField_t::const_iterator_if cl_i = temp->end_if(); - cl_i = temp->begin_if(); - - // Get the LFields - RealLField_t* rldf = (*rl_i).second.get(); - ComplexLField_t* cldf = (*cl_i).second.get(); - - // make sure we are uncompressed - rldf->Uncompress(); - cldf->Uncompress(); - - // get the raw data pointers - T* localreal = rldf->getP(); - Complex_t* localcomp = cldf->getP(); - - //get sizes of global domains and local subdomains - int NR_l[Dim], NC_l[Dim], NR_g[Dim], NC_g[Dim]; - for (unsigned d=0; d<Dim; d++) { - NR_l[d] = (int)rldf->size(d); - NC_l[d] = (int)cldf->size(d); - NR_g[d] = (int)tempR->getDomain()[d].length(); - NC_g[d] = (int)temp->getDomain()[d].length(); - } - - //get sizes of global and local domains - int sizereal = NR_l[0]*NR_l[1]*NR_l[2]; - int sizecomp = NC_l[0]*NC_l[1]*NC_l[2]; - int totalreal = tempR->getDomain().size(); - int totalcomp = temp->getDomain().size(); - - //local vnodes get starting position for complex field subdomains - int *cidx = new int[Ippl::getNodes()]; - int *cidy = new int[Ippl::getNodes()]; - int *cidz = new int[Ippl::getNodes()]; - - for (typename Layout_t::const_iterator_iv i_s = temp->getLayout().begin_iv(); i_s != temp->getLayout().end_iv(); ++i_s) { - Domain_t tmp = (*i_s).second->getDomain(); - int node = (*i_s).second->getNode(); - cidx[node] = tmp[0].min(); - cidy[node] = tmp[1].min(); - cidz[node] = tmp[2].min(); - } - - //remote vnodes get starting position for complex field subdomains - for (typename Layout_t::iterator_dv remote = temp->getLayout().begin_rdv(); remote != temp->getLayout().end_rdv(); ++remote) { - Domain_t tmp = (*remote).second->getDomain(); - int node = (*remote).second->getNode(); - cidx[node] = tmp[0].min(); - cidy[node] = tmp[1].min(); - cidz[node] = tmp[2].min(); - } - - //local vnodes get starting position for real field subdomains - int *idx = new int[Ippl::getNodes()]; - int *idy = new int[Ippl::getNodes()]; - int *idz = new int[Ippl::getNodes()]; - - for (typename Layout_t::const_iterator_iv i_s = tempR->getLayout().begin_iv(); i_s != tempR->getLayout().end_iv(); ++i_s) { - Domain_t tmp = (*i_s).second->getDomain(); - int node = (*i_s).second->getNode(); - idx[node] = tmp[0].min(); - idy[node] = tmp[1].min(); - idz[node] = tmp[2].min(); - } - - //remote vnodes get starting position for real field subdomains - for (typename Layout_t::iterator_dv remote = tempR->getLayout().begin_rdv(); remote != tempR->getLayout().end_rdv(); ++remote) { - Domain_t tmp = (*remote).second->getDomain(); - int node = (*remote).second->getNode(); - idx[node] = tmp[0].min(); - idy[node] = tmp[1].min(); - idz[node] = tmp[2].min(); - } - - //int id[3] = {idx[Ippl::myNode()], idy[Ippl::myNode()], idz[Ippl::myNode()]}; - //int cid[3] = {cidx[Ippl::myNode()], cidy[Ippl::myNode()], cidz[Ippl::myNode()]}; - - //do the FFT on GPU - int ierr; - void *real_ptr, *comp_ptr; - - //DKS part - if (Ippl::myNode() == 0) { - - //allocate memory on device for real and complex arrays - real_ptr = base.allocateMemory<T>(totalreal, ierr); - comp_ptr = base.allocateMemory<Complex_t>(totalcomp, ierr); - - if (Ippl::getNodes() > 1) { - base.gather3DData( comp_ptr, localcomp, sizecomp, MPI_DOUBLE_COMPLEX, NC_g, NC_l, - cidx, cidy, cidz, Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); + //get sizes of global domains and local subdomains + int NR_l[Dim], NR_g[Dim], NC_g[Dim]; + for (size_t d=0; d<Dim; d++) { + NR_l[d] = (int)rldf->size(d); + NR_g[d] = (int)tempR->getDomain()[d].length(); + NC_g[d] = NR_g[d]; + } + NC_g[0] = (NC_g[0] / 2) + 1; + + //get sizes of global and local domains + int totalreal = tempR->getDomain().size(); + + //local vnodes get starting position for real field subdomains + int *idx = new int[Ippl::getNodes()]; + int *idy = new int[Ippl::getNodes()]; + int *idz = new int[Ippl::getNodes()]; + for (typename Layout_t::const_iterator_iv i_s = tempR->getLayout().begin_iv(); i_s != tempR->getLayout().end_iv(); ++i_s) { + Domain_t tmp = (*i_s).second->getDomain(); + int node = (*i_s).second->getNode(); + idx[node] = tmp[0].min(); + idy[node] = tmp[1].min(); + idz[node] = tmp[2].min(); + } + + //remote vnodes get starting position for real field subdomains + for (typename Layout_t::iterator_dv remote = tempR->getLayout().begin_rdv(); remote != tempR->getLayout().end_rdv(); ++remote) { + Domain_t tmp = (*remote).second->getDomain(); + int node = (*remote).second->getNode(); + idx[node] = tmp[0].min(); + idy[node] = tmp[1].min(); + idz[node] = tmp[2].min(); + } + + int id[3] = {idx[Ippl::myNode()], idy[Ippl::myNode()], idz[Ippl::myNode()]}; + + /* DKS part */ + if (Ippl::myNode() == 0) { + + //call real to complex fft + dksbase.callC2RFFT(real_ptr, comp_ptr, nTransformDims, (int*)NR_g, streamId); + + //normalize + if (direction == +1) + dksbase.callNormalizeC2RFFT(real_ptr, nTransformDims, (int*)NR_g, streamId); + + if (Ippl::getNodes() > 1) { + dksbase.syncDevice(); + MPI_Barrier(Ippl::getComm()); + /* + dksbase.scatter3DData(real_ptr, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, + idx, idy, idz, Ippl::getNodes(), Ippl::myNode(), + 0, Ippl::getComm() ); + */ + dksbase.scatter3DDataAsync<T>(real_ptr, localreal, NR_g, NR_l, id); + MPI_Barrier(Ippl::getComm()); + dksbase.syncDevice(); + MPI_Barrier(Ippl::getComm()); + } else { + //read real data from device + dksbase.readDataAsync<T>(real_ptr, localreal, totalreal, streamId); + dksbase.syncDevice(); + //dksbase.readData<T>(real_ptr, localreal, totalreal); + } } else { - //write real data to device - ierr = base.writeData<Complex_t>(comp_ptr, localcomp, totalcomp); - } - - //call real to complex fft - base.callC2RFFT(real_ptr, comp_ptr, nTransformDims, (int*)NR_g); - if (direction == -1) - base.callNormalizeC2RFFT(real_ptr, nTransformDims, (int*)NR_g); - if (Ippl::getNodes() > 1) { - MPI_Barrier(Ippl::getComm()); - base.scatter3DData(real_ptr, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, idx, idy, idz, - Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); + //receive data from GPU controled by root process + MPI_Barrier(Ippl::getComm()); + /* + dksbase.scatter3DData(NULL, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, idx, idy, idz, + Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); + */ + dksbase.scatter3DDataAsync<T>(real_ptr, localreal, NR_g, NR_l, id); + MPI_Barrier(Ippl::getComm()); + dksbase.syncDevice(); + MPI_Barrier(Ippl::getComm()); + } + /* end dks part */ - } else { - //read real data from device - base.readData<T>(real_ptr, localreal, totalreal); + // Now assign into output Field, and compress last temp's storage: + if (tempR != &g) { + g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; + if (this->compressTemps()) *tempR = 0; } - //free device memory - base.freeMemory<T>(real_ptr, totalreal); - base.freeMemory<Complex_t>(comp_ptr, totalcomp); - } else { - - //send data via gatherv to gpu controled by root process - base.gather3DData( NULL, localcomp, sizecomp, MPI_DOUBLE_COMPLEX, NC_g, NC_l, cidx, cidy, cidz, - Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); - //receive data from GPU controled by root process - MPI_Barrier(Ippl::getComm()); - base.scatter3DData(NULL, localreal, sizereal, MPI_DOUBLE, NR_g, NR_l, idx, idy, idz, - Ippl::getNodes(), Ippl::myNode(), 0, Ippl::getComm() ); - - } - //end dks part - - // Now assign into output Field, and compress last temp's storage: - if (tempR != &g) { - g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; - if (this->compressTemps()) *tempR = 0; - if (this->compressTemps() && temp != &f) *temp = 0; - } + // finish timing the whole mess +} +#endif - // Normalize: - //if (direction == +1) g = g * this->getNormFact(); - // finish timing the whole mess - IpplTimings::stopTimer(tottimer); -} -#else -*/ template <size_t Dim, class T> void FFT<RCTransform,Dim,T>::transform( - int direction, - typename FFT<RCTransform,Dim,T>::ComplexField_t& f, - typename FFT<RCTransform,Dim,T>::RealField_t& g, - const bool& constInput) + int direction, + typename FFT<RCTransform,Dim,T>::ComplexField_t& f, + typename FFT<RCTransform,Dim,T>::RealField_t& g, + const bool& constInput) { - FFTDBG(Inform tmsg("FFT-RC-reverse")); + FFTDBG(Inform tmsg("FFT-RC-reverse")); + + // indicate we're doing another FFT + // INCIPPLSTAT(incFFTs); + + // Check domain of incoming Fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); + PAssert_EQ( this->checkDomain(complexDomain_m,in_dom) && + this->checkDomain(this->getDomain(),out_dom), true); + + // Common loop iterate and other vars: + size_t d; + size_t idim; // idim loops over the number of transform dims. + size_t nTransformDims = this->numTransformDims(); + + // proceed with the complex-to-complex transforms + + // Field* for temp Field management: + ComplexField_t* temp = &f; + + // Local work array passed to FFT: + Complex_t* localdata; + + // Loop over all dimensions to be transformed except last one: + for (idim = nTransformDims-1; idim != 0; --idim) { + + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the first transform dimension, we might be able + // to skip the transpose into the first temporary Field + if (idim == nTransformDims-1 && !constInput) { + // get domain for comparison + const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && + (in_dom[0].length() == first_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<RCTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + FFTDBG(tmsg << "Doing complex->complex transpose into field "); + FFTDBG(tmsg << "with layout = "<<tempFields_m[idim]->getLayout()<<std::endl); + (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = + (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && temp != &f) + *temp = 0; + temp = tempFields_m[idim]; // Field* management aid + } + + FFTDBG(tmsg << "Doing complex->complex fft of other dimension .." << std::endl); + + + // Loop over all the Vnodes, working on the LField in each. + typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); + for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + ComplexLField_t* ldf = (*l_i).second.get(); + + // make sure we are uncompressed + ldf->Uncompress(); + + // get the raw data pointer + localdata = ldf->getP(); + + // Do 1D complex-to-complex FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) + nstrips *= ldf->size(d); + + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + //this->getEngine().callFFT(idim, direction, localdata); + this->getEngine().callFFT(idim, -1, localdata); + + // advance the data pointer + localdata += length; + } // loop over 1D strips + } // loop over all the LFields + + } // loop over all transformed dimensions + + // handle last CR transform separately + idim = 0; + + // see if we can put final result directly into g + RealField_t* tempR; + bool skipTemp = true; - // indicate we're doing another FFT - // INCIPPLSTAT(incFFTs); + // more rigorous match required here; check that layouts are identical + if (!(out_layout == *tempRLayout_m)) { + skipTemp = false; + } else { + for (d=0; d<Dim; ++d) + if (out_layout.getDistribution(d) != tempRLayout_m->getDistribution(d)) + skipTemp = false; - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - PAssert_EQ( this->checkDomain(complexDomain_m,in_dom) && - this->checkDomain(this->getDomain(),out_dom), true); + if ( out_layout.numVnodes() != tempRLayout_m->numVnodes() ) + skipTemp = false; - // Common loop iterate and other vars: - size_t d; - size_t idim; // idim loops over the number of transform dims. - size_t nTransformDims = this->numTransformDims(); + // also make sure there are no guard cells + if (!(g.getGC() == FFT<RCTransform,Dim,T>::nullGC)) + skipTemp = false; + } - // proceed with the complex-to-complex transforms + if (skipTemp) + tempR = &g; + else + tempR = tempRField_m; - // Field* for temp Field management: - ComplexField_t* temp = &f; + skipTemp = true; + if (nTransformDims == 1 && !constInput) { + // only one CR transform + // see if we really need to transpose input data + // more rigorous match required here; check that layouts are identical + if (!(in_layout == *tempLayouts_m[0])) { + skipTemp = false; + } else { + for (d=0; d<Dim; ++d) + if (in_layout.getDistribution(d) != + tempLayouts_m[0]->getDistribution(d)) + skipTemp = false; - // Local work array passed to FFT: - Complex_t* localdata; + if ( in_layout.numVnodes() != tempLayouts_m[0]->numVnodes() ) + skipTemp = false; - // Loop over all dimensions to be transformed except last one: - for (idim = nTransformDims-1; idim != 0; --idim) { + // also make sure there are no guard cells + if (!(f.getGC() == FFT<RCTransform,Dim,T>::nullGC)) + skipTemp = false; + } + } else { // cannot skip transpose + skipTemp = false; + } - // Now do the serial transforms along this dimension: - bool skipTranspose = false; - // if this is the first transform dimension, we might be able - // to skip the transpose into the first temporary Field - if (idim == nTransformDims-1 && !constInput) { - // get domain for comparison - const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && - (in_dom[0].length() == first_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<RCTransform,Dim,T>::nullGC) ); - } + if (!skipTemp) { + // transpose and permute to complex Field with transform dim first + FFTDBG(tmsg << "Doing final complex->complex transpose into field "); + FFTDBG(tmsg << "with layout = "<<tempFields_m[0]->getLayout()<<std::endl); + (*tempFields_m[0])[tempLayouts_m[0]->getDomain()] = + (*temp)[temp->getLayout().getDomain()]; - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - FFTDBG(tmsg << "Doing complex->complex transpose into field "); - FFTDBG(tmsg << "with layout = "<<tempFields_m[idim]->getLayout()<<std::endl); - (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && temp != &f) - *temp = 0; - temp = tempFields_m[idim]; // Field* management aid + // compress previous iterates storage + if (this->compressTemps() && temp != &f) + *temp = 0; + temp = tempFields_m[0]; } - FFTDBG(tmsg << "Doing complex->complex fft of other dimension .." << std::endl); + FFTDBG(tmsg << "Doing complex->real fft of final dimension ..." << std::endl); // Loop over all the Vnodes, working on the LField in each. - typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); - for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - ComplexLField_t* ldf = (*l_i).second.get(); - - // make sure we are uncompressed - ldf->Uncompress(); - - // get the raw data pointer - localdata = ldf->getP(); - - // Do 1D complex-to-complex FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) - nstrips *= ldf->size(d); - - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - //this->getEngine().callFFT(idim, direction, localdata); - this->getEngine().callFFT(idim, -1, localdata); - - // advance the data pointer - localdata += length; - } // loop over 1D strips + typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); + typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); + for (rl_i = tempR->begin_if(); rl_i != rl_end; ++rl_i, ++cl_i) { + // Get the LFields + RealLField_t* rldf = (*rl_i).second.get(); + ComplexLField_t* cldf = (*cl_i).second.get(); + + // make sure we are uncompressed + rldf->Uncompress(); + cldf->Uncompress(); + + // get the raw data pointers + T* localreal = rldf->getP(); + Complex_t* localcomp = cldf->getP(); + + // number of strips should be the same for real and complex LFields! + int nstrips = 1, lengthreal = rldf->size(0), lengthcomp = cldf->size(0); + for (d=1; d<Dim; ++d) + nstrips *= rldf->size(d); + + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D complex-to-real FFT: + // note that complex-to-real FFT direction is always -1 + this->getEngine().callFFT(idim, -1, localcomp); + + // move the data into the real strip, which is two reals shorter + for (int ilen=0; ilen<lengthreal; ilen+=2) { + localreal[ilen] = real(localcomp[ilen/2]); + localreal[ilen+1] = imag(localcomp[ilen/2]); + } + + // advance the data pointers + localreal += lengthreal; + localcomp += lengthcomp; + } // loop over 1D strips } // loop over all the LFields - } // loop over all transformed dimensions - - // handle last CR transform separately - idim = 0; - - // see if we can put final result directly into g - RealField_t* tempR; - bool skipTemp = true; - - // more rigorous match required here; check that layouts are identical - if (!(out_layout == *tempRLayout_m)) { - skipTemp = false; - } else { - for (d=0; d<Dim; ++d) - if (out_layout.getDistribution(d) != tempRLayout_m->getDistribution(d)) - skipTemp = false; - - if ( out_layout.numVnodes() != tempRLayout_m->numVnodes() ) - skipTemp = false; - - // also make sure there are no guard cells - if (!(g.getGC() == FFT<RCTransform,Dim,T>::nullGC)) - skipTemp = false; - } - - if (skipTemp) - tempR = &g; - else - tempR = tempRField_m; - - skipTemp = true; - if (nTransformDims == 1 && !constInput) { - // only one CR transform - // see if we really need to transpose input data - // more rigorous match required here; check that layouts are identical - if (!(in_layout == *tempLayouts_m[0])) { - skipTemp = false; - } else { - for (d=0; d<Dim; ++d) - if (in_layout.getDistribution(d) != - tempLayouts_m[0]->getDistribution(d)) - skipTemp = false; - - if ( in_layout.numVnodes() != tempLayouts_m[0]->numVnodes() ) - skipTemp = false; - - // also make sure there are no guard cells - if (!(f.getGC() == FFT<RCTransform,Dim,T>::nullGC)) - skipTemp = false; - } - } else { // cannot skip transpose - skipTemp = false; - } - - - if (!skipTemp) { - // transpose and permute to complex Field with transform dim first - FFTDBG(tmsg << "Doing final complex->complex transpose into field "); - FFTDBG(tmsg << "with layout = "<<tempFields_m[0]->getLayout()<<std::endl); - (*tempFields_m[0])[tempLayouts_m[0]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; - // compress previous iterates storage if (this->compressTemps() && temp != &f) - *temp = 0; - temp = tempFields_m[0]; - } - - - FFTDBG(tmsg << "Doing complex->real fft of final dimension ..." << std::endl); - - // Loop over all the Vnodes, working on the LField in each. - typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); - typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); - for (rl_i = tempR->begin_if(); rl_i != rl_end; ++rl_i, ++cl_i) { - // Get the LFields - RealLField_t* rldf = (*rl_i).second.get(); - ComplexLField_t* cldf = (*cl_i).second.get(); - - // make sure we are uncompressed - rldf->Uncompress(); - cldf->Uncompress(); + *temp = 0; - // get the raw data pointers - T* localreal = rldf->getP(); - Complex_t* localcomp = cldf->getP(); + // skip final assignment and compress if we used g as final temporary + if (tempR != &g) { - // number of strips should be the same for real and complex LFields! - int nstrips = 1, lengthreal = rldf->size(0), lengthcomp = cldf->size(0); - for (d=1; d<Dim; ++d) - nstrips *= rldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D complex-to-real FFT: - // note that complex-to-real FFT direction is always -1 - this->getEngine().callFFT(idim, -1, localcomp); + // Now assign into output Field, and compress last temp's storage: + FFTDBG(tmsg << "Doing cleanup real->real transpose into return "); + FFTDBG(tmsg << "with layout = " << g.getLayout() << std::endl); + g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; - // move the data into the real strip, which is two reals shorter - for (int ilen=0; ilen<lengthreal; ilen+=2) { - localreal[ilen] = real(localcomp[ilen/2]); - localreal[ilen+1] = imag(localcomp[ilen/2]); - } + if (this->compressTemps()) + *tempR = 0; - // advance the data pointers - localreal += lengthreal; - localcomp += lengthcomp; - } // loop over 1D strips - } // loop over all the LFields - - // compress previous iterates storage - if (this->compressTemps() && temp != &f) - *temp = 0; - - // skip final assignment and compress if we used g as final temporary - if (tempR != &g) { - - - // Now assign into output Field, and compress last temp's storage: - FFTDBG(tmsg << "Doing cleanup real->real transpose into return "); - FFTDBG(tmsg << "with layout = " << g.getLayout() << std::endl); - g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; - - if (this->compressTemps()) - *tempR = 0; - - } + } - // Normalize: - if (direction == +1) g = g * this->getNormFact(); + // Normalize: + if (direction == +1) g = g * this->getNormFact(); - // finish up timing the whole mess + // finish up timing the whole mess } -//#endif //============================================================================= // 1D FFT RCTransform Constructors @@ -2461,28 +1721,28 @@ FFT<RCTransform,Dim,T>::transform( template <class T> FFT<RCTransform,1U,T>::FFT( - const typename FFT<RCTransform,1U,T>::Domain_t& rdomain, - const typename FFT<RCTransform,1U,T>::Domain_t& cdomain, - const bool transformTheseDims[1U], const bool& compressTemps) - : FFTBase<1U,T>(FFT<RCTransform,1U,T>::rcFFT, rdomain, - transformTheseDims, compressTemps), + const typename FFT<RCTransform,1U,T>::Domain_t& rdomain, + const typename FFT<RCTransform,1U,T>::Domain_t& cdomain, + const bool transformTheseDims[1U], const bool& compressTemps) +: FFTBase<1U,T>(FFT<RCTransform,1U,T>::rcFFT, rdomain, + transformTheseDims, compressTemps), complexDomain_m(cdomain) { - size_t nTransformDims = 1U; - // get axis length - int length; - length = rdomain[0].length(); - - // get transform type for FFT Engine, compute normalization - int transformType; - transformType = FFTBase<1U,T>::rcFFT; // first transform is real-to-complex - T& normFact = this->getNormFact(); - normFact = 1.0 / length; - - // set up FFT Engine - this->getEngine().setup(nTransformDims, &transformType, &length); - // set up the temporary fields - setup(); + size_t nTransformDims = 1U; + // get axis length + int length; + length = rdomain[0].length(); + + // get transform type for FFT Engine, compute normalization + int transformType; + transformType = FFTBase<1U,T>::rcFFT; // first transform is real-to-complex + T& normFact = this->getNormFact(); + normFact = 1.0 / length; + + // set up FFT Engine + this->getEngine().setup(nTransformDims, &transformType, &length); + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -2492,31 +1752,31 @@ FFT<RCTransform,1U,T>::FFT( template <class T> FFT<RCTransform,1U,T>::FFT( - const typename FFT<RCTransform,1U,T>::Domain_t& rdomain, - const typename FFT<RCTransform,1U,T>::Domain_t& cdomain, - const bool& compressTemps) - : FFTBase<1U,T>(FFT<RCTransform,1U,T>::rcFFT, rdomain, compressTemps), + const typename FFT<RCTransform,1U,T>::Domain_t& rdomain, + const typename FFT<RCTransform,1U,T>::Domain_t& cdomain, + const bool& compressTemps) +: FFTBase<1U,T>(FFT<RCTransform,1U,T>::rcFFT, rdomain, compressTemps), complexDomain_m(cdomain) { - // Tau profiling + // Tau profiling - // get axis length - int length; - length = rdomain[0].length(); + // get axis length + int length; + length = rdomain[0].length(); - // get transform type for FFT Engine, compute normalization - int transformType; - transformType = FFTBase<1U,T>::rcFFT; // first transform is real-to-complex - T& normFact = this->getNormFact(); - normFact = 1.0 / length; + // get transform type for FFT Engine, compute normalization + int transformType; + transformType = FFTBase<1U,T>::rcFFT; // first transform is real-to-complex + T& normFact = this->getNormFact(); + normFact = 1.0 / length; - // set up FFT Engine - this->getEngine().setup(1U, &transformType, &length); - // set up the temporary fields - setup(); + // set up FFT Engine + this->getEngine().setup(1U, &transformType, &length); + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -2528,35 +1788,35 @@ template <class T> void FFT<RCTransform,1U,T>::setup(void) { - // Tau profiling + // Tau profiling - // check that domain lengths agree between real and complex domains - const Domain_t& domain = this->getDomain(); - bool match = true; - // real array length n, complex array length n/2+1 - if ( complexDomain_m[0].length() != - (domain[0].length()/2 + 1) ) match = false; - PInsist(match, - "Domains provided for real and complex Fields are incompatible!"); + // check that domain lengths agree between real and complex domains + const Domain_t& domain = this->getDomain(); + bool match = true; + // real array length n, complex array length n/2+1 + if ( complexDomain_m[0].length() != + (domain[0].length()/2 + 1) ) match = false; + PInsist(match, + "Domains provided for real and complex Fields are incompatible!"); - // generate layout for temporary real Field - tempRLayout_m = new Layout_t(domain[0], PARALLEL, 1); - // create temporary real Field - this->tempRField_m = new RealField_t(*tempRLayout_m); - // If user requests no intermediate compression, uncompress right now: - if (!this->compressTemps()) this->tempRField_m->Uncompress(); + // generate layout for temporary real Field + tempRLayout_m = new Layout_t(domain[0], PARALLEL, 1); + // create temporary real Field + this->tempRField_m = new RealField_t(*tempRLayout_m); + // If user requests no intermediate compression, uncompress right now: + if (!this->compressTemps()) this->tempRField_m->Uncompress(); - // generate temporary field layout - tempLayouts_m = new Layout_t(complexDomain_m[0], PARALLEL, 1); - // create temporary complex Field - tempFields_m = new ComplexField_t(*tempLayouts_m); - // If user requests no intermediate compression, uncompress right now: - if (!this->compressTemps()) this->tempFields_m->Uncompress(); + // generate temporary field layout + tempLayouts_m = new Layout_t(complexDomain_m[0], PARALLEL, 1); + // create temporary complex Field + tempFields_m = new ComplexField_t(*tempLayouts_m); + // If user requests no intermediate compression, uncompress right now: + if (!this->compressTemps()) this->tempFields_m->Uncompress(); - return; + return; } //----------------------------------------------------------------------------- @@ -2566,16 +1826,16 @@ FFT<RCTransform,1U,T>::setup(void) { template <class T> FFT<RCTransform,1U,T>::~FFT(void) { - // Tau profiling + // Tau profiling - // delete temporary fields and layouts - delete tempFields_m; - delete tempLayouts_m; - delete this->tempRField_m; - delete tempRLayout_m; + // delete temporary fields and layouts + delete tempFields_m; + delete tempLayouts_m; + delete this->tempRField_m; + delete tempRLayout_m; } //----------------------------------------------------------------------------- @@ -2585,103 +1845,103 @@ FFT<RCTransform,1U,T>::~FFT(void) { template <class T> void FFT<RCTransform,1U,T>::transform( - int direction, - typename FFT<RCTransform,1U,T>::RealField_t& f, - typename FFT<RCTransform,1U,T>::ComplexField_t& g, - const bool& constInput) + int direction, + typename FFT<RCTransform,1U,T>::RealField_t& f, + typename FFT<RCTransform,1U,T>::ComplexField_t& g, + const bool& constInput) { - // indicate we're doing another FFT - //INCIPPLSTAT(incFFTs); - - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && - this->checkDomain(complexDomain_m,out_dom), true); - - // Common loop iterate and other vars: - RealField_t* tempR = this->tempRField_m; // Field* management aid - if (!constInput) { - // see if we can use input field f as a temporary - bool skipTemp = true; + // indicate we're doing another FFT + //INCIPPLSTAT(incFFTs); + + // Check domain of incoming Fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); + PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && + this->checkDomain(complexDomain_m,out_dom), true); + + // Common loop iterate and other vars: + RealField_t* tempR = this->tempRField_m; // Field* management aid + if (!constInput) { + // see if we can use input field f as a temporary + bool skipTemp = true; + // more rigorous match required here; check that layouts are identical + if ( !(in_layout == *tempRLayout_m) ) skipTemp = false; + if ( in_layout.getDistribution(0) != + tempRLayout_m->getDistribution(0) ) skipTemp = false; + if ( in_layout.numVnodes() != tempRLayout_m->numVnodes() ) + skipTemp = false; + // also make sure there are no guard cells + if (!(f.getGC() == FFT<RCTransform,1U,T>::nullGC)) skipTemp = false; + if (skipTemp) tempR = &f; + } + + if (tempR != &f) { // not using input as a temporary + + // assign to real Field with proper layout + (*tempR) = f; + + } + + // Field* for temp Field management: + ComplexField_t* temp = tempFields_m; + // see if we can put final result directly into g + bool skipFinal = true; // more rigorous match required here; check that layouts are identical - if ( !(in_layout == *tempRLayout_m) ) skipTemp = false; - if ( in_layout.getDistribution(0) != - tempRLayout_m->getDistribution(0) ) skipTemp = false; - if ( in_layout.numVnodes() != tempRLayout_m->numVnodes() ) - skipTemp = false; + if ( !(out_layout == *tempLayouts_m) ) skipFinal = false; + if ( out_layout.getDistribution(0) != + tempLayouts_m->getDistribution(0) ) skipFinal = false; + if ( out_layout.numVnodes() != tempLayouts_m->numVnodes() ) + skipFinal = false; // also make sure there are no guard cells - if (!(f.getGC() == FFT<RCTransform,1U,T>::nullGC)) skipTemp = false; - if (skipTemp) tempR = &f; - } - - if (tempR != &f) { // not using input as a temporary - - // assign to real Field with proper layout - (*tempR) = f; - - } - - // Field* for temp Field management: - ComplexField_t* temp = tempFields_m; - // see if we can put final result directly into g - bool skipFinal = true; - // more rigorous match required here; check that layouts are identical - if ( !(out_layout == *tempLayouts_m) ) skipFinal = false; - if ( out_layout.getDistribution(0) != - tempLayouts_m->getDistribution(0) ) skipFinal = false; - if ( out_layout.numVnodes() != tempLayouts_m->numVnodes() ) - skipFinal = false; - // also make sure there are no guard cells - if (!(g.getGC() == FFT<RCTransform,1U,T>::nullGC)) skipFinal = false; - if (skipFinal) temp = &g; - - - // There should be just one vnode! - typename RealField_t::const_iterator_if rl_i = tempR->begin_if(); - typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); - if (rl_i != tempR->end_if() && cl_i != temp->end_if()) { - // Get the LFields - RealLField_t* rldf = (*rl_i).second.get(); - ComplexLField_t* cldf = (*cl_i).second.get(); - // make sure we are uncompressed - rldf->Uncompress(); - cldf->Uncompress(); - // get the raw data pointers - T* localreal = rldf->getP(); - Complex_t* localcomp = cldf->getP(); + if (!(g.getGC() == FFT<RCTransform,1U,T>::nullGC)) skipFinal = false; + if (skipFinal) temp = &g; - int lengthreal = rldf->size(0); - // move the data into the complex strip, which is two reals longer - for (int ilen=0; ilen<lengthreal; ilen+=2) - localcomp[ilen/2] = Complex_t(localreal[ilen],localreal[ilen+1]); - // Do the 1D real-to-complex FFT: - // note that real-to-complex FFT direction is always +1 - this->getEngine().callFFT(0, +1, localcomp); - } + // There should be just one vnode! + typename RealField_t::const_iterator_if rl_i = tempR->begin_if(); + typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); + if (rl_i != tempR->end_if() && cl_i != temp->end_if()) { + // Get the LFields + RealLField_t* rldf = (*rl_i).second.get(); + ComplexLField_t* cldf = (*cl_i).second.get(); + // make sure we are uncompressed + rldf->Uncompress(); + cldf->Uncompress(); + // get the raw data pointers + T* localreal = rldf->getP(); + Complex_t* localcomp = cldf->getP(); + int lengthreal = rldf->size(0); + // move the data into the complex strip, which is two reals longer + for (int ilen=0; ilen<lengthreal; ilen+=2) + localcomp[ilen/2] = Complex_t(localreal[ilen],localreal[ilen+1]); + // Do the 1D real-to-complex FFT: + // note that real-to-complex FFT direction is always +1 + this->getEngine().callFFT(0, +1, localcomp); + } - // compress temporary storage - if (this->compressTemps() && tempR != &f) *tempR = 0; - // skip final assignment and compress if we used g as final temporary - if (temp != &g) { + // compress temporary storage + if (this->compressTemps() && tempR != &f) *tempR = 0; - // Now assign into output Field, and compress last temp's storage: - g = (*temp); - if (this->compressTemps()) *temp = 0; - } + // skip final assignment and compress if we used g as final temporary + if (temp != &g) { + + // Now assign into output Field, and compress last temp's storage: + g = (*temp); + if (this->compressTemps()) *temp = 0; + + } - // Normalize: - if (direction == +1) g = g * this->getNormFact(); + // Normalize: + if (direction == +1) g = g * this->getNormFact(); - return; + return; } //----------------------------------------------------------------------------- @@ -2691,114 +1951,114 @@ FFT<RCTransform,1U,T>::transform( template <class T> void FFT<RCTransform,1U,T>::transform( - int direction, - typename FFT<RCTransform,1U,T>::ComplexField_t& f, - typename FFT<RCTransform,1U,T>::RealField_t& g, - const bool& constInput) + int direction, + typename FFT<RCTransform,1U,T>::ComplexField_t& f, + typename FFT<RCTransform,1U,T>::RealField_t& g, + const bool& constInput) { - // indicate we're doing another FFT - //INCIPPLSTAT(incFFTs); - - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - PAssert_EQ( this->checkDomain(complexDomain_m,in_dom) && - this->checkDomain(this->getDomain(),out_dom), true); - - // Field* for temp Field management: - ComplexField_t* temp = &f; - - // see if we can put final result directly into g - RealField_t* tempR; - bool skipFinal = true; - // more rigorous match required here; check that layouts are identical - if ( !(out_layout == *tempRLayout_m) ) skipFinal = false; - if ( out_layout.getDistribution(0) != - tempRLayout_m->getDistribution(0) ) skipFinal = false; - if ( out_layout.numVnodes() != tempRLayout_m->numVnodes() ) - skipFinal = false; - // also make sure there are no guard cells - if (!(g.getGC() == FFT<RCTransform,1U,T>::nullGC)) skipFinal = false; - if (skipFinal) - tempR = &g; - else - tempR = this->tempRField_m; + // indicate we're doing another FFT + //INCIPPLSTAT(incFFTs); + + // Check domain of incoming Fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); + PAssert_EQ( this->checkDomain(complexDomain_m,in_dom) && + this->checkDomain(this->getDomain(),out_dom), true); + + // Field* for temp Field management: + ComplexField_t* temp = &f; - bool skipTemp = true; - if (!constInput) { - // only one CR transform - // see if we really need to transpose input data + // see if we can put final result directly into g + RealField_t* tempR; + bool skipFinal = true; // more rigorous match required here; check that layouts are identical - if ( !(in_layout == *tempLayouts_m) ) skipTemp = false; - if ( in_layout.getDistribution(0) != - tempLayouts_m->getDistribution(0) ) skipTemp = false; - if ( in_layout.numVnodes() != tempLayouts_m->numVnodes() ) - skipTemp = false; + if ( !(out_layout == *tempRLayout_m) ) skipFinal = false; + if ( out_layout.getDistribution(0) != + tempRLayout_m->getDistribution(0) ) skipFinal = false; + if ( out_layout.numVnodes() != tempRLayout_m->numVnodes() ) + skipFinal = false; // also make sure there are no guard cells - if (!(f.getGC() == FFT<RCTransform,1U,T>::nullGC)) skipTemp = false; - } - else { // cannot skip transpose - skipTemp = false; - } + if (!(g.getGC() == FFT<RCTransform,1U,T>::nullGC)) skipFinal = false; + if (skipFinal) + tempR = &g; + else + tempR = this->tempRField_m; + bool skipTemp = true; + if (!constInput) { + // only one CR transform + // see if we really need to transpose input data + // more rigorous match required here; check that layouts are identical + if ( !(in_layout == *tempLayouts_m) ) skipTemp = false; + if ( in_layout.getDistribution(0) != + tempLayouts_m->getDistribution(0) ) skipTemp = false; + if ( in_layout.numVnodes() != tempLayouts_m->numVnodes() ) + skipTemp = false; + // also make sure there are no guard cells + if (!(f.getGC() == FFT<RCTransform,1U,T>::nullGC)) skipTemp = false; + } + else { // cannot skip transpose + skipTemp = false; + } - if (!skipTemp) { - // assign to complex Field with proper layout - (*tempFields_m) = (*temp); - // compress previous iterates storage - if (this->compressTemps() && temp != &f) *temp = 0; - temp = tempFields_m; - } + if (!skipTemp) { + // assign to complex Field with proper layout + (*tempFields_m) = (*temp); + // compress previous iterates storage + if (this->compressTemps() && temp != &f) *temp = 0; + temp = tempFields_m; + } - // There should be just one vnode! - typename RealField_t::const_iterator_if rl_i = tempR->begin_if(); - typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); - if (rl_i != tempR->end_if() && cl_i != temp->end_if()) { - // Get the LFields - RealLField_t* rldf = (*rl_i).second.get(); - ComplexLField_t* cldf = (*cl_i).second.get(); - // make sure we are uncompressed - rldf->Uncompress(); - cldf->Uncompress(); - // get the raw data pointers - T* localreal = rldf->getP(); - Complex_t* localcomp = cldf->getP(); - - int lengthreal = rldf->size(0); - // Do the 1D complex-to-real FFT: - // note that complex-to-real FFT direction is always -1 - this->getEngine().callFFT(0, -1, localcomp); - // move the data into the real strip, which is two reals shorter - for (int ilen=0; ilen<lengthreal; ilen+=2) { - localreal[ilen] = real(localcomp[ilen/2]); - localreal[ilen+1] = imag(localcomp[ilen/2]); + + // There should be just one vnode! + typename RealField_t::const_iterator_if rl_i = tempR->begin_if(); + typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); + if (rl_i != tempR->end_if() && cl_i != temp->end_if()) { + // Get the LFields + RealLField_t* rldf = (*rl_i).second.get(); + ComplexLField_t* cldf = (*cl_i).second.get(); + // make sure we are uncompressed + rldf->Uncompress(); + cldf->Uncompress(); + // get the raw data pointers + T* localreal = rldf->getP(); + Complex_t* localcomp = cldf->getP(); + + int lengthreal = rldf->size(0); + // Do the 1D complex-to-real FFT: + // note that complex-to-real FFT direction is always -1 + this->getEngine().callFFT(0, -1, localcomp); + // move the data into the real strip, which is two reals shorter + for (int ilen=0; ilen<lengthreal; ilen+=2) { + localreal[ilen] = real(localcomp[ilen/2]); + localreal[ilen+1] = imag(localcomp[ilen/2]); + } } - } - // compress previous iterates storage - if (this->compressTemps() && temp != &f) *temp = 0; + // compress previous iterates storage + if (this->compressTemps() && temp != &f) *temp = 0; - // skip final assignment and compress if we used g as final temporary - if (tempR != &g) { + // skip final assignment and compress if we used g as final temporary + if (tempR != &g) { - // Now assign into output Field, and compress last temp's storage: - g = (*tempR); - if (this->compressTemps()) *tempR = 0; + // Now assign into output Field, and compress last temp's storage: + g = (*tempR); + if (this->compressTemps()) *tempR = 0; - } + } - // Normalize: - if (direction == +1) g = g * this->getNormFact(); + // Normalize: + if (direction == +1) g = g * this->getNormFact(); - return; + return; } @@ -2816,59 +2076,59 @@ FFT<RCTransform,1U,T>::transform( template <size_t Dim, class T> FFT<SineTransform,Dim,T>::FFT( - const typename FFT<SineTransform,Dim,T>::Domain_t& rdomain, - const typename FFT<SineTransform,Dim,T>::Domain_t& cdomain, - const bool transformTheseDims[Dim], const bool sineTransformDims[Dim], - const bool& compressTemps) - : FFTBase<Dim,T>(FFT<SineTransform,Dim,T>::sineFFT, rdomain, - transformTheseDims, compressTemps), + const typename FFT<SineTransform,Dim,T>::Domain_t& rdomain, + const typename FFT<SineTransform,Dim,T>::Domain_t& cdomain, + const bool transformTheseDims[Dim], const bool sineTransformDims[Dim], + const bool& compressTemps) +: FFTBase<Dim,T>(FFT<SineTransform,Dim,T>::sineFFT, rdomain, + transformTheseDims, compressTemps), complexDomain_m(&cdomain) { - size_t d; - // store which dimensions get sine transforms and count how many - numSineTransforms_m = 0; - for (d=0; d<Dim; ++d) { - sineTransformDims_m[d] = sineTransformDims[d]; - if (sineTransformDims[d]) { - PAssert_EQ(transformTheseDims[d], true); // should be marked as a transform dim - ++numSineTransforms_m; - } - } - - // construct array of axis lengths for all transform dims - size_t nTransformDims = this->numTransformDims(); - int* lengths = new int[nTransformDims]; - for (d=0; d<nTransformDims; ++d) - lengths[d] = rdomain[this->activeDimension(d)].length(); - - // construct array of transform types for FFT Engine, compute normalization - int* transformTypes = new int[nTransformDims]; - T& normFact = this->getNormFact(); - normFact = 1.0; - bool foundRC = false; - for (d=0; d<nTransformDims; ++d) { - if (sineTransformDims_m[this->activeDimension(d)]) { - transformTypes[d] = FFTBase<Dim,T>::sineFFT; // sine transform - normFact /= (2.0 * (lengths[d] + 1)); - } - else if (!foundRC) { - transformTypes[d] = FFTBase<Dim,T>::rcFFT; // real-to-complex FFT - normFact /= lengths[d]; - foundRC = true; - } - else { - transformTypes[d] = FFTBase<Dim,T>::ccFFT; // complex-to-complex FFT - normFact /= lengths[d]; - } - } - - // set up FFT Engine - this->getEngine().setup(nTransformDims, transformTypes, lengths); - delete [] transformTypes; - delete [] lengths; - // set up the temporary fields - setup(); + size_t d; + // store which dimensions get sine transforms and count how many + numSineTransforms_m = 0; + for (d=0; d<Dim; ++d) { + sineTransformDims_m[d] = sineTransformDims[d]; + if (sineTransformDims[d]) { + PAssert_EQ(transformTheseDims[d], true); // should be marked as a transform dim + ++numSineTransforms_m; + } + } + + // construct array of axis lengths for all transform dims + size_t nTransformDims = this->numTransformDims(); + int* lengths = new int[nTransformDims]; + for (d=0; d<nTransformDims; ++d) + lengths[d] = rdomain[this->activeDimension(d)].length(); + + // construct array of transform types for FFT Engine, compute normalization + int* transformTypes = new int[nTransformDims]; + T& normFact = this->getNormFact(); + normFact = 1.0; + bool foundRC = false; + for (d=0; d<nTransformDims; ++d) { + if (sineTransformDims_m[this->activeDimension(d)]) { + transformTypes[d] = FFTBase<Dim,T>::sineFFT; // sine transform + normFact /= (2.0 * (lengths[d] + 1)); + } + else if (!foundRC) { + transformTypes[d] = FFTBase<Dim,T>::rcFFT; // real-to-complex FFT + normFact /= lengths[d]; + foundRC = true; + } + else { + transformTypes[d] = FFTBase<Dim,T>::ccFFT; // complex-to-complex FFT + normFact /= lengths[d]; + } + } + + // set up FFT Engine + this->getEngine().setup(nTransformDims, transformTypes, lengths); + delete [] transformTypes; + delete [] lengths; + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -2878,51 +2138,51 @@ FFT<SineTransform,Dim,T>::FFT( template <size_t Dim, class T> FFT<SineTransform,Dim,T>::FFT( - const typename FFT<SineTransform,Dim,T>::Domain_t& rdomain, - const typename FFT<SineTransform,Dim,T>::Domain_t& cdomain, - const bool sineTransformDims[Dim], const bool& compressTemps) - : FFTBase<Dim,T>(FFT<SineTransform,Dim,T>::sineFFT, rdomain, compressTemps), + const typename FFT<SineTransform,Dim,T>::Domain_t& rdomain, + const typename FFT<SineTransform,Dim,T>::Domain_t& cdomain, + const bool sineTransformDims[Dim], const bool& compressTemps) +: FFTBase<Dim,T>(FFT<SineTransform,Dim,T>::sineFFT, rdomain, compressTemps), complexDomain_m(&cdomain) { - size_t d; - // store which dimensions get sine transforms and count how many - numSineTransforms_m = 0; - for (d=0; d<Dim; ++d) { - sineTransformDims_m[d] = sineTransformDims[d]; - if (sineTransformDims[d]) ++numSineTransforms_m; - } - - // construct array of axis lengths for all transform dims - int lengths[Dim]; - for (d=0; d<Dim; ++d) - lengths[d] = rdomain[d].length(); - - // construct array of transform types for FFT Engine, compute normalization - int transformTypes[Dim]; - T& normFact = this->getNormFact(); - normFact = 1.0; - bool foundRC = false; - for (d=0; d<Dim; ++d) { - if (sineTransformDims_m[d]) { - transformTypes[d] = FFTBase<Dim,T>::sineFFT; // sine transform - normFact /= (2.0 * (lengths[d] + 1)); - } - else if (!foundRC) { - transformTypes[d] = FFTBase<Dim,T>::rcFFT; // real-to-complex FFT - normFact /= lengths[d]; - foundRC = true; - } - else { - transformTypes[d] = FFTBase<Dim,T>::ccFFT; // complex-to-complex FFT - normFact /= lengths[d]; + size_t d; + // store which dimensions get sine transforms and count how many + numSineTransforms_m = 0; + for (d=0; d<Dim; ++d) { + sineTransformDims_m[d] = sineTransformDims[d]; + if (sineTransformDims[d]) ++numSineTransforms_m; } - } - // set up FFT Engine - this->getEngine().setup(Dim, transformTypes, lengths); - // set up the temporary fields - setup(); + // construct array of axis lengths for all transform dims + int lengths[Dim]; + for (d=0; d<Dim; ++d) + lengths[d] = rdomain[d].length(); + + // construct array of transform types for FFT Engine, compute normalization + int transformTypes[Dim]; + T& normFact = this->getNormFact(); + normFact = 1.0; + bool foundRC = false; + for (d=0; d<Dim; ++d) { + if (sineTransformDims_m[d]) { + transformTypes[d] = FFTBase<Dim,T>::sineFFT; // sine transform + normFact /= (2.0 * (lengths[d] + 1)); + } + else if (!foundRC) { + transformTypes[d] = FFTBase<Dim,T>::rcFFT; // real-to-complex FFT + normFact /= lengths[d]; + foundRC = true; + } + else { + transformTypes[d] = FFTBase<Dim,T>::ccFFT; // complex-to-complex FFT + normFact /= lengths[d]; + } + } + + // set up FFT Engine + this->getEngine().setup(Dim, transformTypes, lengths); + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -2933,42 +2193,42 @@ FFT<SineTransform,Dim,T>::FFT( template <size_t Dim, class T> FFT<SineTransform,Dim,T>::FFT( - const typename FFT<SineTransform,Dim,T>::Domain_t& rdomain, - const bool sineTransformDims[Dim], const bool& compressTemps) - : FFTBase<Dim,T>(FFT<SineTransform,Dim,T>::sineFFT, rdomain, - sineTransformDims, compressTemps) + const typename FFT<SineTransform,Dim,T>::Domain_t& rdomain, + const bool sineTransformDims[Dim], const bool& compressTemps) +: FFTBase<Dim,T>(FFT<SineTransform,Dim,T>::sineFFT, rdomain, + sineTransformDims, compressTemps) { - // Tau profiling + // Tau profiling - // store which dimensions get sine transforms and how many - numSineTransforms_m = this->numTransformDims(); - size_t d; - for (d=0; d<Dim; ++d) - sineTransformDims_m[d] = sineTransformDims[d]; + // store which dimensions get sine transforms and how many + numSineTransforms_m = this->numTransformDims(); + size_t d; + for (d=0; d<Dim; ++d) + sineTransformDims_m[d] = sineTransformDims[d]; - // construct array of axis lengths - int* lengths = new int[numSineTransforms_m]; - for (d=0; d<numSineTransforms_m; ++d) - lengths[d] = rdomain[this->activeDimension(d)].length(); + // construct array of axis lengths + int* lengths = new int[numSineTransforms_m]; + for (d=0; d<numSineTransforms_m; ++d) + lengths[d] = rdomain[this->activeDimension(d)].length(); - // construct array of transform types for FFT Engine, compute normalization - int* transformTypes = new int[numSineTransforms_m]; - T& normFact = this->getNormFact(); - normFact = 1.0; - for (d=0; d<numSineTransforms_m; ++d) { - transformTypes[d] = FFTBase<Dim,T>::sineFFT; // sine transform - normFact /= (2.0 * (lengths[d] + 1)); - } + // construct array of transform types for FFT Engine, compute normalization + int* transformTypes = new int[numSineTransforms_m]; + T& normFact = this->getNormFact(); + normFact = 1.0; + for (d=0; d<numSineTransforms_m; ++d) { + transformTypes[d] = FFTBase<Dim,T>::sineFFT; // sine transform + normFact /= (2.0 * (lengths[d] + 1)); + } - // set up FFT Engine - this->getEngine().setup(numSineTransforms_m, transformTypes, lengths); - delete [] transformTypes; - delete [] lengths; - // set up the temporary fields - setup(); + // set up FFT Engine + this->getEngine().setup(numSineTransforms_m, transformTypes, lengths); + delete [] transformTypes; + delete [] lengths; + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -2978,38 +2238,38 @@ FFT<SineTransform,Dim,T>::FFT( template <size_t Dim, class T> FFT<SineTransform,Dim,T>::FFT( - const typename FFT<SineTransform,Dim,T>::Domain_t& rdomain, const bool& compressTemps) - : FFTBase<Dim,T>(FFT<SineTransform,Dim,T>::sineFFT, rdomain, compressTemps) + const typename FFT<SineTransform,Dim,T>::Domain_t& rdomain, const bool& compressTemps) +: FFTBase<Dim,T>(FFT<SineTransform,Dim,T>::sineFFT, rdomain, compressTemps) { - // Tau profiling + // Tau profiling - size_t d; - // store which dimensions get sine transforms and how many - numSineTransforms_m = this->numTransformDims(); - for (d=0; d<Dim; ++d) - sineTransformDims_m[d] = true; + size_t d; + // store which dimensions get sine transforms and how many + numSineTransforms_m = this->numTransformDims(); + for (d=0; d<Dim; ++d) + sineTransformDims_m[d] = true; - // construct array of axis lengths - int lengths[Dim]; - for (d=0; d<Dim; ++d) - lengths[d] = rdomain[d].length(); + // construct array of axis lengths + int lengths[Dim]; + for (d=0; d<Dim; ++d) + lengths[d] = rdomain[d].length(); - // construct array of transform types for FFT Engine, compute normalization - int transformTypes[Dim]; - T& normFact = this->getNormFact(); - normFact = 1.0; - for (d=0; d<Dim; ++d) { - transformTypes[d] = FFTBase<Dim,T>::sineFFT; // sine transform - normFact /= (2.0 * (lengths[d] + 1)); - } + // construct array of transform types for FFT Engine, compute normalization + int transformTypes[Dim]; + T& normFact = this->getNormFact(); + normFact = 1.0; + for (d=0; d<Dim; ++d) { + transformTypes[d] = FFTBase<Dim,T>::sineFFT; // sine transform + normFact /= (2.0 * (lengths[d] + 1)); + } - // set up FFT Engine - this->getEngine().setup(Dim, transformTypes, lengths); - // set up the temporary fields - setup(); + // set up FFT Engine + this->getEngine().setup(Dim, transformTypes, lengths); + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -3021,151 +2281,151 @@ template <size_t Dim, class T> void FFT<SineTransform,Dim,T>::setup(void) { - // Tau profiling - - - - - size_t d, dim, activeDim = 0; - size_t icount; - Domain_t ndip; - size_t nTransformDims = this->numTransformDims(); // total number of transforms - const Domain_t& domain = this->getDomain(); // get real Field domain - - // Set up the arrays of temporary Fields and FieldLayouts: - e_dim_tag serialParallel[Dim]; // Specifies SERIAL, PARALLEL dims in temp - // make zeroth dimension always SERIAL - serialParallel[0] = SERIAL; - // all other dimensions parallel - for (d=1; d<Dim; ++d) - serialParallel[d] = PARALLEL; - - // do we have a real-to-complex transform to do or not? - if (nTransformDims > numSineTransforms_m) { // have RC transform - - PAssert(complexDomain_m); // This pointer should be initialized! - // find first non-sine transform dimension; this is rc transform - bool match = false; - d=0; - while (d<Dim && !match) { - if (this->transformDim(d) && !sineTransformDims_m[d]) { - activeDim = this->activeDimension(d); - match = true; - } - ++d; - } - PAssert_EQ(match, true); // check that we found rc transform dimension - // compare lengths of real and complex Field domains - for (d=0; d<Dim; ++d) { - if (d == activeDim) { - // real array length n, complex array length n/2+1 - if ( (*complexDomain_m)[d].length() != - (domain[d].length()/2 + 1) ) match = false; - } - else { - // real and complex arrays should be same length for all other dims - if ( (*complexDomain_m)[d].length() != - domain[d].length() ) match = false; - } - } - PInsist(match, - "Domains provided for real and complex Fields are incompatible!"); - - // set up the real Fields first - // we will have one for each sine transform, plus one for the rc transform - tempRLayouts_m = new Layout_t*[numSineTransforms_m+1]; - tempRFields_m = new RealField_t*[numSineTransforms_m+1]; - // loop over the sine transform dimensions - icount=0; - for (dim=0; dim<numSineTransforms_m; ++dim, ++icount) { - // get next dimension to be sine transformed - while (!sineTransformDims_m[icount]) ++icount; - PAssert_LT(icount, Dim); // check that icount is valid dimension - // make new domain with permuted Indexes, icount first - ndip[0] = domain[icount]; - for (d=1; d<Dim; ++d) { - size_t nextDim = icount + d; - if (nextDim >= Dim) nextDim -= Dim; - ndip[d] = domain[nextDim]; - } - // generate temporary field layout - tempRLayouts_m[dim] = new Layout_t(ndip, serialParallel, this->transVnodes()); - // create temporary real Field - tempRFields_m[dim] = new RealField_t(*tempRLayouts_m[dim]); - // If user requests no intermediate compression, uncompress right now: - if (!this->compressTemps()) (*tempRFields_m[dim]).Uncompress(); - } + // Tau profiling - // build final real Field for rc transform along activeDim - ndip[0] = domain[activeDim]; - for (d=1; d<Dim; ++d) { - size_t nextDim = activeDim + d; - if (nextDim >= Dim) nextDim -= Dim; - ndip[d] = domain[nextDim]; - } - // generate temporary field layout - tempRLayouts_m[numSineTransforms_m] = new Layout_t(ndip, serialParallel, - this->transVnodes()); - // create temporary real Field - tempRFields_m[numSineTransforms_m] = - new RealField_t(*tempRLayouts_m[numSineTransforms_m]); - // If user requests no intermediate compression, uncompress right now: - if (!this->compressTemps()) (*tempRFields_m[numSineTransforms_m]).Uncompress(); - - // now create the temporary complex Fields - size_t numComplex = nTransformDims - numSineTransforms_m; - // allocate arrays of temp fields and layouts - tempLayouts_m = new Layout_t*[numComplex]; - tempFields_m = new ComplexField_t*[numComplex]; - icount=0; // reset counter - for (dim=0; dim<numComplex; ++dim, ++icount) { - // get next non-sine transform dimension - while (!this->transformDim(icount) || sineTransformDims_m[icount]) ++icount; - PAssert_LT(icount, Dim); // check that this is a valid dimension - // make new domain with permuted Indexes, icount first - ndip[0] = (*complexDomain_m)[icount]; - for (d=1; d<Dim; ++d) { - size_t nextDim = icount + d; - if (nextDim >= Dim) nextDim -= Dim; - ndip[d] = (*complexDomain_m)[nextDim]; - } - // generate temporary field layout - tempLayouts_m[dim] = new Layout_t(ndip, serialParallel, this->transVnodes()); - // create temporary complex Field - tempFields_m[dim] = new ComplexField_t(*tempLayouts_m[dim]); - // If user requests no intermediate compression, uncompress right now: - if (!this->compressTemps()) (*tempFields_m[dim]).Uncompress(); - } - } - else { // sine transforms only - - // set up the real Fields - // we will have one for each sine transform - tempRLayouts_m = new Layout_t*[numSineTransforms_m]; - tempRFields_m = new RealField_t*[numSineTransforms_m]; - // loop over the sine transform dimensions - for (dim=0; dim<numSineTransforms_m; ++dim) { - // get next dimension to be sine transformed - activeDim = this->activeDimension(dim); - // make new domain with permuted Indexes, activeDim first - ndip[0] = domain[activeDim]; - for (d=1; d<Dim; ++d) { - size_t nextDim = activeDim + d; - if (nextDim >= Dim) nextDim -= Dim; - ndip[d] = domain[nextDim]; - } - // generate temporary field layout - tempRLayouts_m[dim] = new Layout_t(ndip, serialParallel, this->transVnodes()); - // create temporary real Field - tempRFields_m[dim] = new RealField_t(*tempRLayouts_m[dim]); - // If user requests no intermediate compression, uncompress right now: - if (!this->compressTemps()) (*tempRFields_m[dim]).Uncompress(); - } - } - return; + size_t d, dim, activeDim = 0; + size_t icount; + Domain_t ndip; + size_t nTransformDims = this->numTransformDims(); // total number of transforms + const Domain_t& domain = this->getDomain(); // get real Field domain + + // Set up the arrays of temporary Fields and FieldLayouts: + e_dim_tag serialParallel[Dim]; // Specifies SERIAL, PARALLEL dims in temp + // make zeroth dimension always SERIAL + serialParallel[0] = SERIAL; + // all other dimensions parallel + for (d=1; d<Dim; ++d) + serialParallel[d] = PARALLEL; + + // do we have a real-to-complex transform to do or not? + if (nTransformDims > numSineTransforms_m) { // have RC transform + + PAssert(complexDomain_m); // This pointer should be initialized! + // find first non-sine transform dimension; this is rc transform + bool match = false; + d=0; + while (d<Dim && !match) { + if (this->transformDim(d) && !sineTransformDims_m[d]) { + activeDim = this->activeDimension(d); + match = true; + } + ++d; + } + PAssert_EQ(match, true); // check that we found rc transform dimension + // compare lengths of real and complex Field domains + for (d=0; d<Dim; ++d) { + if (d == activeDim) { + // real array length n, complex array length n/2+1 + if ( (*complexDomain_m)[d].length() != + (domain[d].length()/2 + 1) ) match = false; + } + else { + // real and complex arrays should be same length for all other dims + if ( (*complexDomain_m)[d].length() != + domain[d].length() ) match = false; + } + } + PInsist(match, + "Domains provided for real and complex Fields are incompatible!"); + + // set up the real Fields first + // we will have one for each sine transform, plus one for the rc transform + tempRLayouts_m = new Layout_t*[numSineTransforms_m+1]; + tempRFields_m = new RealField_t*[numSineTransforms_m+1]; + // loop over the sine transform dimensions + icount=0; + for (dim=0; dim<numSineTransforms_m; ++dim, ++icount) { + // get next dimension to be sine transformed + while (!sineTransformDims_m[icount]) ++icount; + PAssert_LT(icount, Dim); // check that icount is valid dimension + // make new domain with permuted Indexes, icount first + ndip[0] = domain[icount]; + for (d=1; d<Dim; ++d) { + size_t nextDim = icount + d; + if (nextDim >= Dim) nextDim -= Dim; + ndip[d] = domain[nextDim]; + } + // generate temporary field layout + tempRLayouts_m[dim] = new Layout_t(ndip, serialParallel, this->transVnodes()); + // create temporary real Field + tempRFields_m[dim] = new RealField_t(*tempRLayouts_m[dim]); + // If user requests no intermediate compression, uncompress right now: + if (!this->compressTemps()) (*tempRFields_m[dim]).Uncompress(); + } + + // build final real Field for rc transform along activeDim + ndip[0] = domain[activeDim]; + for (d=1; d<Dim; ++d) { + size_t nextDim = activeDim + d; + if (nextDim >= Dim) nextDim -= Dim; + ndip[d] = domain[nextDim]; + } + // generate temporary field layout + tempRLayouts_m[numSineTransforms_m] = new Layout_t(ndip, serialParallel, + this->transVnodes()); + // create temporary real Field + tempRFields_m[numSineTransforms_m] = + new RealField_t(*tempRLayouts_m[numSineTransforms_m]); + // If user requests no intermediate compression, uncompress right now: + if (!this->compressTemps()) (*tempRFields_m[numSineTransforms_m]).Uncompress(); + + // now create the temporary complex Fields + size_t numComplex = nTransformDims - numSineTransforms_m; + // allocate arrays of temp fields and layouts + tempLayouts_m = new Layout_t*[numComplex]; + tempFields_m = new ComplexField_t*[numComplex]; + icount=0; // reset counter + for (dim=0; dim<numComplex; ++dim, ++icount) { + // get next non-sine transform dimension + while (!this->transformDim(icount) || sineTransformDims_m[icount]) ++icount; + PAssert_LT(icount, Dim); // check that this is a valid dimension + // make new domain with permuted Indexes, icount first + ndip[0] = (*complexDomain_m)[icount]; + for (d=1; d<Dim; ++d) { + size_t nextDim = icount + d; + if (nextDim >= Dim) nextDim -= Dim; + ndip[d] = (*complexDomain_m)[nextDim]; + } + // generate temporary field layout + tempLayouts_m[dim] = new Layout_t(ndip, serialParallel, this->transVnodes()); + // create temporary complex Field + tempFields_m[dim] = new ComplexField_t(*tempLayouts_m[dim]); + // If user requests no intermediate compression, uncompress right now: + if (!this->compressTemps()) (*tempFields_m[dim]).Uncompress(); + } + + } + else { // sine transforms only + + // set up the real Fields + // we will have one for each sine transform + tempRLayouts_m = new Layout_t*[numSineTransforms_m]; + tempRFields_m = new RealField_t*[numSineTransforms_m]; + // loop over the sine transform dimensions + for (dim=0; dim<numSineTransforms_m; ++dim) { + // get next dimension to be sine transformed + activeDim = this->activeDimension(dim); + // make new domain with permuted Indexes, activeDim first + ndip[0] = domain[activeDim]; + for (d=1; d<Dim; ++d) { + size_t nextDim = activeDim + d; + if (nextDim >= Dim) nextDim -= Dim; + ndip[d] = domain[nextDim]; + } + // generate temporary field layout + tempRLayouts_m[dim] = new Layout_t(ndip, serialParallel, this->transVnodes()); + // create temporary real Field + tempRFields_m[dim] = new RealField_t(*tempRLayouts_m[dim]); + // If user requests no intermediate compression, uncompress right now: + if (!this->compressTemps()) (*tempRFields_m[dim]).Uncompress(); + } + + } + + return; } //----------------------------------------------------------------------------- @@ -3175,35 +2435,35 @@ FFT<SineTransform,Dim,T>::setup(void) { template <size_t Dim, class T> FFT<SineTransform,Dim,T>::~FFT(void) { - // Tau profiling + // Tau profiling - // delete temporary fields and layouts - size_t d; - size_t nTransformDims = this->numTransformDims(); - if (nTransformDims > numSineTransforms_m) { - for (d=0; d<numSineTransforms_m+1; ++d) { - delete tempRFields_m[d]; - delete tempRLayouts_m[d]; - } - size_t numComplex = nTransformDims - numSineTransforms_m; - for (d=0; d<numComplex; ++d) { - delete tempFields_m[d]; - delete tempLayouts_m[d]; + // delete temporary fields and layouts + size_t d; + size_t nTransformDims = this->numTransformDims(); + if (nTransformDims > numSineTransforms_m) { + for (d=0; d<numSineTransforms_m+1; ++d) { + delete tempRFields_m[d]; + delete tempRLayouts_m[d]; + } + size_t numComplex = nTransformDims - numSineTransforms_m; + for (d=0; d<numComplex; ++d) { + delete tempFields_m[d]; + delete tempLayouts_m[d]; + } + delete [] tempFields_m; + delete [] tempLayouts_m; } - delete [] tempFields_m; - delete [] tempLayouts_m; - } - else { - for (d=0; d<numSineTransforms_m; ++d) { - delete tempRFields_m[d]; - delete tempRLayouts_m[d]; + else { + for (d=0; d<numSineTransforms_m; ++d) { + delete tempRFields_m[d]; + delete tempRLayouts_m[d]; + } } - } - delete [] tempRFields_m; - delete [] tempRLayouts_m; + delete [] tempRFields_m; + delete [] tempRLayouts_m; } //----------------------------------------------------------------------------- @@ -3213,268 +2473,268 @@ FFT<SineTransform,Dim,T>::~FFT(void) { template <size_t Dim, class T> void FFT<SineTransform,Dim,T>::transform( - int direction, - FFT<SineTransform,Dim,T>::RealField_t& f, - FFT<SineTransform,Dim,T>::ComplexField_t& g, - const bool& constInput) + int direction, + FFT<SineTransform,Dim,T>::RealField_t& f, + FFT<SineTransform,Dim,T>::ComplexField_t& g, + const bool& constInput) { - // indicate we're doing another FFT - //INCIPPLSTAT(incFFTs); - - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && - this->checkDomain(*complexDomain_m,out_dom), true ); - - // Common loop iterate and other vars: - size_t d; - int icount, activeDim; - int idim; // idim loops over the number of transform dims. - size_t nTransformDims = this->numTransformDims(); - // check that there is a real-to-complex transform to do - PInsist(nTransformDims>numSineTransforms_m, - "Wrong output Field type for real-to-real transform!!"); - - // first do all the sine transforms - - // Field* management aid - RealField_t* tempR = &f; - // Local work array passed to FFT: - T* localdataR; - - // Loop over the dimensions to be sine transformed: - icount = 0; - activeDim = 0; - for (idim = 0; idim != numSineTransforms_m; ++idim, ++icount, ++activeDim) { - - // find next sine transform dim - while (!sineTransformDims_m[icount]) { - if (this->transformDim(icount)) ++activeDim; - ++icount; - } - PAssert_LT(activeDim, Dim); // check that this is a valid dimension! - // Now do the serial transforms along this dimension: - - bool skipTranspose = false; - // if this is the first transform dimension, we might be able - // to skip the transpose into the first temporary Field - if (idim == 0 && !constInput) { - // get domain for comparison - const Domain_t& first_dom = tempRLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && - (in_dom[0].length() == first_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); - } - - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempRFields_m[idim])[tempRLayouts_m[idim]->getDomain()] = - (*tempR)[tempR->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && tempR != &f) *tempR = 0; - tempR = tempRFields_m[idim]; // Field* management aid - } - - - - // Loop over all the Vnodes, working on the LField in each. - typename RealField_t::const_iterator_if l_i, l_end = tempR->end_if(); - for (l_i = tempR->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - RealLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdataR = ldf->getP(); - - // Do 1D real-to-real FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - this->getEngine().callFFT(activeDim, direction, localdataR); - // advance the data pointer - localdataR += length; - } // loop over 1D strips - } // loop over all the LFields - - } // loop over all transformed dimensions - - // now handle the RC transform separately - - // find first non-sine transform dimension - icount = 0; - activeDim = 0; - while (!this->transformDim(icount) || sineTransformDims_m[icount]) { - if (sineTransformDims_m[icount]) ++activeDim; - ++icount; - } - PAssert_LT(activeDim, Dim); // check that this is a valid dimension! - - - // transpose and permute to final real Field with transform dim first - int last = numSineTransforms_m; - (*tempRFields_m[last])[tempRLayouts_m[last]->getDomain()] = - (*tempR)[tempR->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && tempR != &f) *tempR = 0; - tempR = tempRFields_m[last]; // Field* management aid - - - // Field* for temp Field management: - ComplexField_t* temp = tempFields_m[0]; - // see if we can put final result directly into g - int numComplex = nTransformDims-numSineTransforms_m; - if (numComplex == 1) { // only a single RC transform - bool skipTemp = true; - // more rigorous match required here; check that layouts are identical - if ( !(out_layout == *tempLayouts_m[0]) ) skipTemp = false; - for (d=0; d<Dim; ++d) { - if ( out_layout.getDistribution(d) != - tempLayouts_m[0]->getDistribution(d) ) skipTemp = false; - } - if ( out_layout.numVnodes() != tempLayouts_m[0]->numVnodes() ) - skipTemp = false; - // also make sure there are no guard cells - if (!(g.getGC() == FFT<SineTransform,Dim,T>::nullGC)) skipTemp = false; - if (skipTemp) temp = &g; - } - - - - // Loop over all the Vnodes, working on the LField in each. - typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); - typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); - for (rl_i = tempR->begin_if(); rl_i != rl_end; ++rl_i, ++cl_i) { - // Get the LFields - RealLField_t* rldf = (*rl_i).second.get(); - ComplexLField_t* cldf = (*cl_i).second.get(); - // make sure we are uncompressed - rldf->Uncompress(); - cldf->Uncompress(); - // get the raw data pointers - T* localreal = rldf->getP(); - Complex_t* localcomp = cldf->getP(); - - int nstrips = 1, lengthreal = rldf->size(0), lengthcomp = cldf->size(0); - // number of strips should be the same for real and complex LFields! - for (d=1; d<Dim; ++d) nstrips *= rldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // move the data into the complex strip, which is two reals longer - for (int ilen=0; ilen<lengthreal; ilen+=2) - localcomp[ilen/2] = Complex_t(localreal[ilen],localreal[ilen+1]); - // Do the 1D real-to-complex FFT: - // note that real-to-complex FFT direction is always +1 - this->getEngine().callFFT(activeDim, +1, localcomp); - // advance the data pointers - localreal += lengthreal; - localcomp += lengthcomp; - } // loop over 1D strips - } // loop over all the LFields - - - // now proceed with the other complex-to-complex transforms - - // Local work array passed to FFT: - Complex_t* localdata; - - // Loop over the remaining dimensions to be transformed: - ++icount; - ++activeDim; - for (idim = 1; idim != numComplex; ++idim, ++icount, ++activeDim) { - - // find the next non-sine transform dimension + // indicate we're doing another FFT + //INCIPPLSTAT(incFFTs); + + // Check domain of incoming Fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); + PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && + this->checkDomain(*complexDomain_m,out_dom), true ); + + // Common loop iterate and other vars: + size_t d; + int icount, activeDim; + int idim; // idim loops over the number of transform dims. + size_t nTransformDims = this->numTransformDims(); + // check that there is a real-to-complex transform to do + PInsist(nTransformDims>numSineTransforms_m, + "Wrong output Field type for real-to-real transform!!"); + + // first do all the sine transforms + + // Field* management aid + RealField_t* tempR = &f; + // Local work array passed to FFT: + T* localdataR; + + // Loop over the dimensions to be sine transformed: + icount = 0; + activeDim = 0; + for (idim = 0; idim != numSineTransforms_m; ++idim, ++icount, ++activeDim) { + + // find next sine transform dim + while (!sineTransformDims_m[icount]) { + if (this->transformDim(icount)) ++activeDim; + ++icount; + } + PAssert_LT(activeDim, Dim); // check that this is a valid dimension! + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the first transform dimension, we might be able + // to skip the transpose into the first temporary Field + if (idim == 0 && !constInput) { + // get domain for comparison + const Domain_t& first_dom = tempRLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && + (in_dom[0].length() == first_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + (*tempRFields_m[idim])[tempRLayouts_m[idim]->getDomain()] = + (*tempR)[tempR->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && tempR != &f) *tempR = 0; + tempR = tempRFields_m[idim]; // Field* management aid + } + + + + // Loop over all the Vnodes, working on the LField in each. + typename RealField_t::const_iterator_if l_i, l_end = tempR->end_if(); + for (l_i = tempR->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + RealLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdataR = ldf->getP(); + + // Do 1D real-to-real FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + this->getEngine().callFFT(activeDim, direction, localdataR); + // advance the data pointer + localdataR += length; + } // loop over 1D strips + } // loop over all the LFields + + } // loop over all transformed dimensions + + // now handle the RC transform separately + + // find first non-sine transform dimension + icount = 0; + activeDim = 0; while (!this->transformDim(icount) || sineTransformDims_m[icount]) { - if (sineTransformDims_m[icount]) ++activeDim; - ++icount; + if (sineTransformDims_m[icount]) ++activeDim; + ++icount; } PAssert_LT(activeDim, Dim); // check that this is a valid dimension! - // Now do the serial transforms along this dimension: - bool skipTranspose = false; - // if this is the last transform dimension, we might be able - // to skip the last temporary and transpose right into g - if (idim == numComplex-1) { - // get the domain for comparison - const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (out_dom[0].sameBase(last_dom[0])) && - (out_dom[0].length() == last_dom[0].length()) && - (out_layout.getDistribution(0) == SERIAL) && - (g.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); - } - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; + // transpose and permute to final real Field with transform dim first + int last = numSineTransforms_m; + (*tempRFields_m[last])[tempRLayouts_m[last]->getDomain()] = + (*tempR)[tempR->getLayout().getDomain()]; - // Compress out previous iterate's storage: - if (this->compressTemps()) *temp = 0; - temp = tempFields_m[idim]; // Field* management aid - } - else if (idim == numComplex-1) { - // last transform and we can skip the last temporary field - // so do the transpose here using g instead + // Compress out previous iterate's storage: + if (this->compressTemps() && tempR != &f) *tempR = 0; + tempR = tempRFields_m[last]; // Field* management aid - // transpose and permute to Field with transform dim first - g[out_dom] = (*temp)[temp->getLayout().getDomain()]; - // Compress out previous iterate's storage: - if (this->compressTemps()) *temp = 0; - temp = &g; // Field* management aid + // Field* for temp Field management: + ComplexField_t* temp = tempFields_m[0]; + // see if we can put final result directly into g + int numComplex = nTransformDims-numSineTransforms_m; + if (numComplex == 1) { // only a single RC transform + bool skipTemp = true; + // more rigorous match required here; check that layouts are identical + if ( !(out_layout == *tempLayouts_m[0]) ) skipTemp = false; + for (d=0; d<Dim; ++d) { + if ( out_layout.getDistribution(d) != + tempLayouts_m[0]->getDistribution(d) ) skipTemp = false; + } + if ( out_layout.numVnodes() != tempLayouts_m[0]->numVnodes() ) + skipTemp = false; + // also make sure there are no guard cells + if (!(g.getGC() == FFT<SineTransform,Dim,T>::nullGC)) skipTemp = false; + if (skipTemp) temp = &g; } // Loop over all the Vnodes, working on the LField in each. - typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); - for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - ComplexLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdata = ldf->getP(); - - // Do 1D complex-to-complex FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - this->getEngine().callFFT(activeDim, direction, localdata); - // advance the data pointer - localdata += length; - } // loop over 1D strips + typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); + typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); + for (rl_i = tempR->begin_if(); rl_i != rl_end; ++rl_i, ++cl_i) { + // Get the LFields + RealLField_t* rldf = (*rl_i).second.get(); + ComplexLField_t* cldf = (*cl_i).second.get(); + // make sure we are uncompressed + rldf->Uncompress(); + cldf->Uncompress(); + // get the raw data pointers + T* localreal = rldf->getP(); + Complex_t* localcomp = cldf->getP(); + + int nstrips = 1, lengthreal = rldf->size(0), lengthcomp = cldf->size(0); + // number of strips should be the same for real and complex LFields! + for (d=1; d<Dim; ++d) nstrips *= rldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // move the data into the complex strip, which is two reals longer + for (int ilen=0; ilen<lengthreal; ilen+=2) + localcomp[ilen/2] = Complex_t(localreal[ilen],localreal[ilen+1]); + // Do the 1D real-to-complex FFT: + // note that real-to-complex FFT direction is always +1 + this->getEngine().callFFT(activeDim, +1, localcomp); + // advance the data pointers + localreal += lengthreal; + localcomp += lengthcomp; + } // loop over 1D strips } // loop over all the LFields - } // loop over all transformed dimensions - - // skip final assignment and compress if we used g as final temporary - if (temp != &g) { - // Now assign into output Field, and compress last temp's storage: - g[out_dom] = (*temp)[temp->getLayout().getDomain()]; - if (this->compressTemps()) *temp = 0; - - } + // now proceed with the other complex-to-complex transforms - // Normalize: - if (direction == +1) g = g * this->getNormFact(); + // Local work array passed to FFT: + Complex_t* localdata; - return; + // Loop over the remaining dimensions to be transformed: + ++icount; + ++activeDim; + for (idim = 1; idim != numComplex; ++idim, ++icount, ++activeDim) { + + // find the next non-sine transform dimension + while (!this->transformDim(icount) || sineTransformDims_m[icount]) { + if (sineTransformDims_m[icount]) ++activeDim; + ++icount; + } + PAssert_LT(activeDim, Dim); // check that this is a valid dimension! + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the last transform dimension, we might be able + // to skip the last temporary and transpose right into g + if (idim == numComplex-1) { + // get the domain for comparison + const Domain_t& last_dom = tempLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (out_dom[0].sameBase(last_dom[0])) && + (out_dom[0].length() == last_dom[0].length()) && + (out_layout.getDistribution(0) == SERIAL) && + (g.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = + (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps()) *temp = 0; + temp = tempFields_m[idim]; // Field* management aid + } + else if (idim == numComplex-1) { + // last transform and we can skip the last temporary field + // so do the transpose here using g instead + + // transpose and permute to Field with transform dim first + g[out_dom] = (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps()) *temp = 0; + temp = &g; // Field* management aid + } + + + + // Loop over all the Vnodes, working on the LField in each. + typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); + for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + ComplexLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdata = ldf->getP(); + + // Do 1D complex-to-complex FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + this->getEngine().callFFT(activeDim, direction, localdata); + // advance the data pointer + localdata += length; + } // loop over 1D strips + } // loop over all the LFields + + } // loop over all transformed dimensions + + // skip final assignment and compress if we used g as final temporary + if (temp != &g) { + + // Now assign into output Field, and compress last temp's storage: + g[out_dom] = (*temp)[temp->getLayout().getDomain()]; + if (this->compressTemps()) *temp = 0; + + } + + // Normalize: + if (direction == +1) g = g * this->getNormFact(); + + return; } //----------------------------------------------------------------------------- @@ -3484,274 +2744,274 @@ FFT<SineTransform,Dim,T>::transform( template <size_t Dim, class T> void FFT<SineTransform,Dim,T>::transform( - int direction, - FFT<SineTransform,Dim,T>::ComplexField_t& f, - FFT<SineTransform,Dim,T>::RealField_t& g, - const bool& constInput) + int direction, + FFT<SineTransform,Dim,T>::ComplexField_t& f, + FFT<SineTransform,Dim,T>::RealField_t& g, + const bool& constInput) { - // indicate we're doing another FFT - // INCIPPLSTAT(incFFTs); - - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - PAssert_EQ( this->checkDomain(*complexDomain_m,in_dom) && - this->checkDomain(this->getDomain(),out_dom), true ); - - // Common loop iterate and other vars: - size_t d; - int icount, activeDim; - int idim; // idim loops over the number of transform dims. - size_t nTransformDims = this->numTransformDims(); - - // proceed with the complex-to-complex transforms - - // Field* for temp Field management: - ComplexField_t* temp = &f; - // Local work array passed to FFT: - Complex_t* localdata; - - // Loop over all dimensions to be non-sine transformed except last one: - int numComplex = nTransformDims - numSineTransforms_m; - icount = Dim-1; // start with last dimension - activeDim = nTransformDims-1; - for (idim = numComplex-1; idim != 0; --idim, --icount, --activeDim) { + // indicate we're doing another FFT + // INCIPPLSTAT(incFFTs); + + // Check domain of incoming Fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); + PAssert_EQ( this->checkDomain(*complexDomain_m,in_dom) && + this->checkDomain(this->getDomain(),out_dom), true ); + + // Common loop iterate and other vars: + size_t d; + int icount, activeDim; + int idim; // idim loops over the number of transform dims. + size_t nTransformDims = this->numTransformDims(); + + // proceed with the complex-to-complex transforms + + // Field* for temp Field management: + ComplexField_t* temp = &f; + // Local work array passed to FFT: + Complex_t* localdata; + + // Loop over all dimensions to be non-sine transformed except last one: + int numComplex = nTransformDims - numSineTransforms_m; + icount = Dim-1; // start with last dimension + activeDim = nTransformDims-1; + for (idim = numComplex-1; idim != 0; --idim, --icount, --activeDim) { + + // find next non-sine transform dim + while (!this->transformDim(icount) || sineTransformDims_m[icount]) { + if (sineTransformDims_m[icount]) --activeDim; + --icount; + } + PAssert_GE(activeDim, 0); // check that this is a valid dimension! + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the first transform dimension, we might be able + // to skip the transpose into the first temporary Field + if (idim == numComplex-1 && !constInput) { + // get domain for comparison + const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && + (in_dom[0].length() == first_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = + (*temp)[temp->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && temp != &f) *temp = 0; + temp = tempFields_m[idim]; // Field* management aid + } + + + + // Loop over all the Vnodes, working on the LField in each. + typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); + for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + ComplexLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdata = ldf->getP(); + + // Do 1D complex-to-complex FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + this->getEngine().callFFT(activeDim, direction, localdata); + // advance the data pointer + localdata += length; + } // loop over 1D strips + } // loop over all the LFields + + } // loop over all transformed dimensions + + // handle the CR transform separately // find next non-sine transform dim while (!this->transformDim(icount) || sineTransformDims_m[icount]) { - if (sineTransformDims_m[icount]) --activeDim; - --icount; + if (sineTransformDims_m[icount]) --activeDim; + --icount; } PAssert_GE(activeDim, 0); // check that this is a valid dimension! - // Now do the serial transforms along this dimension: - - bool skipTranspose = false; - // if this is the first transform dimension, we might be able - // to skip the transpose into the first temporary Field - if (idim == numComplex-1 && !constInput) { - // get domain for comparison - const Domain_t& first_dom = tempLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && - (in_dom[0].length() == first_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); - } - - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempFields_m[idim])[tempLayouts_m[idim]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && temp != &f) *temp = 0; - temp = tempFields_m[idim]; // Field* management aid - } - - - - // Loop over all the Vnodes, working on the LField in each. - typename ComplexField_t::const_iterator_if l_i, l_end = temp->end_if(); - for (l_i = temp->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - ComplexLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdata = ldf->getP(); - - // Do 1D complex-to-complex FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - this->getEngine().callFFT(activeDim, direction, localdata); - // advance the data pointer - localdata += length; - } // loop over 1D strips - } // loop over all the LFields - } // loop over all transformed dimensions + // Temp Field* management aid + RealField_t* tempR = tempRFields_m[numSineTransforms_m]; - // handle the CR transform separately - - // find next non-sine transform dim - while (!this->transformDim(icount) || sineTransformDims_m[icount]) { - if (sineTransformDims_m[icount]) --activeDim; - --icount; - } - PAssert_GE(activeDim, 0); // check that this is a valid dimension! - - // Temp Field* management aid - RealField_t* tempR = tempRFields_m[numSineTransforms_m]; - - bool skipTemp = true; - if (numComplex == 1 && !constInput) { - // only one CR transform - // see if we really need to transpose input data - // more rigorous match required here; check that layouts are identical - if ( !(in_layout == *tempLayouts_m[0]) ) skipTemp = false; - for (d=0; d<Dim; ++d) { - if ( in_layout.getDistribution(d) != - tempLayouts_m[0]->getDistribution(d) ) skipTemp = false; - } - if ( in_layout.numVnodes() != tempLayouts_m[0]->numVnodes() ) - skipTemp = false; - // also make sure there are no guard cells - if (!(f.getGC() == FFT<SineTransform,Dim,T>::nullGC)) skipTemp = false; - } - else { // cannot skip transpose - skipTemp = false; - } - - if (!skipTemp) { - - // transpose and permute to complex Field with transform dim first - (*tempFields_m[0])[tempLayouts_m[0]->getDomain()] = - (*temp)[temp->getLayout().getDomain()]; - // compress previous iterates storage - if (this->compressTemps() && temp != &f) *temp = 0; - temp = tempFields_m[0]; - - } - - - // Loop over all the Vnodes, working on the LField in each. - typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); - typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); - for (rl_i = tempR->begin_if(); rl_i != rl_end; ++rl_i, ++cl_i) { - // Get the LFields - RealLField_t* rldf = (*rl_i).second.get(); - ComplexLField_t* cldf = (*cl_i).second.get(); - // make sure we are uncompressed - rldf->Uncompress(); - cldf->Uncompress(); - // get the raw data pointers - T* localreal = rldf->getP(); - Complex_t* localcomp = cldf->getP(); - - int nstrips = 1, lengthreal = rldf->size(0), lengthcomp = cldf->size(0); - // number of strips should be the same for real and complex LFields! - for (d=1; d<Dim; ++d) nstrips *= rldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D complex-to-real FFT: - // note that complex-to-real FFT direction is always -1 - this->getEngine().callFFT(activeDim, -1, localcomp); - // move the data into the real strip, which is two reals shorter - for (int ilen=0; ilen<lengthreal; ilen+=2) { - localreal[ilen] = real(localcomp[ilen/2]); - localreal[ilen+1] = imag(localcomp[ilen/2]); - } - // advance the data pointers - localreal += lengthreal; - localcomp += lengthcomp; - } // loop over 1D strips - } // loop over all the LFields - - - - // compress previous iterates storage - if (this->compressTemps() && temp != &f) *temp = 0; - - - // now do the real-to-real FFTs - - // Local work array passed to FFT: - T* localdataR; - - // Loop over the remaining dimensions to be transformed: - icount = Dim-1; // start with last dimension - activeDim = nTransformDims - 1; - for (idim = numSineTransforms_m-1; idim != -1; - --idim, --icount, --activeDim) { - - // find next sine transform dim - while (!sineTransformDims_m[icount]) { - if (this->transformDim(icount)) --activeDim; - --icount; + bool skipTemp = true; + if (numComplex == 1 && !constInput) { + // only one CR transform + // see if we really need to transpose input data + // more rigorous match required here; check that layouts are identical + if ( !(in_layout == *tempLayouts_m[0]) ) skipTemp = false; + for (d=0; d<Dim; ++d) { + if ( in_layout.getDistribution(d) != + tempLayouts_m[0]->getDistribution(d) ) skipTemp = false; + } + if ( in_layout.numVnodes() != tempLayouts_m[0]->numVnodes() ) + skipTemp = false; + // also make sure there are no guard cells + if (!(f.getGC() == FFT<SineTransform,Dim,T>::nullGC)) skipTemp = false; } - PAssert_GE(activeDim, 0); // check that this is a valid dimension! - // Now do the serial transforms along this dimension: - - bool skipTranspose = false; - // if this is the last transform dimension, we might be able - // to skip the last temporary and transpose right into g - if (idim == 0) { - // get the domain for comparison - const Domain_t& last_dom = tempRLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (out_dom[0].sameBase(last_dom[0])) && - (out_dom[0].length() == last_dom[0].length()) && - (out_layout.getDistribution(0) == SERIAL) && - (g.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); + else { // cannot skip transpose + skipTemp = false; } - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempRFields_m[idim])[tempRLayouts_m[idim]->getDomain()] = - (*tempR)[tempR->getLayout().getDomain()]; + if (!skipTemp) { - // Compress out previous iterate's storage: - if (this->compressTemps()) *tempR = 0; - tempR = tempRFields_m[idim]; // Field* management aid - } - else if (idim == 0) { - // last transform and we can skip the last temporary field - // so do the transpose here using g instead - - // transpose and permute to Field with transform dim first - g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; + // transpose and permute to complex Field with transform dim first + (*tempFields_m[0])[tempLayouts_m[0]->getDomain()] = + (*temp)[temp->getLayout().getDomain()]; + // compress previous iterates storage + if (this->compressTemps() && temp != &f) *temp = 0; + temp = tempFields_m[0]; - // Compress out previous iterate's storage: - if (this->compressTemps()) *tempR = 0; - tempR = &g; // Field* management aid } - // Loop over all the Vnodes, working on the LField in each. - typename RealField_t::const_iterator_if l_i, l_end = tempR->end_if(); - for (l_i = tempR->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - RealLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdataR = ldf->getP(); - - // Do 1D complex-to-complex FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - this->getEngine().callFFT(activeDim, direction, localdataR); - // advance the data pointer - localdataR += length; - } // loop over 1D strips + typename RealField_t::const_iterator_if rl_i, rl_end = tempR->end_if(); + typename ComplexField_t::const_iterator_if cl_i = temp->begin_if(); + for (rl_i = tempR->begin_if(); rl_i != rl_end; ++rl_i, ++cl_i) { + // Get the LFields + RealLField_t* rldf = (*rl_i).second.get(); + ComplexLField_t* cldf = (*cl_i).second.get(); + // make sure we are uncompressed + rldf->Uncompress(); + cldf->Uncompress(); + // get the raw data pointers + T* localreal = rldf->getP(); + Complex_t* localcomp = cldf->getP(); + + int nstrips = 1, lengthreal = rldf->size(0), lengthcomp = cldf->size(0); + // number of strips should be the same for real and complex LFields! + for (d=1; d<Dim; ++d) nstrips *= rldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D complex-to-real FFT: + // note that complex-to-real FFT direction is always -1 + this->getEngine().callFFT(activeDim, -1, localcomp); + // move the data into the real strip, which is two reals shorter + for (int ilen=0; ilen<lengthreal; ilen+=2) { + localreal[ilen] = real(localcomp[ilen/2]); + localreal[ilen+1] = imag(localcomp[ilen/2]); + } + // advance the data pointers + localreal += lengthreal; + localcomp += lengthcomp; + } // loop over 1D strips } // loop over all the LFields - } // loop over all transformed dimensions - // skip final assignment and compress if we used g as final temporary - if (tempR != &g) { - // Now assign into output Field, and compress last temp's storage: - g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; - if (this->compressTemps()) *tempR = 0; - - } + // compress previous iterates storage + if (this->compressTemps() && temp != &f) *temp = 0; - // Normalize: - if (direction == +1) g = g * this->getNormFact(); - return; + // now do the real-to-real FFTs + + // Local work array passed to FFT: + T* localdataR; + + // Loop over the remaining dimensions to be transformed: + icount = Dim-1; // start with last dimension + activeDim = nTransformDims - 1; + for (idim = numSineTransforms_m-1; idim != -1; + --idim, --icount, --activeDim) { + + // find next sine transform dim + while (!sineTransformDims_m[icount]) { + if (this->transformDim(icount)) --activeDim; + --icount; + } + PAssert_GE(activeDim, 0); // check that this is a valid dimension! + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the last transform dimension, we might be able + // to skip the last temporary and transpose right into g + if (idim == 0) { + // get the domain for comparison + const Domain_t& last_dom = tempRLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (out_dom[0].sameBase(last_dom[0])) && + (out_dom[0].length() == last_dom[0].length()) && + (out_layout.getDistribution(0) == SERIAL) && + (g.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + (*tempRFields_m[idim])[tempRLayouts_m[idim]->getDomain()] = + (*tempR)[tempR->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps()) *tempR = 0; + tempR = tempRFields_m[idim]; // Field* management aid + } + else if (idim == 0) { + // last transform and we can skip the last temporary field + // so do the transpose here using g instead + + // transpose and permute to Field with transform dim first + g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps()) *tempR = 0; + tempR = &g; // Field* management aid + } + + + + // Loop over all the Vnodes, working on the LField in each. + typename RealField_t::const_iterator_if l_i, l_end = tempR->end_if(); + for (l_i = tempR->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + RealLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdataR = ldf->getP(); + + // Do 1D complex-to-complex FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + this->getEngine().callFFT(activeDim, direction, localdataR); + // advance the data pointer + localdataR += length; + } // loop over 1D strips + } // loop over all the LFields + + } // loop over all transformed dimensions + + // skip final assignment and compress if we used g as final temporary + if (tempR != &g) { + + // Now assign into output Field, and compress last temp's storage: + g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; + if (this->compressTemps()) *tempR = 0; + + } + + // Normalize: + if (direction == +1) g = g * this->getNormFact(); + + return; } //----------------------------------------------------------------------------- @@ -3761,133 +3021,133 @@ FFT<SineTransform,Dim,T>::transform( template <size_t Dim, class T> void FFT<SineTransform,Dim,T>::transform( - int direction, - FFT<SineTransform,Dim,T>::RealField_t& f, - FFT<SineTransform,Dim,T>::RealField_t& g, - const bool& constInput) + int direction, + FFT<SineTransform,Dim,T>::RealField_t& f, + FFT<SineTransform,Dim,T>::RealField_t& g, + const bool& constInput) { - // indicate we're doing another FFT - //INCIPPLSTAT(incFFTs); - - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && - this->checkDomain(this->getDomain(),out_dom), true ); - - // Common loop iterate and other vars: - size_t d; - int idim; // idim loops over the number of transform dims. - int begdim, enddim; - size_t nTransformDims = this->numTransformDims(); - // check that there is no real-to-complex transform to do - PInsist(nTransformDims==numSineTransforms_m, - "Wrong output Field type for real-to-complex transform!!"); - - // do all the sine transforms - - // Field* management aid - RealField_t* tempR = &f; - // Local work array passed to FFT: - T* localdataR; - - // Loop over the dimensions to be sine transformed: - begdim = (direction == +1) ? 0 : static_cast<int>(nTransformDims-1); - enddim = (direction == +1) ? static_cast<int>(nTransformDims) : -1; - for (idim = begdim; idim != enddim; idim+=direction) { - - // Now do the serial transforms along this dimension: - - bool skipTranspose = false; - // if this is the first transform dimension, we might be able - // to skip the first temporary and just use f - if (idim == begdim && !constInput) { - // get the domain for comparison - const Domain_t& first_dom = tempRLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && - (in_dom[0].length() == first_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); - } - - // if this is the last transform dimension, we might be able - // to skip the last temporary and transpose right into g - if (idim == enddim-direction) { - // get the domain for comparison - const Domain_t& last_dom = tempRLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (out_dom[0].sameBase(last_dom[0])) && - (out_dom[0].length() == last_dom[0].length()) && - (out_layout.getDistribution(0) == SERIAL) && - (g.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); - } - - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempRFields_m[idim])[tempRLayouts_m[idim]->getDomain()] = - (*tempR)[tempR->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && tempR != &f) *tempR = 0; - tempR = tempRFields_m[idim]; // Field* management aid - } - else if (idim == enddim-direction && tempR != &g) { - // last transform and we can skip the last temporary field - // so do the transpose here using g instead - - // transpose and permute to Field with transform dim first - g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && tempR != &f) *tempR = 0; - tempR = &g; // Field* management aid - } - - - - // Loop over all the Vnodes, working on the LField in each. - typename RealField_t::const_iterator_if l_i, l_end = tempR->end_if(); - for (l_i = tempR->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - RealLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdataR = ldf->getP(); - - // Do 1D real-to-real FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - this->getEngine().callFFT(idim, direction, localdataR); - // advance the data pointer - localdataR += length; - } // loop over 1D strips - } // loop over all the LFields - - } // loop over all transformed dimensions - - // skip final assignment and compress if we used g as final temporary - if (tempR != &g) { - - // Now assign into output Field, and compress last temp's storage: - g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; - if (this->compressTemps() && tempR != &f) *tempR = 0; - - } - - // Normalize: - if (direction == +1) g = g * this->getNormFact(); - - return; + // indicate we're doing another FFT + //INCIPPLSTAT(incFFTs); + + // Check domain of incoming Fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); + PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && + this->checkDomain(this->getDomain(),out_dom), true ); + + // Common loop iterate and other vars: + size_t d; + int idim; // idim loops over the number of transform dims. + int begdim, enddim; + size_t nTransformDims = this->numTransformDims(); + // check that there is no real-to-complex transform to do + PInsist(nTransformDims==numSineTransforms_m, + "Wrong output Field type for real-to-complex transform!!"); + + // do all the sine transforms + + // Field* management aid + RealField_t* tempR = &f; + // Local work array passed to FFT: + T* localdataR; + + // Loop over the dimensions to be sine transformed: + begdim = (direction == +1) ? 0 : static_cast<int>(nTransformDims-1); + enddim = (direction == +1) ? static_cast<int>(nTransformDims) : -1; + for (idim = begdim; idim != enddim; idim+=direction) { + + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the first transform dimension, we might be able + // to skip the first temporary and just use f + if (idim == begdim && !constInput) { + // get the domain for comparison + const Domain_t& first_dom = tempRLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && + (in_dom[0].length() == first_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); + } + + // if this is the last transform dimension, we might be able + // to skip the last temporary and transpose right into g + if (idim == enddim-direction) { + // get the domain for comparison + const Domain_t& last_dom = tempRLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (out_dom[0].sameBase(last_dom[0])) && + (out_dom[0].length() == last_dom[0].length()) && + (out_layout.getDistribution(0) == SERIAL) && + (g.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + (*tempRFields_m[idim])[tempRLayouts_m[idim]->getDomain()] = + (*tempR)[tempR->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && tempR != &f) *tempR = 0; + tempR = tempRFields_m[idim]; // Field* management aid + } + else if (idim == enddim-direction && tempR != &g) { + // last transform and we can skip the last temporary field + // so do the transpose here using g instead + + // transpose and permute to Field with transform dim first + g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && tempR != &f) *tempR = 0; + tempR = &g; // Field* management aid + } + + + + // Loop over all the Vnodes, working on the LField in each. + typename RealField_t::const_iterator_if l_i, l_end = tempR->end_if(); + for (l_i = tempR->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + RealLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdataR = ldf->getP(); + + // Do 1D real-to-real FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + this->getEngine().callFFT(idim, direction, localdataR); + // advance the data pointer + localdataR += length; + } // loop over 1D strips + } // loop over all the LFields + + } // loop over all transformed dimensions + + // skip final assignment and compress if we used g as final temporary + if (tempR != &g) { + + // Now assign into output Field, and compress last temp's storage: + g[out_dom] = (*tempR)[tempR->getLayout().getDomain()]; + if (this->compressTemps() && tempR != &f) *tempR = 0; + + } + + // Normalize: + if (direction == +1) g = g * this->getNormFact(); + + return; } //----------------------------------------------------------------------------- @@ -3897,127 +3157,127 @@ FFT<SineTransform,Dim,T>::transform( template <size_t Dim, class T> void FFT<SineTransform,Dim,T>::transform( - int direction, - FFT<SineTransform,Dim,T>::RealField_t& f) + int direction, + FFT<SineTransform,Dim,T>::RealField_t& f) { - // indicate we're doing another FFT - //INCIPPLSTAT(incFFTs); - - // Check domain of incoming Field - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); - - // Common loop iterate and other vars: - size_t d; - int idim; // idim loops over the number of transform dims. - int begdim, enddim; - size_t nTransformDims = this->numTransformDims(); - // check that there is no real-to-complex transform to do - PInsist(nTransformDims==numSineTransforms_m, - "Cannot perform real-to-complex transform in-place!!"); - - // do all the sine transforms - - // Field* management aid - RealField_t* tempR = &f; - // Local work array passed to FFT: - T* localdataR; - - // Loop over the dimensions to be sine transformed: - begdim = (direction == +1) ? 0 : static_cast<int>(nTransformDims-1); - enddim = (direction == +1) ? static_cast<int>(nTransformDims) : -1; - for (idim = begdim; idim != enddim; idim+=direction) { - - // Now do the serial transforms along this dimension: - - bool skipTranspose = false; - // if this is the first transform dimension, we might be able - // to skip the transpose into the first temporary Field - if (idim == begdim) { - // get domain for comparison - const Domain_t& first_dom = tempRLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && - (in_dom[0].length() == first_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); - } - - // if this is the last transform dimension, we might be able - // to skip the last temporary and transpose right into f - if (idim == enddim-direction) { - // get the domain for comparison - const Domain_t& last_dom = tempRLayouts_m[idim]->getDomain(); - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(last_dom[0])) && - (in_dom[0].length() == last_dom[0].length()) && - (in_layout.getDistribution(0) == SERIAL) && - (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); - } - - if (!skipTranspose) { - // transpose and permute to Field with transform dim first - (*tempRFields_m[idim])[tempRLayouts_m[idim]->getDomain()] = - (*tempR)[tempR->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && tempR != &f) *tempR = 0; - tempR = tempRFields_m[idim]; // Field* management aid - } - else if (idim == enddim-direction && tempR != &f) { - // last transform and we can skip the last temporary field - // so do the transpose here using f instead - - // transpose and permute to Field with transform dim first - f[in_dom] = (*tempR)[tempR->getLayout().getDomain()]; - - // Compress out previous iterate's storage: - if (this->compressTemps() && tempR != &f) *tempR = 0; - tempR = &f; // Field* management aid - } - - - - // Loop over all the Vnodes, working on the LField in each. - typename RealField_t::const_iterator_if l_i, l_end = tempR->end_if(); - for (l_i = tempR->begin_if(); l_i != l_end; ++l_i) { - - // Get the LField - RealLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdataR = ldf->getP(); - - // Do 1D real-to-real FFT's on all the strips in the LField: - int nstrips = 1, length = ldf->size(0); - for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); - for (int istrip=0; istrip<nstrips; ++istrip) { - // Do the 1D FFT: - this->getEngine().callFFT(idim, direction, localdataR); - // advance the data pointer - localdataR += length; - } // loop over 1D strips - } // loop over all the LFields - - } // loop over all transformed dimensions - - // skip final assignment and compress if we used g as final temporary - if (tempR != &f) { - - // Now assign into output Field, and compress last temp's storage: - f[in_dom] = (*tempR)[tempR->getLayout().getDomain()]; - if (this->compressTemps()) *tempR = 0; - - } - - // Normalize: - if (direction == +1) f = f * this->getNormFact(); - - return; + // indicate we're doing another FFT + //INCIPPLSTAT(incFFTs); + + // Check domain of incoming Field + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); + + // Common loop iterate and other vars: + size_t d; + int idim; // idim loops over the number of transform dims. + int begdim, enddim; + size_t nTransformDims = this->numTransformDims(); + // check that there is no real-to-complex transform to do + PInsist(nTransformDims==numSineTransforms_m, + "Cannot perform real-to-complex transform in-place!!"); + + // do all the sine transforms + + // Field* management aid + RealField_t* tempR = &f; + // Local work array passed to FFT: + T* localdataR; + + // Loop over the dimensions to be sine transformed: + begdim = (direction == +1) ? 0 : static_cast<int>(nTransformDims-1); + enddim = (direction == +1) ? static_cast<int>(nTransformDims) : -1; + for (idim = begdim; idim != enddim; idim+=direction) { + + // Now do the serial transforms along this dimension: + + bool skipTranspose = false; + // if this is the first transform dimension, we might be able + // to skip the transpose into the first temporary Field + if (idim == begdim) { + // get domain for comparison + const Domain_t& first_dom = tempRLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) && + (in_dom[0].length() == first_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); + } + + // if this is the last transform dimension, we might be able + // to skip the last temporary and transpose right into f + if (idim == enddim-direction) { + // get the domain for comparison + const Domain_t& last_dom = tempRLayouts_m[idim]->getDomain(); + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(last_dom[0])) && + (in_dom[0].length() == last_dom[0].length()) && + (in_layout.getDistribution(0) == SERIAL) && + (f.getGC() == FFT<SineTransform,Dim,T>::nullGC) ); + } + + if (!skipTranspose) { + // transpose and permute to Field with transform dim first + (*tempRFields_m[idim])[tempRLayouts_m[idim]->getDomain()] = + (*tempR)[tempR->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && tempR != &f) *tempR = 0; + tempR = tempRFields_m[idim]; // Field* management aid + } + else if (idim == enddim-direction && tempR != &f) { + // last transform and we can skip the last temporary field + // so do the transpose here using f instead + + // transpose and permute to Field with transform dim first + f[in_dom] = (*tempR)[tempR->getLayout().getDomain()]; + + // Compress out previous iterate's storage: + if (this->compressTemps() && tempR != &f) *tempR = 0; + tempR = &f; // Field* management aid + } + + + + // Loop over all the Vnodes, working on the LField in each. + typename RealField_t::const_iterator_if l_i, l_end = tempR->end_if(); + for (l_i = tempR->begin_if(); l_i != l_end; ++l_i) { + + // Get the LField + RealLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdataR = ldf->getP(); + + // Do 1D real-to-real FFT's on all the strips in the LField: + int nstrips = 1, length = ldf->size(0); + for (d=1; d<Dim; ++d) nstrips *= ldf->size(d); + for (int istrip=0; istrip<nstrips; ++istrip) { + // Do the 1D FFT: + this->getEngine().callFFT(idim, direction, localdataR); + // advance the data pointer + localdataR += length; + } // loop over 1D strips + } // loop over all the LFields + + } // loop over all transformed dimensions + + // skip final assignment and compress if we used g as final temporary + if (tempR != &f) { + + // Now assign into output Field, and compress last temp's storage: + f[in_dom] = (*tempR)[tempR->getLayout().getDomain()]; + if (this->compressTemps()) *tempR = 0; + + } + + // Normalize: + if (direction == +1) f = f * this->getNormFact(); + + return; } @@ -4033,30 +3293,30 @@ FFT<SineTransform,Dim,T>::transform( template <class T> FFT<SineTransform,1U,T>::FFT( - const typename FFT<SineTransform,1U,T>::Domain_t& rdomain, - const bool sineTransformDims[1U], const bool& compressTemps) - : FFTBase<1U,T>(FFT<SineTransform,1U,T>::sineFFT, rdomain, - sineTransformDims, compressTemps) + const typename FFT<SineTransform,1U,T>::Domain_t& rdomain, + const bool sineTransformDims[1U], const bool& compressTemps) +: FFTBase<1U,T>(FFT<SineTransform,1U,T>::sineFFT, rdomain, + sineTransformDims, compressTemps) { - // Tau profiling + // Tau profiling - // get axis length - int length; - length = rdomain[0].length(); + // get axis length + int length; + length = rdomain[0].length(); - // get transform type for FFT Engine, compute normalization - int transformType; - transformType = FFTBase<1U,T>::sineFFT; // sine transform - T& normFact = this->getNormFact(); - normFact = 1.0 / (2.0 * (length + 1)); + // get transform type for FFT Engine, compute normalization + int transformType; + transformType = FFTBase<1U,T>::sineFFT; // sine transform + T& normFact = this->getNormFact(); + normFact = 1.0 / (2.0 * (length + 1)); - // set up FFT Engine - this->getEngine().setup(1U, &transformType, &length); - // set up the temporary fields - setup(); + // set up FFT Engine + this->getEngine().setup(1U, &transformType, &length); + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -4066,29 +3326,29 @@ FFT<SineTransform,1U,T>::FFT( template <class T> FFT<SineTransform,1U,T>::FFT( - const typename FFT<SineTransform,1U,T>::Domain_t& rdomain, - const bool& compressTemps) - : FFTBase<1U,T>(FFT<SineTransform,1U,T>::sineFFT, rdomain, compressTemps) + const typename FFT<SineTransform,1U,T>::Domain_t& rdomain, + const bool& compressTemps) +: FFTBase<1U,T>(FFT<SineTransform,1U,T>::sineFFT, rdomain, compressTemps) { - // Tau profiling + // Tau profiling - // get axis length - int length; - length = rdomain[0].length(); + // get axis length + int length; + length = rdomain[0].length(); - // get transform type for FFT Engine, compute normalization - int transformType; - transformType = FFTBase<1U,T>::sineFFT; // sine transform - T& normFact = this->getNormFact(); - normFact = 1.0 / (2.0 * (length + 1)); + // get transform type for FFT Engine, compute normalization + int transformType; + transformType = FFTBase<1U,T>::sineFFT; // sine transform + T& normFact = this->getNormFact(); + normFact = 1.0 / (2.0 * (length + 1)); - // set up FFT Engine - this->getEngine().setup(1U, &transformType, &length); - // set up the temporary fields - setup(); + // set up FFT Engine + this->getEngine().setup(1U, &transformType, &length); + // set up the temporary fields + setup(); } //----------------------------------------------------------------------------- @@ -4100,21 +3360,21 @@ template <class T> void FFT<SineTransform,1U,T>::setup(void) { - // Tau profiling + // Tau profiling - const Domain_t& domain = this->getDomain(); // get real Field domain + const Domain_t& domain = this->getDomain(); // get real Field domain - // generate temporary field layout - tempRLayouts_m = new Layout_t(domain[0], PARALLEL, 1); - // create temporary real Field - tempRFields_m = new RealField_t(*tempRLayouts_m); - // If user requests no intermediate compression, uncompress right now: - if (!this->compressTemps()) tempRFields_m->Uncompress(); + // generate temporary field layout + tempRLayouts_m = new Layout_t(domain[0], PARALLEL, 1); + // create temporary real Field + tempRFields_m = new RealField_t(*tempRLayouts_m); + // If user requests no intermediate compression, uncompress right now: + if (!this->compressTemps()) tempRFields_m->Uncompress(); - return; + return; } //----------------------------------------------------------------------------- @@ -4124,14 +3384,14 @@ FFT<SineTransform,1U,T>::setup(void) { template <class T> FFT<SineTransform,1U,T>::~FFT(void) { - // Tau profiling + // Tau profiling - // delete temporary field and layout - delete tempRFields_m; - delete tempRLayouts_m; + // delete temporary field and layout + delete tempRFields_m; + delete tempRLayouts_m; } //----------------------------------------------------------------------------- @@ -4141,103 +3401,103 @@ FFT<SineTransform,1U,T>::~FFT(void) { template <class T> void FFT<SineTransform,1U,T>::transform( - int direction, - FFT<SineTransform,1U,T>::RealField_t& f, - FFT<SineTransform,1U,T>::RealField_t& g, - const bool& constInput) + int direction, + FFT<SineTransform,1U,T>::RealField_t& f, + FFT<SineTransform,1U,T>::RealField_t& g, + const bool& constInput) { - // indicate we're doing another FFT - //INCIPPLSTAT(incFFTs); - - // Check domain of incoming Fields - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - const Layout_t& out_layout = g.getLayout(); - const Domain_t& out_dom = out_layout.getDomain(); - PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && - this->checkDomain(this->getDomain(),out_dom), true); - - // Field* management aid - RealField_t* tempR = &f; - // Local work array passed to FFT: - T* localdataR; - - - // Now do the serial transform along this dimension: - - // get the domain for comparison - const Domain_t& temp_dom = tempRLayouts_m->getDomain(); - bool skipTranspose = false; - // we might be able - // to skip the first temporary and just use f - if (!constInput) { + // indicate we're doing another FFT + //INCIPPLSTAT(incFFTs); + + // Check domain of incoming Fields + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + const Layout_t& out_layout = g.getLayout(); + const Domain_t& out_dom = out_layout.getDomain(); + PAssert_EQ( this->checkDomain(this->getDomain(),in_dom) && + this->checkDomain(this->getDomain(),out_dom), true); + + // Field* management aid + RealField_t* tempR = &f; + // Local work array passed to FFT: + T* localdataR; + + + // Now do the serial transform along this dimension: + + // get the domain for comparison + const Domain_t& temp_dom = tempRLayouts_m->getDomain(); + bool skipTranspose = false; + // we might be able + // to skip the first temporary and just use f + if (!constInput) { + // check that zeroth axis is the same, has one vnode + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(temp_dom[0])) && + (in_dom[0].length() == temp_dom[0].length()) && + (in_layout.numVnodes() == 1) && + (f.getGC() == FFT<SineTransform,1U,T>::nullGC) ); + } + + bool skipFinal = false; + // we might be able + // to skip the last temporary and transpose right into g + // check that zeroth axis is the same, has one vnode // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(temp_dom[0])) && - (in_dom[0].length() == temp_dom[0].length()) && - (in_layout.numVnodes() == 1) && - (f.getGC() == FFT<SineTransform,1U,T>::nullGC) ); - } - - bool skipFinal = false; - // we might be able - // to skip the last temporary and transpose right into g - - // check that zeroth axis is the same, has one vnode - // and that there are no guard cells - skipFinal = ( (out_dom[0].sameBase(temp_dom[0])) && - (out_dom[0].length() == temp_dom[0].length()) && - (out_layout.numVnodes() == 1) && - (g.getGC() == FFT<SineTransform,1U,T>::nullGC) ); - - if (!skipTranspose) { - // assign to Field with proper layout - (*tempRFields_m) = (*tempR); - tempR = tempRFields_m; // Field* management aid - } - if (skipFinal) { - // we can skip the last temporary field - // so do the transpose here using g instead - - // assign to Field with proper layout - g = (*tempR); + skipFinal = ( (out_dom[0].sameBase(temp_dom[0])) && + (out_dom[0].length() == temp_dom[0].length()) && + (out_layout.numVnodes() == 1) && + (g.getGC() == FFT<SineTransform,1U,T>::nullGC) ); - // Compress out previous iterate's storage: - if (this->compressTemps() && tempR != &f) *tempR = 0; - tempR = &g; // Field* management aid - } + if (!skipTranspose) { + // assign to Field with proper layout + (*tempRFields_m) = (*tempR); + tempR = tempRFields_m; // Field* management aid + } + if (skipFinal) { + // we can skip the last temporary field + // so do the transpose here using g instead + // assign to Field with proper layout + g = (*tempR); + // Compress out previous iterate's storage: + if (this->compressTemps() && tempR != &f) *tempR = 0; + tempR = &g; // Field* management aid + } - // There should be just one LField. - typename RealField_t::const_iterator_if l_i = tempR->begin_if(); - if (l_i != tempR->end_if()) { - // Get the LField - RealLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdataR = ldf->getP(); - // Do the 1D FFT: - this->getEngine().callFFT(0, direction, localdataR); - } + // There should be just one LField. + typename RealField_t::const_iterator_if l_i = tempR->begin_if(); + if (l_i != tempR->end_if()) { + // Get the LField + RealLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdataR = ldf->getP(); - // skip final assignment and compress if we used g as final temporary - if (tempR != &g) { + // Do the 1D FFT: + this->getEngine().callFFT(0, direction, localdataR); + } - // Now assign into output Field, and compress last temp's storage: - g = (*tempR); - if (this->compressTemps() && tempR != &f) *tempR = 0; - } + // skip final assignment and compress if we used g as final temporary + if (tempR != &g) { + + // Now assign into output Field, and compress last temp's storage: + g = (*tempR); + if (this->compressTemps() && tempR != &f) *tempR = 0; + + } - // Normalize: - if (direction == +1) g = g * this->getNormFact(); + // Normalize: + if (direction == +1) g = g * this->getNormFact(); - return; + return; } //----------------------------------------------------------------------------- @@ -4247,104 +3507,103 @@ FFT<SineTransform,1U,T>::transform( template <class T> void FFT<SineTransform,1U,T>::transform( - int direction, - FFT<SineTransform,1U,T>::RealField_t& f) + int direction, + FFT<SineTransform,1U,T>::RealField_t& f) { - // indicate we're doing another FFT - //INCIPPLSTAT(incFFTs); - - // Check domain of incoming Field - const Layout_t& in_layout = f.getLayout(); - const Domain_t& in_dom = in_layout.getDomain(); - PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); - - // Field* management aid - RealField_t* tempR = &f; - // Local work array passed to FFT: - T* localdataR; - - - // Now do the serial transform along this dimension: - - // get domain for comparison - const Domain_t& temp_dom = tempRLayouts_m->getDomain(); - bool skipTranspose = false; - // we might be able - // to skip the transpose into the first temporary Field - - // check that zeroth axis is the same and is serial - // and that there are no guard cells - skipTranspose = ( (in_dom[0].sameBase(temp_dom[0])) && - (in_dom[0].length() == temp_dom[0].length()) && - (in_layout.numVnodes() == 1) && - (f.getGC() == FFT<SineTransform,1U,T>::nullGC) ); - - bool skipFinal = false; - // we might be able - // to skip the last temporary and transpose right into f - - // check that zeroth axis is the same, has one vnode - // and that there are no guard cells - skipFinal = ( (in_dom[0].sameBase(temp_dom[0])) && - (in_dom[0].length() == temp_dom[0].length()) && - (in_layout.numVnodes() == 1) && - (f.getGC() == FFT<SineTransform,1U,T>::nullGC) ); - - if (!skipTranspose) { - // assign to Field with proper layout - (*tempRFields_m) = (*tempR); - - tempR = tempRFields_m; // Field* management aid - } - if (skipFinal) { - // we can skip the last temporary field - // so do the transpose here using f instead - - // assign to Field with proper layout - f = (*tempR); + // indicate we're doing another FFT + //INCIPPLSTAT(incFFTs); - // Compress out previous iterate's storage: - if (this->compressTemps() && tempR != &f) *tempR = 0; - tempR = &f; // Field* management aid - } + // Check domain of incoming Field + const Layout_t& in_layout = f.getLayout(); + const Domain_t& in_dom = in_layout.getDomain(); + PAssert_EQ(this->checkDomain(this->getDomain(),in_dom), true); + // Field* management aid + RealField_t* tempR = &f; + // Local work array passed to FFT: + T* localdataR; - // There should be just one LField. - typename RealField_t::const_iterator_if l_i = tempR->begin_if(); - if (l_i != tempR->end_if()) { + // Now do the serial transform along this dimension: - // Get the LField - RealLField_t* ldf = (*l_i).second.get(); - // make sure we are uncompressed - ldf->Uncompress(); - // get the raw data pointer - localdataR = ldf->getP(); + // get domain for comparison + const Domain_t& temp_dom = tempRLayouts_m->getDomain(); + bool skipTranspose = false; + // we might be able + // to skip the transpose into the first temporary Field - // Do the 1D FFT: - this->getEngine().callFFT(0, direction, localdataR); - } + // check that zeroth axis is the same and is serial + // and that there are no guard cells + skipTranspose = ( (in_dom[0].sameBase(temp_dom[0])) && + (in_dom[0].length() == temp_dom[0].length()) && + (in_layout.numVnodes() == 1) && + (f.getGC() == FFT<SineTransform,1U,T>::nullGC) ); + bool skipFinal = false; + // we might be able + // to skip the last temporary and transpose right into f - // skip final assignment and compress if we used g as final temporary - if (tempR != &f) { + // check that zeroth axis is the same, has one vnode + // and that there are no guard cells + skipFinal = ( (in_dom[0].sameBase(temp_dom[0])) && + (in_dom[0].length() == temp_dom[0].length()) && + (in_layout.numVnodes() == 1) && + (f.getGC() == FFT<SineTransform,1U,T>::nullGC) ); - // Now assign into output Field, and compress last temp's storage: - f = (*tempR); - if (this->compressTemps()) *tempR = 0; + if (!skipTranspose) { + // assign to Field with proper layout + (*tempRFields_m) = (*tempR); - } + tempR = tempRFields_m; // Field* management aid + } + if (skipFinal) { + // we can skip the last temporary field + // so do the transpose here using f instead - // Normalize: - if (direction == +1) f = f * this->getNormFact(); + // assign to Field with proper layout + f = (*tempR); + + // Compress out previous iterate's storage: + if (this->compressTemps() && tempR != &f) *tempR = 0; + tempR = &f; // Field* management aid + } - return; -} + // There should be just one LField. + typename RealField_t::const_iterator_if l_i = tempR->begin_if(); + if (l_i != tempR->end_if()) { + + // Get the LField + RealLField_t* ldf = (*l_i).second.get(); + // make sure we are uncompressed + ldf->Uncompress(); + // get the raw data pointer + localdataR = ldf->getP(); + + // Do the 1D FFT: + this->getEngine().callFFT(0, direction, localdataR); + } + + + // skip final assignment and compress if we used g as final temporary + if (tempR != &f) { + + // Now assign into output Field, and compress last temp's storage: + f = (*tempR); + if (this->compressTemps()) *tempR = 0; + + } + + // Normalize: + if (direction == +1) f = f * this->getNormFact(); + + return; +} -/*************************************************************************** - * $RCSfile: FFT.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $ - * IPPL_VERSION_ID: $Id: FFT.cpp,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ - ***************************************************************************/ \ No newline at end of file +// vi: set et ts=4 sw=4 sts=4: +// Local Variables: +// mode:c +// c-basic-offset: 4 +// indent-tabs-mode:nil +// End: diff --git a/ippl/src/FFT/FFTBase.h b/ippl/src/FFT/FFTBase.h index 6d51ce8d4c0f698c7431ccc3752db005f1d1709b..eddc59ebb48a39bacdbb09584cd7f532ec6016af 100644 --- a/ippl/src/FFT/FFTBase.h +++ b/ippl/src/FFT/FFTBase.h @@ -1,12 +1,12 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ +// +// IPPL FFT +// +// Copyright (c) 2008-2018 +// Paul Scherrer Institut, Villigen PSI, Switzerland +// All rights reserved. +// +// OPAL is licensed under GNU GPL version 3. +// //-------------------------------------------------------------------------- // Class FFTBase @@ -20,11 +20,7 @@ #include "Index/NDIndex.h" #include "Field/GuardCellSizes.h" -#if defined(IPPL_USE_SCSL_FFT) -#include "FFT/SCSL_FFT.h" -#else #include "FFT/fftpack_FFT.h" -#endif #include <map> #include <iostream> @@ -67,11 +63,7 @@ public: enum FFT_e { ccFFT, rcFFT, sineFFT, cosineFFT }; // Type used for performing 1D FFTs -#if defined(IPPL_USE_SCSL_FFT) - typedef SCSL<T> InternalFFT_t; -#else typedef FFTPACK<T> InternalFFT_t; -#endif FFTBase() {} @@ -308,9 +300,9 @@ FFTBase<Dim,T>::checkDomain(const FFTBase<Dim,T>::Domain_t& dom1, #endif // IPPL_FFT_FFTBASE_H -/*************************************************************************** - * $RCSfile: FFTBase.h,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $ - * IPPL_VERSION_ID: $Id: FFTBase.h,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ - ***************************************************************************/ - +// vi: set et ts=4 sw=4 sts=4: +// Local Variables: +// mode:c +// c-basic-offset: 4 +// indent-tabs-mode:nil +// End: diff --git a/ippl/src/FFT/FFTBase.hpp b/ippl/src/FFT/FFTBase.hpp index b5e64a0fa86c7361f5e14ff5a19b949d3cb52ef8..120a8c3e048f5042175361cb33ca1b3ce6ff289c 100644 --- a/ippl/src/FFT/FFTBase.hpp +++ b/ippl/src/FFT/FFTBase.hpp @@ -1,36 +1,19 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit www.amas.web.psi for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// include files +// +// IPPL FFT +// +// Copyright (c) 2008-2018 +// Paul Scherrer Institut, Villigen PSI, Switzerland +// All rights reserved. +// +// OPAL is licensed under GNU GPL version 3. +// + #include "FFT/FFTBase.h" #include "Utility/PAssert.h" /*************************************************************************** FFTBase.cpp: constructors and write() member function for FFTBase class - ***************************************************************************/ - +***************************************************************************/ // instantiate static null GC object template <unsigned Dim, class T> @@ -44,31 +27,29 @@ template <unsigned Dim, class T> FFTBase<Dim,T>::FFTBase(FFTBase<Dim,T>::FFT_e transform, const FFTBase<Dim,T>::Domain_t& domain, const bool transformTheseDims[Dim], bool compressTemps) - : transformType_m(transform), // transform type +: transformType_m(transform), // transform type Domain_m(domain), // field domain compressTempFields_m(compressTemps) // compress temp fields? { - // Tau profiling + // Tau profiling - - - // Store which dims are transformed, and count up how many there are - nTransformDims_m = 0; - unsigned d; - for (d=0; d<Dim; ++d) { - transformDims_m[d] = transformTheseDims[d]; - if (transformTheseDims[d]) ++nTransformDims_m; - } - - // check that at least one dimension is being transformed - PInsist(nTransformDims_m>0,"Must transform at least one axis!!"); - - // Store the "names" (0,1,2) of these dims in an array of computed size - activeDims_m = new unsigned[nTransformDims_m]; - int icount = 0; - for (d=0; d<Dim; ++d) - if (transformDims_m[d]) activeDims_m[icount++] = d; + // Store which dims are transformed, and count up how many there are + nTransformDims_m = 0; + unsigned d; + for (d=0; d<Dim; ++d) { + transformDims_m[d] = transformTheseDims[d]; + if (transformTheseDims[d]) ++nTransformDims_m; + } + + // check that at least one dimension is being transformed + PInsist(nTransformDims_m>0,"Must transform at least one axis!!"); + + // Store the "names" (0,1,2) of these dims in an array of computed size + activeDims_m = new unsigned[nTransformDims_m]; + int icount = 0; + for (d=0; d<Dim; ++d) + if (transformDims_m[d]) activeDims_m[icount++] = d; } @@ -76,22 +57,20 @@ template <unsigned Dim, class T> FFTBase<Dim,T>::FFTBase(FFTBase<Dim,T>::FFT_e transform, const FFTBase<Dim,T>::Domain_t& domain, bool compressTemps) - : transformType_m(transform), // transform type +: transformType_m(transform), // transform type Domain_m(domain), // field domain compressTempFields_m(compressTemps) // compress temp fields? { - // Tau profiling - - + // Tau profiling - // Default, transform all dims: - nTransformDims_m = Dim; - activeDims_m = new unsigned[Dim]; - for (unsigned d=0; d<Dim; d++) { - transformDims_m[d] = true; - activeDims_m[d] = d; - } + // Default, transform all dims: + nTransformDims_m = Dim; + activeDims_m = new unsigned[Dim]; + for (unsigned d=0; d<Dim; d++) { + transformDims_m[d] = true; + activeDims_m[d] = d; + } } @@ -102,38 +81,36 @@ FFTBase<Dim,T>::FFTBase(FFTBase<Dim,T>::FFT_e transform, template <unsigned Dim, class T> void FFTBase<Dim,T>::write(std::ostream& out) const { - // Tau profiling - + // Tau profiling - - // Dump contents of FFT object - out << "---------------FFT Object Dump Begin-------------------" << std::endl; - // Output the user-defined names for transform directions: - out << "Map of transform direction names:" << std::endl; - std::map<char*,unsigned>::const_iterator mi, m_end = directions_m.end(); - for (mi = directions_m.begin(); mi != m_end; ++mi) - out << "[" << (*mi).first << "," << (*mi).second << "]" << std::endl; - // Output type of transform - out << "Transform type = " << getTransformType(transformType_m) << std::endl; - // Output which dims are transformed: - out << "Transform dimensions: "; - for (unsigned d=0; d<Dim; ++d) { - out << "dim " << d << " = "; - if (transformDims_m[d]) - out << "true" << std::endl; - else - out << "false" << std::endl; - } - out << std::endl; - out << "Input Field domain = " << Domain_m << std::endl; // Output the domain. - out << "---------------FFT Object Dump End---------------------" << std::endl; - - return; + // Dump contents of FFT object + out << "---------------FFT Object Dump Begin-------------------" << std::endl; + // Output the user-defined names for transform directions: + out << "Map of transform direction names:" << std::endl; + std::map<char*,unsigned>::const_iterator mi, m_end = directions_m.end(); + for (mi = directions_m.begin(); mi != m_end; ++mi) + out << "[" << (*mi).first << "," << (*mi).second << "]" << std::endl; + // Output type of transform + out << "Transform type = " << getTransformType(transformType_m) << std::endl; + // Output which dims are transformed: + out << "Transform dimensions: "; + for (unsigned d=0; d<Dim; ++d) { + out << "dim " << d << " = "; + if (transformDims_m[d]) + out << "true" << std::endl; + else + out << "false" << std::endl; + } + out << std::endl; + out << "Input Field domain = " << Domain_m << std::endl; // Output the domain. + out << "---------------FFT Object Dump End---------------------" << std::endl; + + return; } - -/*************************************************************************** - * $RCSfile: FFTBase.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $ - * IPPL_VERSION_ID: $Id: FFTBase.cpp,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ - ***************************************************************************/ +// vi: set et ts=4 sw=4 sts=4: +// Local Variables: +// mode:c +// c-basic-offset: 4 +// indent-tabs-mode:nil +// End: diff --git a/ippl/src/FFT/SCSL_FFT.F b/ippl/src/FFT/SCSL_FFT.F deleted file mode 100644 index 357436468e267c9f43c4e237e893051314a8d49b..0000000000000000000000000000000000000000 --- a/ippl/src/FFT/SCSL_FFT.F +++ /dev/null @@ -1,93 +0,0 @@ -c======================================================================== -c -c The IPPL Framework -c -c This program was prepared by the Regents of the University of -c Visit http://people.web.psi.ch/adelmann/ for more details -c -c======================================================================== - -c======================================================================== -c=========================SCSL_FFT.F===================================== -c======================================================================== -c I'm adding some Fortran wrappers around SGI/Cray Scientific Library -c routines, so we can call them from C++ code -c======================================================================== - - -c The Cray T3E does not have double-precision versions of these -c routines, since its routines are double-precision by default. - -#ifndef IPPL_T3E - - subroutine sgizzfft(isign,n,scale,x,y,table,work,isys) -c------------------------------------------------------------------------ - implicit double precision (a-h,o-z) - implicit integer (i-n) -c------------------------------------------------------------------------ - dimension x(*), y(*), table(*), work(*) - call zzfft(isign,n,scale,x,y,table,work,isys) - return - end - - subroutine sgidzfft(isign,n,scale,x,y,table,work,isys) -c------------------------------------------------------------------------ - implicit double precision (a-h,o-z) - implicit integer (i-n) -c------------------------------------------------------------------------ - dimension x(*), y(*), table(*), work(*) - call dzfft(isign,n,scale,x,y,table,work,isys) - return - end - - subroutine sgizdfft(isign,n,scale,x,y,table,work,isys) -c------------------------------------------------------------------------ - implicit double precision (a-h,o-z) - implicit integer (i-n) -c------------------------------------------------------------------------ - dimension x(*), y(*), table(*), work(*) - call zdfft(isign,n,scale,x,y,table,work,isys) - return - end - -#endif - - -c Single-precision routines - - subroutine sgiccfft(isign,n,scale,x,y,table,work,isys) -c------------------------------------------------------------------------ - implicit real (a-h,o-z) - implicit integer (i-n) -c------------------------------------------------------------------------ - dimension x(*), y(*), table(*), work(*) - call ccfft(isign,n,scale,x,y,table,work,isys) - return - end - - subroutine sgiscfft(isign,n,scale,x,y,table,work,isys) -c------------------------------------------------------------------------ - implicit real (a-h,o-z) - implicit integer (i-n) -c------------------------------------------------------------------------ - dimension x(*), y(*), table(*), work(*) - call scfft(isign,n,scale,x,y,table,work,isys) - return - end - - subroutine sgicsfft(isign,n,scale,x,y,table,work,isys) -c------------------------------------------------------------------------ - implicit real (a-h,o-z) - implicit integer (i-n) -c------------------------------------------------------------------------ - dimension x(*), y(*), table(*), work(*) - call csfft(isign,n,scale,x,y,table,work,isys) - return - end - - -c======================================================================== -c $RCSfile: SCSL_FFT.F,v $ $Author: adelmann $ -c $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $ -c IPPL_VERSION_ID: $Id: SCSL_FFT.F,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ -c======================================================================== diff --git a/ippl/src/FFT/SCSL_FFT.h b/ippl/src/FFT/SCSL_FFT.h deleted file mode 100644 index 690447b39c36c1bc793b7193d688a26251a829ff..0000000000000000000000000000000000000000 --- a/ippl/src/FFT/SCSL_FFT.h +++ /dev/null @@ -1,359 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -#ifndef IPPL_FFT_SCSL_FFT_H -#define IPPL_FFT_SCSL_FFT_H - -// include files -#include "Utility/PAssert.h" -#include "Utility/IpplInfo.h" - - -/************************************************************************** - * SCSL_FFT.h: Prototypes for accessing Fortran 1D FFT routines from the - * SGI/Cray Scientific Library, and definitions for templated class SCSL, - * which acts as an FFT engine for the FFT class, providing storage for - * trigonometric information and performing the 1D FFTs as needed. - **************************************************************************/ - - -// For platforms that do Fortran symbols in all caps. -#if defined(IPPL_T3E) - -#define sgiccfft_ SGICCFFT -#define sgiscfft_ SGISCFFT -#define sgicsfft_ SGICSFFT - -#endif - -// SCSL Fortran wrapper function prototypes -// These functions are defined in file SCSL_FFT.F, and they just turn -// around and call the native library routines. - -#if defined(IPPL_T3E) - -// Cray T3E has only "real" routines, which are automatically double precision -extern "C" { - // double-precision CC FFT - void sgiccfft_(int& isign, int& n, double& scale, double& x, double& y, - double& table, double& work, int& isys); - // double-precision RC FFT - void sgiscfft_(int& isign, int& n, double& scale, double& x, double& y, - double& table, double& work, int& isys); - // double-precision CR FFT - void sgicsfft_(int& isign, int& n, double& scale, double& x, double& y, - double& table, double& work, int& isys); -} - -#else - -// SGI offers separate single- and double-precision routines -extern "C" { - // double-precision CC FFT - void sgizzfft_(int& isign, int& n, double& scale, double& x, double& y, - double& table, double& work, int& isys); - // double-precision RC FFT - void sgidzfft_(int& isign, int& n, double& scale, double& x, double& y, - double& table, double& work, int& isys); - // double-precision CR FFT - void sgizdfft_(int& isign, int& n, double& scale, double& x, double& y, - double& table, double& work, int& isys); - // single-precision CC FFT - void sgiccfft_(int& isign, int& n, float& scale, float& x, float& y, - float& table, float& work, int& isys); - // single-precision RC FFT - void sgiscfft_(int& isign, int& n, float& scale, float& x, float& y, - float& table, float& work, int& isys); - // single-precision CR FFT - void sgicsfft_(int& isign, int& n, float& scale, float& x, float& y, - float& table, float& work, int& isys); -} - -#endif // defined(IPPL_T3E) - - -// SCSL_wrap provides static functions that wrap the Fortran functions -// in a common interface. We specialize this class on precision type. -template <class T> -class SCSL_wrap {}; - -// Specialization for float -template <> -class SCSL_wrap<float> { - -public: - // interface functions used by class SCSL - - // complex-to-complex FFT - static void ccfft(int isign, int n, float scale, float* x, float* y, - float* table, float* work, int isys) { - sgiccfft_(isign, n, scale, *x, *y, *table, *work, isys); - } - // real-to-complex FFT - static void rcfft(int isign, int n, float scale, float* x, float* y, - float* table, float* work, int isys) { - sgiscfft_(isign, n, scale, *x, *y, *table, *work, isys); - } - // complex-to-real FFT - static void crfft(int isign, int n, float scale, float* x, float* y, - float* table, float* work, int isys) { - sgicsfft_(isign, n, scale, *x, *y, *table, *work, isys); - } - -}; - - -// Specialization for double - -#if defined(IPPL_T3E) - -// Cray T3E uses single-precision function names for double-precision FFTs -template <> -class SCSL_wrap<double> { - -public: - // interface functions used by class SCSL - - // complex-to-complex FFT - static void ccfft(int isign, int n, double scale, double* x, double* y, - double* table, double* work, int isys) { - sgiccfft_(isign, n, scale, *x, *y, *table, *work, isys); - } - // real-to-complex FFT - static void rcfft(int isign, int n, double scale, double* x, double* y, - double* table, double* work, int isys) { - sgiscfft_(isign, n, scale, *x, *y, *table, *work, isys); - } - // complex-to-real FFT - static void crfft(int isign, int n, double scale, double* x, double* y, - double* table, double* work, int isys) { - sgicsfft_(isign, n, scale, *x, *y, *table, *work, isys); - } - -}; - -#else - -// SGI has special FFT routines for double-precision -template <> -class SCSL_wrap<double> { - -public: - // interface functions used by class SCSL - - // complex-to-complex FFT - static void ccfft(int isign, int n, double scale, double* x, double* y, - double* table, double* work, int isys) { - sgizzfft_(isign, n, scale, *x, *y, *table, *work, isys); - } - // real-to-complex FFT - static void rcfft(int isign, int n, double scale, double* x, double* y, - double* table, double* work, int isys) { - sgidzfft_(isign, n, scale, *x, *y, *table, *work, isys); - } - // complex-to-real FFT - static void crfft(int isign, int n, double scale, double* x, double* y, - double* table, double* work, int isys) { - sgizdfft_(isign, n, scale, *x, *y, *table, *work, isys); - } - -}; - -#endif // defined(IPPL_T3E) - - -// Definition of FFT engine class SCSL -template <class T> -class SCSL { - -public: - - // definition of complex type - typedef complex<T> Complex_t; - - // Trivial constructor. Do the real work in setup function. - SCSL(void) {} - - // destructor - ~SCSL(void); - - // setup internal storage and prepare to do FFTs - void setup(unsigned numTransformDims, const int* transformTypes, - const int* axisLengths); - - // invoke FFT on complex data for given dimension and direction - void callFFT(unsigned transformDim, int direction, Complex_t* data); - - // invoke FFT on real data for given dimension and direction - void callFFT(unsigned transformDim, int direction, T* data); - -private: - - unsigned numTransformDims_m; // number of dimensions to transform - int* transformType_m; // type of transform for each dimension - int* axisLength_m; // length along each dimension - T** table_m; // tables of trigonometric factors - T** work_m; // workspace arrays - -}; - - -// Inline member function definitions - -// destructor -template <class T> -inline -SCSL<T>::~SCSL(void) { - // delete storage - for (unsigned d=0; d<numTransformDims_m; ++d) { - delete [] table_m[d]; - delete [] work_m[d]; - } - delete [] table_m; - delete [] work_m; - delete [] transformType_m; - delete [] axisLength_m; -} - -// setup internal storage and prepare for doing FFTs -template <class T> -inline void -SCSL<T>::setup(unsigned numTransformDims, const int* transformTypes, - const int* axisLengths) { - - // store transform types and lengths for each transform dim - numTransformDims_m = numTransformDims; - transformType_m = new int[numTransformDims_m]; - axisLength_m = new int[numTransformDims_m]; - unsigned d; - for (d=0; d<numTransformDims_m; ++d) { - transformType_m[d] = transformTypes[d]; - axisLength_m[d] = axisLengths[d]; - } - - // allocate trig table and workspace arrays and initialize table - // table and work array sizes vary for the Cray T3E and the SGI Origin 2000 - table_m = new T*[numTransformDims_m]; - work_m = new T*[numTransformDims_m]; - T dummy = T(); - for (d=0; d<numTransformDims_m; ++d) { - switch (transformType_m[d]) { - case 0: // CC FFT -#if defined(IPPL_T3E) - table_m[d] = new T[2 * axisLength_m[d]]; - work_m[d] = new T[4 * axisLength_m[d]]; -#else - table_m[d] = new T[2 * axisLength_m[d] + 30]; - work_m[d] = new T[2 * axisLength_m[d]]; -#endif - // this call initializes table - SCSL_wrap<T>::ccfft(0, axisLength_m[d], dummy, &dummy, &dummy, - table_m[d], &dummy, 0); - break; - case 1: // RC FFT -#if defined(IPPL_T3E) - table_m[d] = new T[2 * axisLength_m[d]]; - work_m[d] = new T[2 * (axisLength_m[d] + 2)]; // extend length by two -#else - table_m[d] = new T[axisLength_m[d] + 15]; - work_m[d] = new T[axisLength_m[d] + 2]; // extend length by two reals -#endif - // this call initializes table - SCSL_wrap<T>::rcfft(0, axisLength_m[d], dummy, &dummy, &dummy, - table_m[d], &dummy, 0); - break; - case 2: // Sine transform - ERRORMSG("No sine transforms available in SCSL!!" << endl); - break; - default: - ERRORMSG("Unknown transform type requested!!" << endl); - break; - } - } - - return; -} - -// invoke FFT on complex data for given dimension and direction -template <class T> -inline void -SCSL<T>::callFFT(unsigned transformDim, int direction, - SCSL<T>::Complex_t* data) { - - // check transform dimension and direction arguments - PAssert_LT(transformDim, numTransformDims_m); - PAssert_EQ(std::abs(direction), 1); - - // cast complex number pointer to T* for calling Fortran routines - T* rdata = reinterpret_cast<T*>(data); - - // branch on type of transform for this dimension - switch (transformType_m[transformDim]) { - case 0: // CC FFT - SCSL_wrap<T>::ccfft(direction, axisLength_m[transformDim], 1.0, rdata, - rdata, table_m[transformDim], work_m[transformDim], 0); - break; - case 1: // RC FFT - if (direction == +1) { // real-to-complex - SCSL_wrap<T>::rcfft(+1, axisLength_m[transformDim], 1.0, rdata, rdata, - table_m[transformDim], work_m[transformDim], 0); - } - else { // complex-to-real - SCSL_wrap<T>::crfft(-1, axisLength_m[transformDim], 1.0, rdata, rdata, - table_m[transformDim], work_m[transformDim], 0); - } - break; - case 2: // Sine transform - ERRORMSG("No sine transforms available in SCSL!!" << endl); - break; - default: - ERRORMSG("Unknown transform type requested!!" << endl); - break; - } - - return; -} - - -// invoke FFT on real data for given dimension and direction -template <class T> -inline void -SCSL<T>::callFFT(unsigned transformDim, int direction, T* data) { - - // check transform dimension argument - PAssert_LT(transformDim, numTransformDims_m); - // branch on transform type for this dimension - switch (transformType_m[transformDim]) { - case 0: // CC FFT - ERRORMSG("complex-to-complex FFT uses complex data!!" << endl); - break; - case 1: // RC FFT - ERRORMSG("real-to-complex FFT uses complex data!!" << endl); - break; - case 2: // Sine transform - ERRORMSG("No sine transforms available in SCSL!!" << endl); - break; - default: - ERRORMSG("Unknown transform type requested!!" << endl); - break; - } - - return; -} - - -#endif // IPPL_FFT_SCSL_FFT_H - -/*************************************************************************** - * $RCSfile: SCSL_FFT.h,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $ - * IPPL_VERSION_ID: $Id: SCSL_FFT.h,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ - ***************************************************************************/ - diff --git a/ippl/src/FFT/c_utils.c b/ippl/src/FFT/c_utils.c deleted file mode 100644 index 30255557d4e433d7bb77e7317e1d4138882cd0aa..0000000000000000000000000000000000000000 --- a/ippl/src/FFT/c_utils.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright (c) 2008-2011, Max-Planck-Society -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 in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Max-Planck-Society 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 MAX-PLANCK-SOCIETY 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. -*/ - -/* - * libc_utils is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Convenience functions - * - * Author: Martin Reinecke - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "c_utils.h" - -void util_fail_ (const char *file, int line, const char *func, const char *msg) - { - fprintf(stderr,"%s, %i (%s):\n%s\n",file,line,func,msg); - exit(1); - } -void util_warn_ (const char *file, int line, const char *func, const char *msg) - { - fprintf(stderr,"%s, %i (%s):\n%s\n",file,line,func,msg); - exit(1); - } - -void *util_malloc_ (size_t sz) - { - void *res; - if (sz==0) return NULL; - res = malloc(sz); - UTIL_ASSERT(res,"malloc() failed"); - return res; - } -void util_free_ (void *ptr) - { if ((ptr)!=NULL) free(ptr); } diff --git a/ippl/src/FFT/c_utils.h b/ippl/src/FFT/c_utils.h deleted file mode 100644 index a42915e4754022efda87a9716d1fe81f2f6b2374..0000000000000000000000000000000000000000 --- a/ippl/src/FFT/c_utils.h +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright (c) 2008-2011, Max-Planck-Society -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 in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Max-Planck-Society 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 MAX-PLANCK-SOCIETY 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. -*/ - -/* - * libc_utils is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file c_utils.h - * Convenience functions - * - * \author Martin Reinecke - * \note This file should only be included from .c files, NOT from .h files. - */ - -#ifndef PLANCK_C_UTILS_H -#define PLANCK_C_UTILS_H - -#include <math.h> -#include <stdlib.h> -#include <stddef.h> - -#ifdef __cplusplus -extern "C" { -#endif - -void util_fail_ (const char *file, int line, const char *func, const char *msg); -void util_warn_ (const char *file, int line, const char *func, const char *msg); -void *util_malloc_ (size_t sz); -void util_free_ (void *ptr); - -void announce_c (const char *name); -void module_startup_c (const char *name, int argc, int argc_expected, - const char *argv_expected, int verbose); - -#if defined (__GNUC__) -#define UTIL_FUNC_NAME__ __func__ -#else -#define UTIL_FUNC_NAME__ "unknown" -#endif - -#define UTIL_ASSERT(cond,msg) \ - if(!(cond)) util_fail_(__FILE__,__LINE__,UTIL_FUNC_NAME__,msg) -#define UTIL_WARN(cond,msg) \ - if(!(cond)) util_warn_(__FILE__,__LINE__,UTIL_FUNC_NAME__,msg) -#define UTIL_FAIL(msg) \ - util_fail_(__FILE__,__LINE__,UTIL_FUNC_NAME__,msg) - -#define ALLOC(ptr,type,num) \ - do { (ptr)=(type *)util_malloc_((num)*sizeof(type)); } while (0) -#define RALLOC(type,num) \ - ((type *)util_malloc_((num)*sizeof(type))) -#define DEALLOC(ptr) \ - do { util_free_(ptr); (ptr)=NULL; } while(0) -#define RESIZE(ptr,type,num) \ - do { util_free_(ptr); ALLOC(ptr,type,num); } while(0) -#define REALLOC(ptr,type,num) \ - do { \ - ptr = (type *)realloc(ptr,(num)*sizeof(type)); \ - UTIL_ASSERT(ptr,"realloc() failed"); \ - } while(0) -#define GROW(ptr,type,sz_old,sz_new) \ - do { \ - if ((sz_new)>(sz_old)) \ - { RESIZE(ptr,type,2*(sz_new));sz_old=2*(sz_new); } \ - } while(0) -#define SET_ARRAY(ptr,i1,i2,val) \ - do { \ - ptrdiff_t cnt_; \ - for (cnt_=(i1);cnt_<(i2);++cnt_) (ptr)[cnt_]=(val); \ - } while(0) -#define COPY_ARRAY(src,dest,i1,i2) \ - do { \ - ptrdiff_t cnt_; \ - for (cnt_=(i1);cnt_<(i2);++cnt_) (dest)[cnt_]=(src)[cnt_]; \ - } while(0) - -#define ALLOC2D(ptr,type,num1,num2) \ - do { \ - size_t cnt_, num1_=(num1), num2_=(num2); \ - ALLOC(ptr,type *,num1_); \ - ALLOC(ptr[0],type,num1_*num2_); \ - for (cnt_=1; cnt_<num1_; ++cnt_) \ - ptr[cnt_]=ptr[cnt_-1]+num2_; \ - } while(0) -#define DEALLOC2D(ptr) \ - do { if(ptr) DEALLOC((ptr)[0]); DEALLOC(ptr); } while(0) - -#define FAPPROX(a,b,eps) \ - (fabs((a)-(b))<((eps)*fabs(b))) -#define ABSAPPROX(a,b,eps) \ - (fabs((a)-(b))<(eps)) -#define IMAX(a,b) \ - (((a)>(b)) ? (a) : (b)) -#define IMIN(a,b) \ - (((a)<(b)) ? (a) : (b)) - -#define SWAP(a,b,type) \ - do { type tmp_=(a); (a)=(b); (b)=tmp_; } while(0) - -#define CHECK_STACK_ALIGN(align) \ - do { \ - double foo; \ - UTIL_WARN((((size_t)(&foo))&(align-1))==0, \ - "WARNING: stack not sufficiently aligned!"); \ - } while(0) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ippl/src/FFT/f2c.h b/ippl/src/FFT/f2c.h deleted file mode 100644 index 0eb44f12da07b73ad8041327c1529e6bddab7b6c..0000000000000000000000000000000000000000 --- a/ippl/src/FFT/f2c.h +++ /dev/null @@ -1,245 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit www.amas.web.psi for more details - * - ***************************************************************************/ - -/* f2c.h -- Standard Fortran to C header file */ - -/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." - - - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ - -#ifndef F2C_INCLUDE -#define F2C_INCLUDE - -typedef long int integer; -typedef unsigned long uinteger; -typedef char *address; -typedef short int shortint; -typedef float real; -typedef double doublereal; -typedef struct { real r, i; } complex; -typedef struct { doublereal r, i; } doublecomplex; -typedef long int logical; -typedef short int shortlogical; -typedef char logical1; -typedef char integer1; -#if 0 /* Adjust for integer*8. */ -typedef long long longint; /* system-dependent */ -typedef unsigned long long ulongint; /* system-dependent */ -#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) -#define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) -#endif - -#define TRUE_ (1) -#define FALSE_ (0) - -/* Extern is for use with -E */ -#ifndef Extern -#define Extern extern -#endif - -/* I/O stuff */ - -#ifdef f2c_i2 -/* for -i2 */ -typedef short flag; -typedef short ftnlen; -typedef short ftnint; -#else -typedef long int flag; -typedef long int ftnlen; -typedef long int ftnint; -#endif - -/*external read, write*/ -typedef struct -{ flag cierr; - ftnint ciunit; - flag ciend; - char *cifmt; - ftnint cirec; -} cilist; - -/*internal read, write*/ -typedef struct -{ flag icierr; - char *iciunit; - flag iciend; - char *icifmt; - ftnint icirlen; - ftnint icirnum; -} icilist; - -/*open*/ -typedef struct -{ flag oerr; - ftnint ounit; - char *ofnm; - ftnlen ofnmlen; - char *osta; - char *oacc; - char *ofm; - ftnint orl; - char *oblnk; -} olist; - -/*close*/ -typedef struct -{ flag cerr; - ftnint cunit; - char *csta; -} cllist; - -/*rewind, backspace, endfile*/ -typedef struct -{ flag aerr; - ftnint aunit; -} alist; - -/* inquire */ -typedef struct -{ flag inerr; - ftnint inunit; - char *infile; - ftnlen infilen; - ftnint *inex; /*parameters in standard's order*/ - ftnint *inopen; - ftnint *innum; - ftnint *innamed; - char *inname; - ftnlen innamlen; - char *inacc; - ftnlen inacclen; - char *inseq; - ftnlen inseqlen; - char *indir; - ftnlen indirlen; - char *infmt; - ftnlen infmtlen; - char *inform; - ftnint informlen; - char *inunf; - ftnlen inunflen; - ftnint *inrecl; - ftnint *innrec; - char *inblank; - ftnlen inblanklen; -} inlist; - -#define VOID void - -union Multitype { /* for multipple entry points */ - integer1 g; - shortint h; - integer i; - /* longint j; */ - real r; - doublereal d; - complex c; - doublecomplex z; - }; - -typedef union Multitype Multitype; - -/*typedef long int Long;*/ /* No longer used; formerly in Namelist */ - -struct Vardesc { /* for Namelist */ - char *name; - char *addr; - ftnlen *dims; - int type; - }; -typedef struct Vardesc Vardesc; - -struct Namelist { - char *name; - Vardesc **vars; - int nvars; - }; -typedef struct Namelist Namelist; - -#define abs(x) ((x) >= 0 ? (x) : -(x)) -#define dabs(x) (doublereal)abs(x) -#define min(a,b) ((a) <= (b) ? (a) : (b)) -#define max(a,b) ((a) >= (b) ? (a) : (b)) -#define dmin(a,b) (doublereal)min(a,b) -#define dmax(a,b) (doublereal)max(a,b) -#define bit_test(a,b) ((a) >> (b) & 1) -#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) -#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) - -/* procedure parameter types for -A and -C++ */ - -#define F2C_proc_par_types 1 -#ifdef __cplusplus -typedef int /* Unknown procedure type */ (*U_fp)(...); -typedef shortint (*J_fp)(...); -typedef integer (*I_fp)(...); -typedef real (*R_fp)(...); -typedef doublereal (*D_fp)(...), (*E_fp)(...); -typedef /* Complex */ VOID (*C_fp)(...); -typedef /* Double Complex */ VOID (*Z_fp)(...); -typedef logical (*L_fp)(...); -typedef shortlogical (*K_fp)(...); -typedef /* Character */ VOID (*H_fp)(...); -typedef /* Subroutine */ int (*S_fp)(...); -#else -typedef int /* Unknown procedure type */ (*U_fp)(); -typedef shortint (*J_fp)(); -typedef integer (*I_fp)(); -typedef real (*R_fp)(); -typedef doublereal (*D_fp)(), (*E_fp)(); -typedef /* Complex */ VOID (*C_fp)(); -typedef /* Double Complex */ VOID (*Z_fp)(); -typedef logical (*L_fp)(); -typedef shortlogical (*K_fp)(); -typedef /* Character */ VOID (*H_fp)(); -typedef /* Subroutine */ int (*S_fp)(); -#endif -/* E_fp is for real functions when -R is not specified */ -typedef VOID C_f; /* complex function */ -typedef VOID H_f; /* character function */ -typedef VOID Z_f; /* double complex function */ -typedef doublereal E_f; /* real function with -R not specified */ - -/* undef any lower-case symbols that your C compiler predefines, e.g.: */ - -#ifndef Skip_f2c_Undefs -#undef cray -#undef gcos -#undef mc68010 -#undef mc68020 -#undef mips -#undef pdp11 -#undef sgi -#undef sparc -#undef sun -#undef sun2 -#undef sun3 -#undef sun4 -#undef u370 -#undef u3b -#undef u3b2 -#undef u3b5 -#undef unix -#undef vax -#endif -#endif - -/*************************************************************************** - * $RCSfile: addheaderfooter,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:17 $ - * IPPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $ - ***************************************************************************/ - diff --git a/ippl/src/FFT/fftpack.F b/ippl/src/FFT/fftpack.F deleted file mode 100644 index c47c95de3ca2760231ef16fa9a808344df097898..0000000000000000000000000000000000000000 --- a/ippl/src/FFT/fftpack.F +++ /dev/null @@ -1,3957 +0,0 @@ -c======================================================================== -c -c The IPPL Framework -c -c This program was prepared by the Regents of the University of -c Visit http://people.web.psi.ch/adelmann/ for more details -c -c======================================================================== - -c======================================================================= -c============================fftpack.F================================== -c=============contains routines rffti, rfftf, rfftf,==================== -c==========cffti, cfftf, cfftb, sinti, and sint (from Netlib)=========== -c======================================================================= - -c Cray machines do not support double precision type. Use real. - -#if defined(IPPL_T3E) -#define FLOAT REAL -#else -#define FLOAT DOUBLE PRECISION -#endif - -c---------------------------DOUBLE PRECISION---------------------------- - subroutine rffti (n,wsave) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wsave(*) - if (n .eq. 1) return - call rffti1 (n,wsave(n+1),wsave(2*n+1)) - return - end - - - subroutine rffti1 (n,wa,xxifac) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wa(*) ,xxifac(*) ,ntryh(4) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - data ntryh(1),ntryh(2),ntryh(3),ntryh(4)/4,2,3,5/ - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nl = n - nf = 0 - j = 0 - 101 j = j+1 - if (j-4) 102,102,103 - 102 ntry = ntryh(j) - go to 104 - 103 ntry = ntry+2 - 104 nq = nl/ntry - nr = nl-ntry*nq - if (nr) 101,105,101 - 105 nf = nf+1 - jfac(nf+2) = ntry - nl = nq - if (ntry .ne. 2) go to 107 - if (nf .eq. 1) go to 107 - do 106 i=2,nf - ib = nf-i+2 - jfac(ib+2) = jfac(ib+1) - 106 continue - jfac(3) = 2 - 107 if (nl .ne. 1) go to 104 - jfac(1) = n - jfac(2) = nf - tpi = 6.28318530717959 - argh = tpi/float(n) - is = 0 - nfm1 = nf-1 - l1 = 1 - if (nfm1 .eq. 0) return - do 110 k1=1,nfm1 - ip = jfac(k1+2) - ld = 0 - l2 = l1*ip - ido = n/l2 - ipm = ip-1 - do 109 j=1,ipm - ld = ld+l1 - i = is - argld = float(ld)*argh - fi = 0. - do 108 ii=3,ido,2 - i = i+2 - fi = fi+1. - arg = fi*argld - wa(i-1) = cos(arg) - wa(i) = sin(arg) - 108 continue - is = is+ido - 109 continue - l1 = l2 - 110 continue - do 111 i = 1, 15 - xxifac(i) = rfac(i) - 111 continue - return - end - - - - subroutine rfftf (n,r,wsave) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension r(*) ,wsave(*) - if (n .eq. 1) return - call rfftf1 (n,r,wsave,wsave(n+1),wsave(2*n+1)) - return - end - subroutine rfftf1 (n,c,ch,wa,xxifac) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(*) ,c(*) ,wa(*) ,xxifac(*) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nf = jfac(2) - na = 1 - l2 = n - iw = n - do 111 k1=1,nf - kh = nf-k1 - ip = jfac(kh+3) - l1 = l2/ip - ido = n/l2 - idl1 = ido*l1 - iw = iw-(ip-1)*ido - na = 1-na - if (ip .ne. 4) go to 102 - ix2 = iw+ido - ix3 = ix2+ido - if (na .ne. 0) go to 101 - call radf4 (ido,l1,c,ch,wa(iw),wa(ix2),wa(ix3)) - go to 110 - 101 call radf4 (ido,l1,ch,c,wa(iw),wa(ix2),wa(ix3)) - go to 110 - 102 if (ip .ne. 2) go to 104 - if (na .ne. 0) go to 103 - call radf2 (ido,l1,c,ch,wa(iw)) - go to 110 - 103 call radf2 (ido,l1,ch,c,wa(iw)) - go to 110 - 104 if (ip .ne. 3) go to 106 - ix2 = iw+ido - if (na .ne. 0) go to 105 - call radf3 (ido,l1,c,ch,wa(iw),wa(ix2)) - go to 110 - 105 call radf3 (ido,l1,ch,c,wa(iw),wa(ix2)) - go to 110 - 106 if (ip .ne. 5) go to 108 - ix2 = iw+ido - ix3 = ix2+ido - ix4 = ix3+ido - if (na .ne. 0) go to 107 - call radf5 (ido,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 110 - 107 call radf5 (ido,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 110 - 108 if (ido .eq. 1) na = 1-na - if (na .ne. 0) go to 109 - call radfg (ido,ip,l1,idl1,c,c,c,ch,ch,wa(iw)) - na = 1 - go to 110 - 109 call radfg (ido,ip,l1,idl1,ch,ch,ch,c,c,wa(iw)) - na = 0 - 110 l2 = l1 - 111 continue - if (na .eq. 1) return - do 112 i=1,n - c(i) = ch(i) - 112 continue - return - end - subroutine radfg (ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,l1,ip) ,cc(ido,ip,l1) , - 1 c1(ido,l1,ip) ,c2(idl1,ip), - 2 ch2(idl1,ip) ,wa(*) - data tpi/6.28318530717959/ - arg = tpi/float(ip) - dcp = cos(arg) - dsp = sin(arg) - ipph = (ip+1)/2 - ipp2 = ip+2 - idp2 = ido+2 - nbd = (ido-1)/2 - if (ido .eq. 1) go to 119 - do 101 ik=1,idl1 - ch2(ik,1) = c2(ik,1) - 101 continue - do 103 j=2,ip - do 102 k=1,l1 - ch(1,k,j) = c1(1,k,j) - 102 continue - 103 continue - if (nbd .gt. l1) go to 107 - is = -ido - do 106 j=2,ip - is = is+ido - idij = is - do 105 i=3,ido,2 - idij = idij+2 - do 104 k=1,l1 - ch(i-1,k,j) = wa(idij-1)*c1(i-1,k,j)+wa(idij)*c1(i,k,j) - ch(i,k,j) = wa(idij-1)*c1(i,k,j)-wa(idij)*c1(i-1,k,j) - 104 continue - 105 continue - 106 continue - go to 111 - 107 is = -ido - do 110 j=2,ip - is = is+ido - do 109 k=1,l1 - idij = is - do 108 i=3,ido,2 - idij = idij+2 - ch(i-1,k,j) = wa(idij-1)*c1(i-1,k,j)+wa(idij)*c1(i,k,j) - ch(i,k,j) = wa(idij-1)*c1(i,k,j)-wa(idij)*c1(i-1,k,j) - 108 continue - 109 continue - 110 continue - 111 if (nbd .lt. l1) go to 115 - do 114 j=2,ipph - jc = ipp2-j - do 113 k=1,l1 - do 112 i=3,ido,2 - c1(i-1,k,j) = ch(i-1,k,j)+ch(i-1,k,jc) - c1(i-1,k,jc) = ch(i,k,j)-ch(i,k,jc) - c1(i,k,j) = ch(i,k,j)+ch(i,k,jc) - c1(i,k,jc) = ch(i-1,k,jc)-ch(i-1,k,j) - 112 continue - 113 continue - 114 continue - go to 121 - 115 do 118 j=2,ipph - jc = ipp2-j - do 117 i=3,ido,2 - do 116 k=1,l1 - c1(i-1,k,j) = ch(i-1,k,j)+ch(i-1,k,jc) - c1(i-1,k,jc) = ch(i,k,j)-ch(i,k,jc) - c1(i,k,j) = ch(i,k,j)+ch(i,k,jc) - c1(i,k,jc) = ch(i-1,k,jc)-ch(i-1,k,j) - 116 continue - 117 continue - 118 continue - go to 121 - 119 do 120 ik=1,idl1 - c2(ik,1) = ch2(ik,1) - 120 continue - 121 do 123 j=2,ipph - jc = ipp2-j - do 122 k=1,l1 - c1(1,k,j) = ch(1,k,j)+ch(1,k,jc) - c1(1,k,jc) = ch(1,k,jc)-ch(1,k,j) - 122 continue - 123 continue -c - ar1 = 1. - ai1 = 0. - do 127 l=2,ipph - lc = ipp2-l - ar1h = dcp*ar1-dsp*ai1 - ai1 = dcp*ai1+dsp*ar1 - ar1 = ar1h - do 124 ik=1,idl1 - ch2(ik,l) = c2(ik,1)+ar1*c2(ik,2) - ch2(ik,lc) = ai1*c2(ik,ip) - 124 continue - dc2 = ar1 - ds2 = ai1 - ar2 = ar1 - ai2 = ai1 - do 126 j=3,ipph - jc = ipp2-j - ar2h = dc2*ar2-ds2*ai2 - ai2 = dc2*ai2+ds2*ar2 - ar2 = ar2h - do 125 ik=1,idl1 - ch2(ik,l) = ch2(ik,l)+ar2*c2(ik,j) - ch2(ik,lc) = ch2(ik,lc)+ai2*c2(ik,jc) - 125 continue - 126 continue - 127 continue - do 129 j=2,ipph - do 128 ik=1,idl1 - ch2(ik,1) = ch2(ik,1)+c2(ik,j) - 128 continue - 129 continue -c - if (ido .lt. l1) go to 132 - do 131 k=1,l1 - do 130 i=1,ido - cc(i,1,k) = ch(i,k,1) - 130 continue - 131 continue - go to 135 - 132 do 134 i=1,ido - do 133 k=1,l1 - cc(i,1,k) = ch(i,k,1) - 133 continue - 134 continue - 135 do 137 j=2,ipph - jc = ipp2-j - j2 = j+j - do 136 k=1,l1 - cc(ido,j2-2,k) = ch(1,k,j) - cc(1,j2-1,k) = ch(1,k,jc) - 136 continue - 137 continue - if (ido .eq. 1) return - if (nbd .lt. l1) go to 141 - do 140 j=2,ipph - jc = ipp2-j - j2 = j+j - do 139 k=1,l1 - do 138 i=3,ido,2 - ic = idp2-i - cc(i-1,j2-1,k) = ch(i-1,k,j)+ch(i-1,k,jc) - cc(ic-1,j2-2,k) = ch(i-1,k,j)-ch(i-1,k,jc) - cc(i,j2-1,k) = ch(i,k,j)+ch(i,k,jc) - cc(ic,j2-2,k) = ch(i,k,jc)-ch(i,k,j) - 138 continue - 139 continue - 140 continue - return - 141 do 144 j=2,ipph - jc = ipp2-j - j2 = j+j - do 143 i=3,ido,2 - ic = idp2-i - do 142 k=1,l1 - cc(i-1,j2-1,k) = ch(i-1,k,j)+ch(i-1,k,jc) - cc(ic-1,j2-2,k) = ch(i-1,k,j)-ch(i-1,k,jc) - cc(i,j2-1,k) = ch(i,k,j)+ch(i,k,jc) - cc(ic,j2-2,k) = ch(i,k,jc)-ch(i,k,j) - 142 continue - 143 continue - 144 continue - return - end - subroutine radf5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,l1,5) ,ch(ido,5,l1) , - 1 wa1(*) ,wa2(*) ,wa3(*) ,wa4(*) - data tr11,ti11,tr12,ti12 /.309016994374947,.951056516295154, - 1-.809016994374947,.587785252292473/ - do 101 k=1,l1 - cr2 = cc(1,k,5)+cc(1,k,2) - ci5 = cc(1,k,5)-cc(1,k,2) - cr3 = cc(1,k,4)+cc(1,k,3) - ci4 = cc(1,k,4)-cc(1,k,3) - ch(1,1,k) = cc(1,k,1)+cr2+cr3 - ch(ido,2,k) = cc(1,k,1)+tr11*cr2+tr12*cr3 - ch(1,3,k) = ti11*ci5+ti12*ci4 - ch(ido,4,k) = cc(1,k,1)+tr12*cr2+tr11*cr3 - ch(1,5,k) = ti12*ci5-ti11*ci4 - 101 continue - if (ido .eq. 1) return - idp2 = ido+2 - do 103 k=1,l1 - do 102 i=3,ido,2 - ic = idp2-i - dr2 = wa1(i-2)*cc(i-1,k,2)+wa1(i-1)*cc(i,k,2) - di2 = wa1(i-2)*cc(i,k,2)-wa1(i-1)*cc(i-1,k,2) - dr3 = wa2(i-2)*cc(i-1,k,3)+wa2(i-1)*cc(i,k,3) - di3 = wa2(i-2)*cc(i,k,3)-wa2(i-1)*cc(i-1,k,3) - dr4 = wa3(i-2)*cc(i-1,k,4)+wa3(i-1)*cc(i,k,4) - di4 = wa3(i-2)*cc(i,k,4)-wa3(i-1)*cc(i-1,k,4) - dr5 = wa4(i-2)*cc(i-1,k,5)+wa4(i-1)*cc(i,k,5) - di5 = wa4(i-2)*cc(i,k,5)-wa4(i-1)*cc(i-1,k,5) - cr2 = dr2+dr5 - ci5 = dr5-dr2 - cr5 = di2-di5 - ci2 = di2+di5 - cr3 = dr3+dr4 - ci4 = dr4-dr3 - cr4 = di3-di4 - ci3 = di3+di4 - ch(i-1,1,k) = cc(i-1,k,1)+cr2+cr3 - ch(i,1,k) = cc(i,k,1)+ci2+ci3 - tr2 = cc(i-1,k,1)+tr11*cr2+tr12*cr3 - ti2 = cc(i,k,1)+tr11*ci2+tr12*ci3 - tr3 = cc(i-1,k,1)+tr12*cr2+tr11*cr3 - ti3 = cc(i,k,1)+tr12*ci2+tr11*ci3 - tr5 = ti11*cr5+ti12*cr4 - ti5 = ti11*ci5+ti12*ci4 - tr4 = ti12*cr5-ti11*cr4 - ti4 = ti12*ci5-ti11*ci4 - ch(i-1,3,k) = tr2+tr5 - ch(ic-1,2,k) = tr2-tr5 - ch(i,3,k) = ti2+ti5 - ch(ic,2,k) = ti5-ti2 - ch(i-1,5,k) = tr3+tr4 - ch(ic-1,4,k) = tr3-tr4 - ch(i,5,k) = ti3+ti4 - ch(ic,4,k) = ti4-ti3 - 102 continue - 103 continue - return - end - subroutine radf3 (ido,l1,cc,ch,wa1,wa2) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,3,l1) ,cc(ido,l1,3) , - 1 wa1(*) ,wa2(*) - data taur,taui /-.5,.866025403784439/ - do 101 k=1,l1 - cr2 = cc(1,k,2)+cc(1,k,3) - ch(1,1,k) = cc(1,k,1)+cr2 - ch(1,3,k) = taui*(cc(1,k,3)-cc(1,k,2)) - ch(ido,2,k) = cc(1,k,1)+taur*cr2 - 101 continue - if (ido .eq. 1) return - idp2 = ido+2 - do 103 k=1,l1 - do 102 i=3,ido,2 - ic = idp2-i - dr2 = wa1(i-2)*cc(i-1,k,2)+wa1(i-1)*cc(i,k,2) - di2 = wa1(i-2)*cc(i,k,2)-wa1(i-1)*cc(i-1,k,2) - dr3 = wa2(i-2)*cc(i-1,k,3)+wa2(i-1)*cc(i,k,3) - di3 = wa2(i-2)*cc(i,k,3)-wa2(i-1)*cc(i-1,k,3) - cr2 = dr2+dr3 - ci2 = di2+di3 - ch(i-1,1,k) = cc(i-1,k,1)+cr2 - ch(i,1,k) = cc(i,k,1)+ci2 - tr2 = cc(i-1,k,1)+taur*cr2 - ti2 = cc(i,k,1)+taur*ci2 - tr3 = taui*(di2-di3) - ti3 = taui*(dr3-dr2) - ch(i-1,3,k) = tr2+tr3 - ch(ic-1,2,k) = tr2-tr3 - ch(i,3,k) = ti2+ti3 - ch(ic,2,k) = ti3-ti2 - 102 continue - 103 continue - return - end - subroutine radf2 (ido,l1,cc,ch,wa1) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,2,l1) ,cc(ido,l1,2) , - 1 wa1(*) - do 101 k=1,l1 - ch(1,1,k) = cc(1,k,1)+cc(1,k,2) - ch(ido,2,k) = cc(1,k,1)-cc(1,k,2) - 101 continue - if (ido-2) 107,105,102 - 102 idp2 = ido+2 - do 104 k=1,l1 - do 103 i=3,ido,2 - ic = idp2-i - tr2 = wa1(i-2)*cc(i-1,k,2)+wa1(i-1)*cc(i,k,2) - ti2 = wa1(i-2)*cc(i,k,2)-wa1(i-1)*cc(i-1,k,2) - ch(i,1,k) = cc(i,k,1)+ti2 - ch(ic,2,k) = ti2-cc(i,k,1) - ch(i-1,1,k) = cc(i-1,k,1)+tr2 - ch(ic-1,2,k) = cc(i-1,k,1)-tr2 - 103 continue - 104 continue - if (mod(ido,2) .eq. 1) return - 105 do 106 k=1,l1 - ch(1,2,k) = -cc(ido,k,2) - ch(ido,1,k) = cc(ido,k,1) - 106 continue - 107 return - end - subroutine radf4 (ido,l1,cc,ch,wa1,wa2,wa3) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,l1,4) ,ch(ido,4,l1) , - 1 wa1(*) ,wa2(*) ,wa3(*) - data hsqt2 /.7071067811865475/ - do 101 k=1,l1 - tr1 = cc(1,k,2)+cc(1,k,4) - tr2 = cc(1,k,1)+cc(1,k,3) - ch(1,1,k) = tr1+tr2 - ch(ido,4,k) = tr2-tr1 - ch(ido,2,k) = cc(1,k,1)-cc(1,k,3) - ch(1,3,k) = cc(1,k,4)-cc(1,k,2) - 101 continue - if (ido-2) 107,105,102 - 102 idp2 = ido+2 - do 104 k=1,l1 - do 103 i=3,ido,2 - ic = idp2-i - cr2 = wa1(i-2)*cc(i-1,k,2)+wa1(i-1)*cc(i,k,2) - ci2 = wa1(i-2)*cc(i,k,2)-wa1(i-1)*cc(i-1,k,2) - cr3 = wa2(i-2)*cc(i-1,k,3)+wa2(i-1)*cc(i,k,3) - ci3 = wa2(i-2)*cc(i,k,3)-wa2(i-1)*cc(i-1,k,3) - cr4 = wa3(i-2)*cc(i-1,k,4)+wa3(i-1)*cc(i,k,4) - ci4 = wa3(i-2)*cc(i,k,4)-wa3(i-1)*cc(i-1,k,4) - tr1 = cr2+cr4 - tr4 = cr4-cr2 - ti1 = ci2+ci4 - ti4 = ci2-ci4 - ti2 = cc(i,k,1)+ci3 - ti3 = cc(i,k,1)-ci3 - tr2 = cc(i-1,k,1)+cr3 - tr3 = cc(i-1,k,1)-cr3 - ch(i-1,1,k) = tr1+tr2 - ch(ic-1,4,k) = tr2-tr1 - ch(i,1,k) = ti1+ti2 - ch(ic,4,k) = ti1-ti2 - ch(i-1,3,k) = ti4+tr3 - ch(ic-1,2,k) = tr3-ti4 - ch(i,3,k) = tr4+ti3 - ch(ic,2,k) = tr4-ti3 - 103 continue - 104 continue - if (mod(ido,2) .eq. 1) return - 105 continue - do 106 k=1,l1 - ti1 = -hsqt2*(cc(ido,k,2)+cc(ido,k,4)) - tr1 = hsqt2*(cc(ido,k,2)-cc(ido,k,4)) - ch(ido,1,k) = tr1+cc(ido,k,1) - ch(ido,3,k) = cc(ido,k,1)-tr1 - ch(1,2,k) = ti1-cc(ido,k,3) - ch(1,4,k) = ti1+cc(ido,k,3) - 106 continue - 107 return - end - - - - subroutine rfftb (n,r,wsave) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension r(*) ,wsave(*) - if (n .eq. 1) return - call rfftb1 (n,r,wsave,wsave(n+1),wsave(2*n+1)) - return - end - subroutine rfftb1 (n,c,ch,wa,xxifac) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(*) ,c(*) ,wa(*) ,xxifac(*) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nf = jfac(2) - na = 0 - l1 = 1 - iw = 1 - do 116 k1=1,nf - ip = jfac(k1+2) - l2 = ip*l1 - ido = n/l2 - idl1 = ido*l1 - if (ip .ne. 4) go to 103 - ix2 = iw+ido - ix3 = ix2+ido - if (na .ne. 0) go to 101 - call radb4 (ido,l1,c,ch,wa(iw),wa(ix2),wa(ix3)) - go to 102 - 101 call radb4 (ido,l1,ch,c,wa(iw),wa(ix2),wa(ix3)) - 102 na = 1-na - go to 115 - 103 if (ip .ne. 2) go to 106 - if (na .ne. 0) go to 104 - call radb2 (ido,l1,c,ch,wa(iw)) - go to 105 - 104 call radb2 (ido,l1,ch,c,wa(iw)) - 105 na = 1-na - go to 115 - 106 if (ip .ne. 3) go to 109 - ix2 = iw+ido - if (na .ne. 0) go to 107 - call radb3 (ido,l1,c,ch,wa(iw),wa(ix2)) - go to 108 - 107 call radb3 (ido,l1,ch,c,wa(iw),wa(ix2)) - 108 na = 1-na - go to 115 - 109 if (ip .ne. 5) go to 112 - ix2 = iw+ido - ix3 = ix2+ido - ix4 = ix3+ido - if (na .ne. 0) go to 110 - call radb5 (ido,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 111 - 110 call radb5 (ido,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - 111 na = 1-na - go to 115 - 112 if (na .ne. 0) go to 113 - call radbg (ido,ip,l1,idl1,c,c,c,ch,ch,wa(iw)) - go to 114 - 113 call radbg (ido,ip,l1,idl1,ch,ch,ch,c,c,wa(iw)) - 114 if (ido .eq. 1) na = 1-na - 115 l1 = l2 - iw = iw+(ip-1)*ido - 116 continue - if (na .eq. 0) return - do 117 i=1,n - c(i) = ch(i) - 117 continue - return - end - subroutine radbg (ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,l1,ip) ,cc(ido,ip,l1) , - 1 c1(ido,l1,ip) ,c2(idl1,ip), - 2 ch2(idl1,ip) ,wa(*) - data tpi/6.28318530717959/ - arg = tpi/float(ip) - dcp = cos(arg) - dsp = sin(arg) - idp2 = ido+2 - nbd = (ido-1)/2 - ipp2 = ip+2 - ipph = (ip+1)/2 - if (ido .lt. l1) go to 103 - do 102 k=1,l1 - do 101 i=1,ido - ch(i,k,1) = cc(i,1,k) - 101 continue - 102 continue - go to 106 - 103 do 105 i=1,ido - do 104 k=1,l1 - ch(i,k,1) = cc(i,1,k) - 104 continue - 105 continue - 106 do 108 j=2,ipph - jc = ipp2-j - j2 = j+j - do 107 k=1,l1 - ch(1,k,j) = cc(ido,j2-2,k)+cc(ido,j2-2,k) - ch(1,k,jc) = cc(1,j2-1,k)+cc(1,j2-1,k) - 107 continue - 108 continue - if (ido .eq. 1) go to 116 - if (nbd .lt. l1) go to 112 - do 111 j=2,ipph - jc = ipp2-j - do 110 k=1,l1 - do 109 i=3,ido,2 - ic = idp2-i - ch(i-1,k,j) = cc(i-1,2*j-1,k)+cc(ic-1,2*j-2,k) - ch(i-1,k,jc) = cc(i-1,2*j-1,k)-cc(ic-1,2*j-2,k) - ch(i,k,j) = cc(i,2*j-1,k)-cc(ic,2*j-2,k) - ch(i,k,jc) = cc(i,2*j-1,k)+cc(ic,2*j-2,k) - 109 continue - 110 continue - 111 continue - go to 116 - 112 do 115 j=2,ipph - jc = ipp2-j - do 114 i=3,ido,2 - ic = idp2-i - do 113 k=1,l1 - ch(i-1,k,j) = cc(i-1,2*j-1,k)+cc(ic-1,2*j-2,k) - ch(i-1,k,jc) = cc(i-1,2*j-1,k)-cc(ic-1,2*j-2,k) - ch(i,k,j) = cc(i,2*j-1,k)-cc(ic,2*j-2,k) - ch(i,k,jc) = cc(i,2*j-1,k)+cc(ic,2*j-2,k) - 113 continue - 114 continue - 115 continue - 116 ar1 = 1. - ai1 = 0. - do 120 l=2,ipph - lc = ipp2-l - ar1h = dcp*ar1-dsp*ai1 - ai1 = dcp*ai1+dsp*ar1 - ar1 = ar1h - do 117 ik=1,idl1 - c2(ik,l) = ch2(ik,1)+ar1*ch2(ik,2) - c2(ik,lc) = ai1*ch2(ik,ip) - 117 continue - dc2 = ar1 - ds2 = ai1 - ar2 = ar1 - ai2 = ai1 - do 119 j=3,ipph - jc = ipp2-j - ar2h = dc2*ar2-ds2*ai2 - ai2 = dc2*ai2+ds2*ar2 - ar2 = ar2h - do 118 ik=1,idl1 - c2(ik,l) = c2(ik,l)+ar2*ch2(ik,j) - c2(ik,lc) = c2(ik,lc)+ai2*ch2(ik,jc) - 118 continue - 119 continue - 120 continue - do 122 j=2,ipph - do 121 ik=1,idl1 - ch2(ik,1) = ch2(ik,1)+ch2(ik,j) - 121 continue - 122 continue - do 124 j=2,ipph - jc = ipp2-j - do 123 k=1,l1 - ch(1,k,j) = c1(1,k,j)-c1(1,k,jc) - ch(1,k,jc) = c1(1,k,j)+c1(1,k,jc) - 123 continue - 124 continue - if (ido .eq. 1) go to 132 - if (nbd .lt. l1) go to 128 - do 127 j=2,ipph - jc = ipp2-j - do 126 k=1,l1 - do 125 i=3,ido,2 - ch(i-1,k,j) = c1(i-1,k,j)-c1(i,k,jc) - ch(i-1,k,jc) = c1(i-1,k,j)+c1(i,k,jc) - ch(i,k,j) = c1(i,k,j)+c1(i-1,k,jc) - ch(i,k,jc) = c1(i,k,j)-c1(i-1,k,jc) - 125 continue - 126 continue - 127 continue - go to 132 - 128 do 131 j=2,ipph - jc = ipp2-j - do 130 i=3,ido,2 - do 129 k=1,l1 - ch(i-1,k,j) = c1(i-1,k,j)-c1(i,k,jc) - ch(i-1,k,jc) = c1(i-1,k,j)+c1(i,k,jc) - ch(i,k,j) = c1(i,k,j)+c1(i-1,k,jc) - ch(i,k,jc) = c1(i,k,j)-c1(i-1,k,jc) - 129 continue - 130 continue - 131 continue - 132 continue - if (ido .eq. 1) return - do 133 ik=1,idl1 - c2(ik,1) = ch2(ik,1) - 133 continue - do 135 j=2,ip - do 134 k=1,l1 - c1(1,k,j) = ch(1,k,j) - 134 continue - 135 continue - if (nbd .gt. l1) go to 139 - is = -ido - do 138 j=2,ip - is = is+ido - idij = is - do 137 i=3,ido,2 - idij = idij+2 - do 136 k=1,l1 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j) - 136 continue - 137 continue - 138 continue - go to 143 - 139 is = -ido - do 142 j=2,ip - is = is+ido - do 141 k=1,l1 - idij = is - do 140 i=3,ido,2 - idij = idij+2 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j) - 140 continue - 141 continue - 142 continue - 143 return - end - subroutine radb5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,5,l1) ,ch(ido,l1,5) , - 1 wa1(*) ,wa2(*) ,wa3(*) ,wa4(*) - data tr11,ti11,tr12,ti12 /.309016994374947,.951056516295154, - 1-.809016994374947,.587785252292473/ - do 101 k=1,l1 - ti5 = cc(1,3,k)+cc(1,3,k) - ti4 = cc(1,5,k)+cc(1,5,k) - tr2 = cc(ido,2,k)+cc(ido,2,k) - tr3 = cc(ido,4,k)+cc(ido,4,k) - ch(1,k,1) = cc(1,1,k)+tr2+tr3 - cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3 - cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3 - ci5 = ti11*ti5+ti12*ti4 - ci4 = ti12*ti5-ti11*ti4 - ch(1,k,2) = cr2-ci5 - ch(1,k,3) = cr3-ci4 - ch(1,k,4) = cr3+ci4 - ch(1,k,5) = cr2+ci5 - 101 continue - if (ido .eq. 1) return - idp2 = ido+2 - do 103 k=1,l1 - do 102 i=3,ido,2 - ic = idp2-i - ti5 = cc(i,3,k)+cc(ic,2,k) - ti2 = cc(i,3,k)-cc(ic,2,k) - ti4 = cc(i,5,k)+cc(ic,4,k) - ti3 = cc(i,5,k)-cc(ic,4,k) - tr5 = cc(i-1,3,k)-cc(ic-1,2,k) - tr2 = cc(i-1,3,k)+cc(ic-1,2,k) - tr4 = cc(i-1,5,k)-cc(ic-1,4,k) - tr3 = cc(i-1,5,k)+cc(ic-1,4,k) - ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3 - ch(i,k,1) = cc(i,1,k)+ti2+ti3 - cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - dr3 = cr3-ci4 - dr4 = cr3+ci4 - di3 = ci3+cr4 - di4 = ci3-cr4 - dr5 = cr2+ci5 - dr2 = cr2-ci5 - di5 = ci2-cr5 - di2 = ci2+cr5 - ch(i-1,k,2) = wa1(i-2)*dr2-wa1(i-1)*di2 - ch(i,k,2) = wa1(i-2)*di2+wa1(i-1)*dr2 - ch(i-1,k,3) = wa2(i-2)*dr3-wa2(i-1)*di3 - ch(i,k,3) = wa2(i-2)*di3+wa2(i-1)*dr3 - ch(i-1,k,4) = wa3(i-2)*dr4-wa3(i-1)*di4 - ch(i,k,4) = wa3(i-2)*di4+wa3(i-1)*dr4 - ch(i-1,k,5) = wa4(i-2)*dr5-wa4(i-1)*di5 - ch(i,k,5) = wa4(i-2)*di5+wa4(i-1)*dr5 - 102 continue - 103 continue - return - end - subroutine radb3 (ido,l1,cc,ch,wa1,wa2) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,3,l1) ,ch(ido,l1,3) , - 1 wa1(*) ,wa2(*) - data taur,taui /-.5,.866025403784439/ - do 101 k=1,l1 - tr2 = cc(ido,2,k)+cc(ido,2,k) - cr2 = cc(1,1,k)+taur*tr2 - ch(1,k,1) = cc(1,1,k)+tr2 - ci3 = taui*(cc(1,3,k)+cc(1,3,k)) - ch(1,k,2) = cr2-ci3 - ch(1,k,3) = cr2+ci3 - 101 continue - if (ido .eq. 1) return - idp2 = ido+2 - do 103 k=1,l1 - do 102 i=3,ido,2 - ic = idp2-i - tr2 = cc(i-1,3,k)+cc(ic-1,2,k) - cr2 = cc(i-1,1,k)+taur*tr2 - ch(i-1,k,1) = cc(i-1,1,k)+tr2 - ti2 = cc(i,3,k)-cc(ic,2,k) - ci2 = cc(i,1,k)+taur*ti2 - ch(i,k,1) = cc(i,1,k)+ti2 - cr3 = taui*(cc(i-1,3,k)-cc(ic-1,2,k)) - ci3 = taui*(cc(i,3,k)+cc(ic,2,k)) - dr2 = cr2-ci3 - dr3 = cr2+ci3 - di2 = ci2+cr3 - di3 = ci2-cr3 - ch(i-1,k,2) = wa1(i-2)*dr2-wa1(i-1)*di2 - ch(i,k,2) = wa1(i-2)*di2+wa1(i-1)*dr2 - ch(i-1,k,3) = wa2(i-2)*dr3-wa2(i-1)*di3 - ch(i,k,3) = wa2(i-2)*di3+wa2(i-1)*dr3 - 102 continue - 103 continue - return - end - subroutine radb2 (ido,l1,cc,ch,wa1) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,2,l1) ,ch(ido,l1,2) , - 1 wa1(*) - do 101 k=1,l1 - ch(1,k,1) = cc(1,1,k)+cc(ido,2,k) - ch(1,k,2) = cc(1,1,k)-cc(ido,2,k) - 101 continue - if (ido-2) 107,105,102 - 102 idp2 = ido+2 - do 104 k=1,l1 - do 103 i=3,ido,2 - ic = idp2-i - ch(i-1,k,1) = cc(i-1,1,k)+cc(ic-1,2,k) - tr2 = cc(i-1,1,k)-cc(ic-1,2,k) - ch(i,k,1) = cc(i,1,k)-cc(ic,2,k) - ti2 = cc(i,1,k)+cc(ic,2,k) - ch(i-1,k,2) = wa1(i-2)*tr2-wa1(i-1)*ti2 - ch(i,k,2) = wa1(i-2)*ti2+wa1(i-1)*tr2 - 103 continue - 104 continue - if (mod(ido,2) .eq. 1) return - 105 do 106 k=1,l1 - ch(ido,k,1) = cc(ido,1,k)+cc(ido,1,k) - ch(ido,k,2) = -(cc(1,2,k)+cc(1,2,k)) - 106 continue - 107 return - end - subroutine radb4 (ido,l1,cc,ch,wa1,wa2,wa3) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,4,l1) ,ch(ido,l1,4) , - 1 wa1(*) ,wa2(*) ,wa3(*) - data sqrt2 /1.414213562373095/ - do 101 k=1,l1 - tr1 = cc(1,1,k)-cc(ido,4,k) - tr2 = cc(1,1,k)+cc(ido,4,k) - tr3 = cc(ido,2,k)+cc(ido,2,k) - tr4 = cc(1,3,k)+cc(1,3,k) - ch(1,k,1) = tr2+tr3 - ch(1,k,2) = tr1-tr4 - ch(1,k,3) = tr2-tr3 - ch(1,k,4) = tr1+tr4 - 101 continue - if (ido-2) 107,105,102 - 102 idp2 = ido+2 - do 104 k=1,l1 - do 103 i=3,ido,2 - ic = idp2-i - ti1 = cc(i,1,k)+cc(ic,4,k) - ti2 = cc(i,1,k)-cc(ic,4,k) - ti3 = cc(i,3,k)-cc(ic,2,k) - tr4 = cc(i,3,k)+cc(ic,2,k) - tr1 = cc(i-1,1,k)-cc(ic-1,4,k) - tr2 = cc(i-1,1,k)+cc(ic-1,4,k) - ti4 = cc(i-1,3,k)-cc(ic-1,2,k) - tr3 = cc(i-1,3,k)+cc(ic-1,2,k) - ch(i-1,k,1) = tr2+tr3 - cr3 = tr2-tr3 - ch(i,k,1) = ti2+ti3 - ci3 = ti2-ti3 - cr2 = tr1-tr4 - cr4 = tr1+tr4 - ci2 = ti1+ti4 - ci4 = ti1-ti4 - ch(i-1,k,2) = wa1(i-2)*cr2-wa1(i-1)*ci2 - ch(i,k,2) = wa1(i-2)*ci2+wa1(i-1)*cr2 - ch(i-1,k,3) = wa2(i-2)*cr3-wa2(i-1)*ci3 - ch(i,k,3) = wa2(i-2)*ci3+wa2(i-1)*cr3 - ch(i-1,k,4) = wa3(i-2)*cr4-wa3(i-1)*ci4 - ch(i,k,4) = wa3(i-2)*ci4+wa3(i-1)*cr4 - 103 continue - 104 continue - if (mod(ido,2) .eq. 1) return - 105 continue - do 106 k=1,l1 - ti1 = cc(1,2,k)+cc(1,4,k) - ti2 = cc(1,4,k)-cc(1,2,k) - tr1 = cc(ido,1,k)-cc(ido,3,k) - tr2 = cc(ido,1,k)+cc(ido,3,k) - ch(ido,k,1) = tr2+tr2 - ch(ido,k,2) = sqrt2*(tr1-ti1) - ch(ido,k,3) = ti2+ti2 - ch(ido,k,4) = -sqrt2*(tr1+ti1) - 106 continue - 107 return - end - - - - subroutine cffti (n,wsave) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wsave(*) - if (n .eq. 1) return - iw1 = n+n+1 - iw2 = iw1+n+n - call cffti1 (n,wsave(iw1),wsave(iw2)) - return - end - subroutine cffti1 (n,wa,xxifac) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wa(*) ,xxifac(*) ,ntryh(4) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - data ntryh(1),ntryh(2),ntryh(3),ntryh(4)/3,4,2,5/ - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nl = n - nf = 0 - j = 0 - 101 j = j+1 - if (j-4) 102,102,103 - 102 ntry = ntryh(j) - go to 104 - 103 ntry = ntry+2 - 104 nq = nl/ntry - nr = nl-ntry*nq - if (nr) 101,105,101 - 105 nf = nf+1 - jfac(nf+2) = ntry - nl = nq - if (ntry .ne. 2) go to 107 - if (nf .eq. 1) go to 107 - do 106 i=2,nf - ib = nf-i+2 - jfac(ib+2) = jfac(ib+1) - 106 continue - jfac(3) = 2 - 107 if (nl .ne. 1) go to 104 - jfac(1) = n - jfac(2) = nf - tpi = 6.28318530717959 - argh = tpi/float(n) - i = 2 - l1 = 1 - do 110 k1=1,nf - ip = jfac(k1+2) - ld = 0 - l2 = l1*ip - ido = n/l2 - idot = ido+ido+2 - ipm = ip-1 - do 109 j=1,ipm - i1 = i - wa(i-1) = 1. - wa(i) = 0. - ld = ld+l1 - fi = 0. - argld = float(ld)*argh - do 108 ii=4,idot,2 - i = i+2 - fi = fi+1. - arg = fi*argld - wa(i-1) = cos(arg) - wa(i) = sin(arg) - 108 continue - if (ip .le. 5) go to 109 - wa(i1-1) = wa(i-1) - wa(i1) = wa(i) - 109 continue - l1 = l2 - 110 continue - do 111 i = 1, 15 - xxifac(i) = rfac(i) - 111 continue - return - end - - - - subroutine cfftf (n,c,wsave) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension c(*) ,wsave(*) - if (n .eq. 1) return - iw1 = n+n+1 - iw2 = iw1+n+n - call cfftf1 (n,c,wsave,wsave(iw1),wsave(iw2)) - return - end - subroutine cfftf1 (n,c,ch,wa,xxifac) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(*) ,c(*) ,wa(*) ,xxifac(*) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nf = jfac(2) - na = 0 - l1 = 1 - iw = 1 - do 116 k1=1,nf - ip = jfac(k1+2) - l2 = ip*l1 - ido = n/l2 - idot = ido+ido - idl1 = idot*l1 - if (ip .ne. 4) go to 103 - ix2 = iw+idot - ix3 = ix2+idot - if (na .ne. 0) go to 101 - call passf4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3)) - go to 102 - 101 call passf4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3)) - 102 na = 1-na - go to 115 - 103 if (ip .ne. 2) go to 106 - if (na .ne. 0) go to 104 - call passf2 (idot,l1,c,ch,wa(iw)) - go to 105 - 104 call passf2 (idot,l1,ch,c,wa(iw)) - 105 na = 1-na - go to 115 - 106 if (ip .ne. 3) go to 109 - ix2 = iw+idot - if (na .ne. 0) go to 107 - call passf3 (idot,l1,c,ch,wa(iw),wa(ix2)) - go to 108 - 107 call passf3 (idot,l1,ch,c,wa(iw),wa(ix2)) - 108 na = 1-na - go to 115 - 109 if (ip .ne. 5) go to 112 - ix2 = iw+idot - ix3 = ix2+idot - ix4 = ix3+idot - if (na .ne. 0) go to 110 - call passf5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 111 - 110 call passf5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - 111 na = 1-na - go to 115 - 112 if (na .ne. 0) go to 113 - call passf (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw)) - go to 114 - 113 call passf (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw)) - 114 if (nac .ne. 0) na = 1-na - 115 l1 = l2 - iw = iw+(ip-1)*idot - 116 continue - if (na .eq. 0) return - n2 = n+n - do 117 i=1,n2 - c(i) = ch(i) - 117 continue - return - end - subroutine passf (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,l1,ip) ,cc(ido,ip,l1) , - 1 c1(ido,l1,ip) ,wa(*) ,c2(idl1,ip), - 2 ch2(idl1,ip) - idot = ido/2 - nt = ip*idl1 - ipp2 = ip+2 - ipph = (ip+1)/2 - idp = ip*ido -c - if (ido .lt. l1) go to 106 - do 103 j=2,ipph - jc = ipp2-j - do 102 k=1,l1 - do 101 i=1,ido - ch(i,k,j) = cc(i,j,k)+cc(i,jc,k) - ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k) - 101 continue - 102 continue - 103 continue - do 105 k=1,l1 - do 104 i=1,ido - ch(i,k,1) = cc(i,1,k) - 104 continue - 105 continue - go to 112 - 106 do 109 j=2,ipph - jc = ipp2-j - do 108 i=1,ido - do 107 k=1,l1 - ch(i,k,j) = cc(i,j,k)+cc(i,jc,k) - ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k) - 107 continue - 108 continue - 109 continue - do 111 i=1,ido - do 110 k=1,l1 - ch(i,k,1) = cc(i,1,k) - 110 continue - 111 continue - 112 idl = 2-ido - inc = 0 - do 116 l=2,ipph - lc = ipp2-l - idl = idl+ido - do 113 ik=1,idl1 - c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2) - c2(ik,lc) = -wa(idl)*ch2(ik,ip) - 113 continue - idlj = idl - inc = inc+ido - do 115 j=3,ipph - jc = ipp2-j - idlj = idlj+inc - if (idlj .gt. idp) idlj = idlj-idp - war = wa(idlj-1) - wai = wa(idlj) - do 114 ik=1,idl1 - c2(ik,l) = c2(ik,l)+war*ch2(ik,j) - c2(ik,lc) = c2(ik,lc)-wai*ch2(ik,jc) - 114 continue - 115 continue - 116 continue - do 118 j=2,ipph - do 117 ik=1,idl1 - ch2(ik,1) = ch2(ik,1)+ch2(ik,j) - 117 continue - 118 continue - do 120 j=2,ipph - jc = ipp2-j - do 119 ik=2,idl1,2 - ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc) - ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc) - ch2(ik,j) = c2(ik,j)+c2(ik-1,jc) - ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc) - 119 continue - 120 continue - nac = 1 - if (ido .eq. 2) return - nac = 0 - do 121 ik=1,idl1 - c2(ik,1) = ch2(ik,1) - 121 continue - do 123 j=2,ip - do 122 k=1,l1 - c1(1,k,j) = ch(1,k,j) - c1(2,k,j) = ch(2,k,j) - 122 continue - 123 continue - if (idot .gt. l1) go to 127 - idij = 0 - do 126 j=2,ip - idij = idij+2 - do 125 i=4,ido,2 - idij = idij+2 - do 124 k=1,l1 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j) - 124 continue - 125 continue - 126 continue - return - 127 idj = 2-ido - do 130 j=2,ip - idj = idj+ido - do 129 k=1,l1 - idij = idj - do 128 i=4,ido,2 - idij = idij+2 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j) - 128 continue - 129 continue - 130 continue - return - end - subroutine passf5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,5,l1) ,ch(ido,l1,5) , - 1 wa1(*) ,wa2(*) ,wa3(*) ,wa4(*) - data tr11,ti11,tr12,ti12 /.309016994374947,-.951056516295154, - 1-.809016994374947,-.587785252292473/ - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - ti5 = cc(2,2,k)-cc(2,5,k) - ti2 = cc(2,2,k)+cc(2,5,k) - ti4 = cc(2,3,k)-cc(2,4,k) - ti3 = cc(2,3,k)+cc(2,4,k) - tr5 = cc(1,2,k)-cc(1,5,k) - tr2 = cc(1,2,k)+cc(1,5,k) - tr4 = cc(1,3,k)-cc(1,4,k) - tr3 = cc(1,3,k)+cc(1,4,k) - ch(1,k,1) = cc(1,1,k)+tr2+tr3 - ch(2,k,1) = cc(2,1,k)+ti2+ti3 - cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - ch(1,k,2) = cr2-ci5 - ch(1,k,5) = cr2+ci5 - ch(2,k,2) = ci2+cr5 - ch(2,k,3) = ci3+cr4 - ch(1,k,3) = cr3-ci4 - ch(1,k,4) = cr3+ci4 - ch(2,k,4) = ci3-cr4 - ch(2,k,5) = ci2-cr5 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ti5 = cc(i,2,k)-cc(i,5,k) - ti2 = cc(i,2,k)+cc(i,5,k) - ti4 = cc(i,3,k)-cc(i,4,k) - ti3 = cc(i,3,k)+cc(i,4,k) - tr5 = cc(i-1,2,k)-cc(i-1,5,k) - tr2 = cc(i-1,2,k)+cc(i-1,5,k) - tr4 = cc(i-1,3,k)-cc(i-1,4,k) - tr3 = cc(i-1,3,k)+cc(i-1,4,k) - ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3 - ch(i,k,1) = cc(i,1,k)+ti2+ti3 - cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - dr3 = cr3-ci4 - dr4 = cr3+ci4 - di3 = ci3+cr4 - di4 = ci3-cr4 - dr5 = cr2+ci5 - dr2 = cr2-ci5 - di5 = ci2-cr5 - di2 = ci2+cr5 - ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2 - ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2 - ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3 - ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3 - ch(i-1,k,4) = wa3(i-1)*dr4+wa3(i)*di4 - ch(i,k,4) = wa3(i-1)*di4-wa3(i)*dr4 - ch(i-1,k,5) = wa4(i-1)*dr5+wa4(i)*di5 - ch(i,k,5) = wa4(i-1)*di5-wa4(i)*dr5 - 103 continue - 104 continue - return - end - subroutine passf3 (ido,l1,cc,ch,wa1,wa2) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,3,l1) ,ch(ido,l1,3) , - 1 wa1(*) ,wa2(*) - data taur,taui /-.5,-.866025403784439/ - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - tr2 = cc(1,2,k)+cc(1,3,k) - cr2 = cc(1,1,k)+taur*tr2 - ch(1,k,1) = cc(1,1,k)+tr2 - ti2 = cc(2,2,k)+cc(2,3,k) - ci2 = cc(2,1,k)+taur*ti2 - ch(2,k,1) = cc(2,1,k)+ti2 - cr3 = taui*(cc(1,2,k)-cc(1,3,k)) - ci3 = taui*(cc(2,2,k)-cc(2,3,k)) - ch(1,k,2) = cr2-ci3 - ch(1,k,3) = cr2+ci3 - ch(2,k,2) = ci2+cr3 - ch(2,k,3) = ci2-cr3 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - tr2 = cc(i-1,2,k)+cc(i-1,3,k) - cr2 = cc(i-1,1,k)+taur*tr2 - ch(i-1,k,1) = cc(i-1,1,k)+tr2 - ti2 = cc(i,2,k)+cc(i,3,k) - ci2 = cc(i,1,k)+taur*ti2 - ch(i,k,1) = cc(i,1,k)+ti2 - cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k)) - ci3 = taui*(cc(i,2,k)-cc(i,3,k)) - dr2 = cr2-ci3 - dr3 = cr2+ci3 - di2 = ci2+cr3 - di3 = ci2-cr3 - ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2 - ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2 - ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3 - ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3 - 103 continue - 104 continue - return - end - subroutine passf2 (ido,l1,cc,ch,wa1) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,2,l1) ,ch(ido,l1,2) , - 1 wa1(*) - if (ido .gt. 2) go to 102 - do 101 k=1,l1 - ch(1,k,1) = cc(1,1,k)+cc(1,2,k) - ch(1,k,2) = cc(1,1,k)-cc(1,2,k) - ch(2,k,1) = cc(2,1,k)+cc(2,2,k) - ch(2,k,2) = cc(2,1,k)-cc(2,2,k) - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k) - tr2 = cc(i-1,1,k)-cc(i-1,2,k) - ch(i,k,1) = cc(i,1,k)+cc(i,2,k) - ti2 = cc(i,1,k)-cc(i,2,k) - ch(i,k,2) = wa1(i-1)*ti2-wa1(i)*tr2 - ch(i-1,k,2) = wa1(i-1)*tr2+wa1(i)*ti2 - 103 continue - 104 continue - return - end - subroutine passf4 (ido,l1,cc,ch,wa1,wa2,wa3) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,4,l1) ,ch(ido,l1,4) , - 1 wa1(*) ,wa2(*) ,wa3(*) - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - ti1 = cc(2,1,k)-cc(2,3,k) - ti2 = cc(2,1,k)+cc(2,3,k) - tr4 = cc(2,2,k)-cc(2,4,k) - ti3 = cc(2,2,k)+cc(2,4,k) - tr1 = cc(1,1,k)-cc(1,3,k) - tr2 = cc(1,1,k)+cc(1,3,k) - ti4 = cc(1,4,k)-cc(1,2,k) - tr3 = cc(1,2,k)+cc(1,4,k) - ch(1,k,1) = tr2+tr3 - ch(1,k,3) = tr2-tr3 - ch(2,k,1) = ti2+ti3 - ch(2,k,3) = ti2-ti3 - ch(1,k,2) = tr1+tr4 - ch(1,k,4) = tr1-tr4 - ch(2,k,2) = ti1+ti4 - ch(2,k,4) = ti1-ti4 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ti1 = cc(i,1,k)-cc(i,3,k) - ti2 = cc(i,1,k)+cc(i,3,k) - ti3 = cc(i,2,k)+cc(i,4,k) - tr4 = cc(i,2,k)-cc(i,4,k) - tr1 = cc(i-1,1,k)-cc(i-1,3,k) - tr2 = cc(i-1,1,k)+cc(i-1,3,k) - ti4 = cc(i-1,4,k)-cc(i-1,2,k) - tr3 = cc(i-1,2,k)+cc(i-1,4,k) - ch(i-1,k,1) = tr2+tr3 - cr3 = tr2-tr3 - ch(i,k,1) = ti2+ti3 - ci3 = ti2-ti3 - cr2 = tr1+tr4 - cr4 = tr1-tr4 - ci2 = ti1+ti4 - ci4 = ti1-ti4 - ch(i-1,k,2) = wa1(i-1)*cr2+wa1(i)*ci2 - ch(i,k,2) = wa1(i-1)*ci2-wa1(i)*cr2 - ch(i-1,k,3) = wa2(i-1)*cr3+wa2(i)*ci3 - ch(i,k,3) = wa2(i-1)*ci3-wa2(i)*cr3 - ch(i-1,k,4) = wa3(i-1)*cr4+wa3(i)*ci4 - ch(i,k,4) = wa3(i-1)*ci4-wa3(i)*cr4 - 103 continue - 104 continue - return - end - - - - subroutine cfftb (n,c,wsave) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension c(*) ,wsave(*) - if (n .eq. 1) return - iw1 = n+n+1 - iw2 = iw1+n+n - call cfftb1 (n,c,wsave,wsave(iw1),wsave(iw2)) - return - end - subroutine cfftb1 (n,c,ch,wa,xxifac) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(*) ,c(*) ,wa(*) ,xxifac(*) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nf = jfac(2) - na = 0 - l1 = 1 - iw = 1 - do 116 k1=1,nf - ip = jfac(k1+2) - l2 = ip*l1 - ido = n/l2 - idot = ido+ido - idl1 = idot*l1 - if (ip .ne. 4) go to 103 - ix2 = iw+idot - ix3 = ix2+idot - if (na .ne. 0) go to 101 - call passb4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3)) - go to 102 - 101 call passb4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3)) - 102 na = 1-na - go to 115 - 103 if (ip .ne. 2) go to 106 - if (na .ne. 0) go to 104 - call passb2 (idot,l1,c,ch,wa(iw)) - go to 105 - 104 call passb2 (idot,l1,ch,c,wa(iw)) - 105 na = 1-na - go to 115 - 106 if (ip .ne. 3) go to 109 - ix2 = iw+idot - if (na .ne. 0) go to 107 - call passb3 (idot,l1,c,ch,wa(iw),wa(ix2)) - go to 108 - 107 call passb3 (idot,l1,ch,c,wa(iw),wa(ix2)) - 108 na = 1-na - go to 115 - 109 if (ip .ne. 5) go to 112 - ix2 = iw+idot - ix3 = ix2+idot - ix4 = ix3+idot - if (na .ne. 0) go to 110 - call passb5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 111 - 110 call passb5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - 111 na = 1-na - go to 115 - 112 if (na .ne. 0) go to 113 - call passb (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw)) - go to 114 - 113 call passb (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw)) - 114 if (nac .ne. 0) na = 1-na - 115 l1 = l2 - iw = iw+(ip-1)*idot - 116 continue - if (na .eq. 0) return - n2 = n+n - do 117 i=1,n2 - c(i) = ch(i) - 117 continue - return - end - subroutine passb (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,l1,ip) ,cc(ido,ip,l1) , - 1 c1(ido,l1,ip) ,wa(*) ,c2(idl1,ip), - 2 ch2(idl1,ip) - idot = ido/2 - nt = ip*idl1 - ipp2 = ip+2 - ipph = (ip+1)/2 - idp = ip*ido -c - if (ido .lt. l1) go to 106 - do 103 j=2,ipph - jc = ipp2-j - do 102 k=1,l1 - do 101 i=1,ido - ch(i,k,j) = cc(i,j,k)+cc(i,jc,k) - ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k) - 101 continue - 102 continue - 103 continue - do 105 k=1,l1 - do 104 i=1,ido - ch(i,k,1) = cc(i,1,k) - 104 continue - 105 continue - go to 112 - 106 do 109 j=2,ipph - jc = ipp2-j - do 108 i=1,ido - do 107 k=1,l1 - ch(i,k,j) = cc(i,j,k)+cc(i,jc,k) - ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k) - 107 continue - 108 continue - 109 continue - do 111 i=1,ido - do 110 k=1,l1 - ch(i,k,1) = cc(i,1,k) - 110 continue - 111 continue - 112 idl = 2-ido - inc = 0 - do 116 l=2,ipph - lc = ipp2-l - idl = idl+ido - do 113 ik=1,idl1 - c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2) - c2(ik,lc) = wa(idl)*ch2(ik,ip) - 113 continue - idlj = idl - inc = inc+ido - do 115 j=3,ipph - jc = ipp2-j - idlj = idlj+inc - if (idlj .gt. idp) idlj = idlj-idp - war = wa(idlj-1) - wai = wa(idlj) - do 114 ik=1,idl1 - c2(ik,l) = c2(ik,l)+war*ch2(ik,j) - c2(ik,lc) = c2(ik,lc)+wai*ch2(ik,jc) - 114 continue - 115 continue - 116 continue - do 118 j=2,ipph - do 117 ik=1,idl1 - ch2(ik,1) = ch2(ik,1)+ch2(ik,j) - 117 continue - 118 continue - do 120 j=2,ipph - jc = ipp2-j - do 119 ik=2,idl1,2 - ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc) - ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc) - ch2(ik,j) = c2(ik,j)+c2(ik-1,jc) - ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc) - 119 continue - 120 continue - nac = 1 - if (ido .eq. 2) return - nac = 0 - do 121 ik=1,idl1 - c2(ik,1) = ch2(ik,1) - 121 continue - do 123 j=2,ip - do 122 k=1,l1 - c1(1,k,j) = ch(1,k,j) - c1(2,k,j) = ch(2,k,j) - 122 continue - 123 continue - if (idot .gt. l1) go to 127 - idij = 0 - do 126 j=2,ip - idij = idij+2 - do 125 i=4,ido,2 - idij = idij+2 - do 124 k=1,l1 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j) - 124 continue - 125 continue - 126 continue - return - 127 idj = 2-ido - do 130 j=2,ip - idj = idj+ido - do 129 k=1,l1 - idij = idj - do 128 i=4,ido,2 - idij = idij+2 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j) - 128 continue - 129 continue - 130 continue - return - end - subroutine passb5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,5,l1) ,ch(ido,l1,5) , - 1 wa1(*) ,wa2(*) ,wa3(*) ,wa4(*) - data tr11,ti11,tr12,ti12 /.309016994374947,.951056516295154, - 1-.809016994374947,.587785252292473/ - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - ti5 = cc(2,2,k)-cc(2,5,k) - ti2 = cc(2,2,k)+cc(2,5,k) - ti4 = cc(2,3,k)-cc(2,4,k) - ti3 = cc(2,3,k)+cc(2,4,k) - tr5 = cc(1,2,k)-cc(1,5,k) - tr2 = cc(1,2,k)+cc(1,5,k) - tr4 = cc(1,3,k)-cc(1,4,k) - tr3 = cc(1,3,k)+cc(1,4,k) - ch(1,k,1) = cc(1,1,k)+tr2+tr3 - ch(2,k,1) = cc(2,1,k)+ti2+ti3 - cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - ch(1,k,2) = cr2-ci5 - ch(1,k,5) = cr2+ci5 - ch(2,k,2) = ci2+cr5 - ch(2,k,3) = ci3+cr4 - ch(1,k,3) = cr3-ci4 - ch(1,k,4) = cr3+ci4 - ch(2,k,4) = ci3-cr4 - ch(2,k,5) = ci2-cr5 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ti5 = cc(i,2,k)-cc(i,5,k) - ti2 = cc(i,2,k)+cc(i,5,k) - ti4 = cc(i,3,k)-cc(i,4,k) - ti3 = cc(i,3,k)+cc(i,4,k) - tr5 = cc(i-1,2,k)-cc(i-1,5,k) - tr2 = cc(i-1,2,k)+cc(i-1,5,k) - tr4 = cc(i-1,3,k)-cc(i-1,4,k) - tr3 = cc(i-1,3,k)+cc(i-1,4,k) - ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3 - ch(i,k,1) = cc(i,1,k)+ti2+ti3 - cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - dr3 = cr3-ci4 - dr4 = cr3+ci4 - di3 = ci3+cr4 - di4 = ci3-cr4 - dr5 = cr2+ci5 - dr2 = cr2-ci5 - di5 = ci2-cr5 - di2 = ci2+cr5 - ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2 - ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2 - ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3 - ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3 - ch(i-1,k,4) = wa3(i-1)*dr4-wa3(i)*di4 - ch(i,k,4) = wa3(i-1)*di4+wa3(i)*dr4 - ch(i-1,k,5) = wa4(i-1)*dr5-wa4(i)*di5 - ch(i,k,5) = wa4(i-1)*di5+wa4(i)*dr5 - 103 continue - 104 continue - return - end - subroutine passb3 (ido,l1,cc,ch,wa1,wa2) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,3,l1) ,ch(ido,l1,3) , - 1 wa1(*) ,wa2(*) - data taur,taui /-.5,.866025403784439/ - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - tr2 = cc(1,2,k)+cc(1,3,k) - cr2 = cc(1,1,k)+taur*tr2 - ch(1,k,1) = cc(1,1,k)+tr2 - ti2 = cc(2,2,k)+cc(2,3,k) - ci2 = cc(2,1,k)+taur*ti2 - ch(2,k,1) = cc(2,1,k)+ti2 - cr3 = taui*(cc(1,2,k)-cc(1,3,k)) - ci3 = taui*(cc(2,2,k)-cc(2,3,k)) - ch(1,k,2) = cr2-ci3 - ch(1,k,3) = cr2+ci3 - ch(2,k,2) = ci2+cr3 - ch(2,k,3) = ci2-cr3 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - tr2 = cc(i-1,2,k)+cc(i-1,3,k) - cr2 = cc(i-1,1,k)+taur*tr2 - ch(i-1,k,1) = cc(i-1,1,k)+tr2 - ti2 = cc(i,2,k)+cc(i,3,k) - ci2 = cc(i,1,k)+taur*ti2 - ch(i,k,1) = cc(i,1,k)+ti2 - cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k)) - ci3 = taui*(cc(i,2,k)-cc(i,3,k)) - dr2 = cr2-ci3 - dr3 = cr2+ci3 - di2 = ci2+cr3 - di3 = ci2-cr3 - ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2 - ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2 - ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3 - ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3 - 103 continue - 104 continue - return - end - subroutine passb2 (ido,l1,cc,ch,wa1) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,2,l1) ,ch(ido,l1,2) , - 1 wa1(*) - if (ido .gt. 2) go to 102 - do 101 k=1,l1 - ch(1,k,1) = cc(1,1,k)+cc(1,2,k) - ch(1,k,2) = cc(1,1,k)-cc(1,2,k) - ch(2,k,1) = cc(2,1,k)+cc(2,2,k) - ch(2,k,2) = cc(2,1,k)-cc(2,2,k) - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k) - tr2 = cc(i-1,1,k)-cc(i-1,2,k) - ch(i,k,1) = cc(i,1,k)+cc(i,2,k) - ti2 = cc(i,1,k)-cc(i,2,k) - ch(i,k,2) = wa1(i-1)*ti2+wa1(i)*tr2 - ch(i-1,k,2) = wa1(i-1)*tr2-wa1(i)*ti2 - 103 continue - 104 continue - return - end - subroutine passb4 (ido,l1,cc,ch,wa1,wa2,wa3) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,4,l1) ,ch(ido,l1,4) , - 1 wa1(*) ,wa2(*) ,wa3(*) - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - ti1 = cc(2,1,k)-cc(2,3,k) - ti2 = cc(2,1,k)+cc(2,3,k) - tr4 = cc(2,4,k)-cc(2,2,k) - ti3 = cc(2,2,k)+cc(2,4,k) - tr1 = cc(1,1,k)-cc(1,3,k) - tr2 = cc(1,1,k)+cc(1,3,k) - ti4 = cc(1,2,k)-cc(1,4,k) - tr3 = cc(1,2,k)+cc(1,4,k) - ch(1,k,1) = tr2+tr3 - ch(1,k,3) = tr2-tr3 - ch(2,k,1) = ti2+ti3 - ch(2,k,3) = ti2-ti3 - ch(1,k,2) = tr1+tr4 - ch(1,k,4) = tr1-tr4 - ch(2,k,2) = ti1+ti4 - ch(2,k,4) = ti1-ti4 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ti1 = cc(i,1,k)-cc(i,3,k) - ti2 = cc(i,1,k)+cc(i,3,k) - ti3 = cc(i,2,k)+cc(i,4,k) - tr4 = cc(i,4,k)-cc(i,2,k) - tr1 = cc(i-1,1,k)-cc(i-1,3,k) - tr2 = cc(i-1,1,k)+cc(i-1,3,k) - ti4 = cc(i-1,2,k)-cc(i-1,4,k) - tr3 = cc(i-1,2,k)+cc(i-1,4,k) - ch(i-1,k,1) = tr2+tr3 - cr3 = tr2-tr3 - ch(i,k,1) = ti2+ti3 - ci3 = ti2-ti3 - cr2 = tr1+tr4 - cr4 = tr1-tr4 - ci2 = ti1+ti4 - ci4 = ti1-ti4 - ch(i-1,k,2) = wa1(i-1)*cr2-wa1(i)*ci2 - ch(i,k,2) = wa1(i-1)*ci2+wa1(i)*cr2 - ch(i-1,k,3) = wa2(i-1)*cr3-wa2(i)*ci3 - ch(i,k,3) = wa2(i-1)*ci3+wa2(i)*cr3 - ch(i-1,k,4) = wa3(i-1)*cr4-wa3(i)*ci4 - ch(i,k,4) = wa3(i-1)*ci4+wa3(i)*cr4 - 103 continue - 104 continue - return - end - - - - subroutine sinti (n,wsave) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wsave(*) - data pi /3.14159265358979/ - if (n .le. 1) return - ns2 = n/2 - np1 = n+1 - dt = pi/float(np1) - do 101 k=1,ns2 - wsave(k) = 2.*sin(k*dt) - 101 continue - call rffti (np1,wsave(ns2+1)) - return - end - - - - subroutine sint (n,x,wsave) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension x(*) ,wsave(*) - -c with n = 20 -c iw1 = 11 -c iw2 = 11+20+1=32 -c iw3 = 32+21=53 - np1 = n+1 - iw1 = n/2+1 - iw2 = iw1+np1 - iw3 = iw2+np1 - call sint1(n,x,wsave,wsave(iw1),wsave(iw2),wsave(iw3)) - return - end - - - subroutine sint1(n,war,was,xh,x,xxifac) -c----------------------------TJW - implicit FLOAT (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension war(*),was(*),x(*),xh(*),xxifac(*) - data sqrt3 /1.73205080756888/ - do 100 i=1,n - xh(i) = war(i) - war(i) = x(i) - 100 continue - if (n-2) 101,102,103 - 101 xh(1) = xh(1)+xh(1) - go to 106 - 102 xhold = sqrt3*(xh(1)+xh(2)) - xh(2) = sqrt3*(xh(1)-xh(2)) - xh(1) = xhold - go to 106 - 103 np1 = n+1 - ns2 = n/2 - x(1) = 0. - do 104 k=1,ns2 - kc = np1-k - t1 = xh(k)-xh(kc) - t2 = was(k)*(xh(k)+xh(kc)) - x(k+1) = t1+t2 - x(kc+1) = t2-t1 - 104 continue - modn = mod(n,2) - if (modn .ne. 0) x(ns2+2) = 4.*xh(ns2+1) - call rfftf1 (np1,x,xh,war,xxifac) - xh(1) = .5*x(1) - do 105 i=3,n,2 - xh(i-1) = -x(i) - xh(i) = xh(i-2)+x(i-1) - 105 continue - if (modn .ne. 0) go to 106 - xh(n) = -x(n+1) - 106 do 107 i=1,n - x(i) = war(i) - war(i) = xh(i) - 107 continue - return - end - -c---------------------------SINGLE PRECISION---------------------------- - subroutine frffti (n,wsave) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wsave(*) - if (n .eq. 1) return - call frffti1 (n,wsave(n+1),wsave(2*n+1)) - return - end - - subroutine frffti1 (n,wa,xxifac) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wa(*) ,xxifac(*) ,ntryh(4) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - data ntryh(1),ntryh(2),ntryh(3),ntryh(4)/4,2,3,5/ - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nl = n - nf = 0 - j = 0 - 101 j = j+1 - if (j-4) 102,102,103 - 102 ntry = ntryh(j) - go to 104 - 103 ntry = ntry+2 - 104 nq = nl/ntry - nr = nl-ntry*nq - if (nr) 101,105,101 - 105 nf = nf+1 - jfac(nf+2) = ntry - nl = nq - if (ntry .ne. 2) go to 107 - if (nf .eq. 1) go to 107 - do 106 i=2,nf - ib = nf-i+2 - jfac(ib+2) = jfac(ib+1) - 106 continue - jfac(3) = 2 - 107 if (nl .ne. 1) go to 104 - jfac(1) = n - jfac(2) = nf - tpi = 6.28318530717959 - argh = tpi/float(n) - is = 0 - nfm1 = nf-1 - l1 = 1 - if (nfm1 .eq. 0) return - do 110 k1=1,nfm1 - ip = jfac(k1+2) - ld = 0 - l2 = l1*ip - ido = n/l2 - ipm = ip-1 - do 109 j=1,ipm - ld = ld+l1 - i = is - argld = float(ld)*argh - fi = 0. - do 108 ii=3,ido,2 - i = i+2 - fi = fi+1. - arg = fi*argld - wa(i-1) = cos(arg) - wa(i) = sin(arg) - 108 continue - is = is+ido - 109 continue - l1 = l2 - 110 continue - do 111 i = 1, 15 - xxifac(i) = rfac(i) - 111 continue - return - end - - - - subroutine frfftf (n,r,wsave) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension r(*) ,wsave(*) - if (n .eq. 1) return - call frfftf1 (n,r,wsave,wsave(n+1),wsave(2*n+1)) - return - end - subroutine frfftf1 (n,c,ch,wa,xxifac) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(*) ,c(*) ,wa(*) ,xxifac(*) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nf = jfac(2) - na = 1 - l2 = n - iw = n - do 111 k1=1,nf - kh = nf-k1 - ip = jfac(kh+3) - l1 = l2/ip - ido = n/l2 - idl1 = ido*l1 - iw = iw-(ip-1)*ido - na = 1-na - if (ip .ne. 4) go to 102 - ix2 = iw+ido - ix3 = ix2+ido - if (na .ne. 0) go to 101 - call fradf4 (ido,l1,c,ch,wa(iw),wa(ix2),wa(ix3)) - go to 110 - 101 call fradf4 (ido,l1,ch,c,wa(iw),wa(ix2),wa(ix3)) - go to 110 - 102 if (ip .ne. 2) go to 104 - if (na .ne. 0) go to 103 - call fradf2 (ido,l1,c,ch,wa(iw)) - go to 110 - 103 call fradf2 (ido,l1,ch,c,wa(iw)) - go to 110 - 104 if (ip .ne. 3) go to 106 - ix2 = iw+ido - if (na .ne. 0) go to 105 - call fradf3 (ido,l1,c,ch,wa(iw),wa(ix2)) - go to 110 - 105 call fradf3 (ido,l1,ch,c,wa(iw),wa(ix2)) - go to 110 - 106 if (ip .ne. 5) go to 108 - ix2 = iw+ido - ix3 = ix2+ido - ix4 = ix3+ido - if (na .ne. 0) go to 107 - call fradf5 (ido,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 110 - 107 call fradf5 (ido,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 110 - 108 if (ido .eq. 1) na = 1-na - if (na .ne. 0) go to 109 - call fradfg (ido,ip,l1,idl1,c,c,c,ch,ch,wa(iw)) - na = 1 - go to 110 - 109 call fradfg (ido,ip,l1,idl1,ch,ch,ch,c,c,wa(iw)) - na = 0 - 110 l2 = l1 - 111 continue - if (na .eq. 1) return - do 112 i=1,n - c(i) = ch(i) - 112 continue - return - end - subroutine fradfg (ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,l1,ip) ,cc(ido,ip,l1) , - 1 c1(ido,l1,ip) ,c2(idl1,ip), - 2 ch2(idl1,ip) ,wa(*) - data tpi/6.28318530717959/ - arg = tpi/float(ip) - dcp = cos(arg) - dsp = sin(arg) - ipph = (ip+1)/2 - ipp2 = ip+2 - idp2 = ido+2 - nbd = (ido-1)/2 - if (ido .eq. 1) go to 119 - do 101 ik=1,idl1 - ch2(ik,1) = c2(ik,1) - 101 continue - do 103 j=2,ip - do 102 k=1,l1 - ch(1,k,j) = c1(1,k,j) - 102 continue - 103 continue - if (nbd .gt. l1) go to 107 - is = -ido - do 106 j=2,ip - is = is+ido - idij = is - do 105 i=3,ido,2 - idij = idij+2 - do 104 k=1,l1 - ch(i-1,k,j) = wa(idij-1)*c1(i-1,k,j)+wa(idij)*c1(i,k,j) - ch(i,k,j) = wa(idij-1)*c1(i,k,j)-wa(idij)*c1(i-1,k,j) - 104 continue - 105 continue - 106 continue - go to 111 - 107 is = -ido - do 110 j=2,ip - is = is+ido - do 109 k=1,l1 - idij = is - do 108 i=3,ido,2 - idij = idij+2 - ch(i-1,k,j) = wa(idij-1)*c1(i-1,k,j)+wa(idij)*c1(i,k,j) - ch(i,k,j) = wa(idij-1)*c1(i,k,j)-wa(idij)*c1(i-1,k,j) - 108 continue - 109 continue - 110 continue - 111 if (nbd .lt. l1) go to 115 - do 114 j=2,ipph - jc = ipp2-j - do 113 k=1,l1 - do 112 i=3,ido,2 - c1(i-1,k,j) = ch(i-1,k,j)+ch(i-1,k,jc) - c1(i-1,k,jc) = ch(i,k,j)-ch(i,k,jc) - c1(i,k,j) = ch(i,k,j)+ch(i,k,jc) - c1(i,k,jc) = ch(i-1,k,jc)-ch(i-1,k,j) - 112 continue - 113 continue - 114 continue - go to 121 - 115 do 118 j=2,ipph - jc = ipp2-j - do 117 i=3,ido,2 - do 116 k=1,l1 - c1(i-1,k,j) = ch(i-1,k,j)+ch(i-1,k,jc) - c1(i-1,k,jc) = ch(i,k,j)-ch(i,k,jc) - c1(i,k,j) = ch(i,k,j)+ch(i,k,jc) - c1(i,k,jc) = ch(i-1,k,jc)-ch(i-1,k,j) - 116 continue - 117 continue - 118 continue - go to 121 - 119 do 120 ik=1,idl1 - c2(ik,1) = ch2(ik,1) - 120 continue - 121 do 123 j=2,ipph - jc = ipp2-j - do 122 k=1,l1 - c1(1,k,j) = ch(1,k,j)+ch(1,k,jc) - c1(1,k,jc) = ch(1,k,jc)-ch(1,k,j) - 122 continue - 123 continue -c - ar1 = 1. - ai1 = 0. - do 127 l=2,ipph - lc = ipp2-l - ar1h = dcp*ar1-dsp*ai1 - ai1 = dcp*ai1+dsp*ar1 - ar1 = ar1h - do 124 ik=1,idl1 - ch2(ik,l) = c2(ik,1)+ar1*c2(ik,2) - ch2(ik,lc) = ai1*c2(ik,ip) - 124 continue - dc2 = ar1 - ds2 = ai1 - ar2 = ar1 - ai2 = ai1 - do 126 j=3,ipph - jc = ipp2-j - ar2h = dc2*ar2-ds2*ai2 - ai2 = dc2*ai2+ds2*ar2 - ar2 = ar2h - do 125 ik=1,idl1 - ch2(ik,l) = ch2(ik,l)+ar2*c2(ik,j) - ch2(ik,lc) = ch2(ik,lc)+ai2*c2(ik,jc) - 125 continue - 126 continue - 127 continue - do 129 j=2,ipph - do 128 ik=1,idl1 - ch2(ik,1) = ch2(ik,1)+c2(ik,j) - 128 continue - 129 continue -c - if (ido .lt. l1) go to 132 - do 131 k=1,l1 - do 130 i=1,ido - cc(i,1,k) = ch(i,k,1) - 130 continue - 131 continue - go to 135 - 132 do 134 i=1,ido - do 133 k=1,l1 - cc(i,1,k) = ch(i,k,1) - 133 continue - 134 continue - 135 do 137 j=2,ipph - jc = ipp2-j - j2 = j+j - do 136 k=1,l1 - cc(ido,j2-2,k) = ch(1,k,j) - cc(1,j2-1,k) = ch(1,k,jc) - 136 continue - 137 continue - if (ido .eq. 1) return - if (nbd .lt. l1) go to 141 - do 140 j=2,ipph - jc = ipp2-j - j2 = j+j - do 139 k=1,l1 - do 138 i=3,ido,2 - ic = idp2-i - cc(i-1,j2-1,k) = ch(i-1,k,j)+ch(i-1,k,jc) - cc(ic-1,j2-2,k) = ch(i-1,k,j)-ch(i-1,k,jc) - cc(i,j2-1,k) = ch(i,k,j)+ch(i,k,jc) - cc(ic,j2-2,k) = ch(i,k,jc)-ch(i,k,j) - 138 continue - 139 continue - 140 continue - return - 141 do 144 j=2,ipph - jc = ipp2-j - j2 = j+j - do 143 i=3,ido,2 - ic = idp2-i - do 142 k=1,l1 - cc(i-1,j2-1,k) = ch(i-1,k,j)+ch(i-1,k,jc) - cc(ic-1,j2-2,k) = ch(i-1,k,j)-ch(i-1,k,jc) - cc(i,j2-1,k) = ch(i,k,j)+ch(i,k,jc) - cc(ic,j2-2,k) = ch(i,k,jc)-ch(i,k,j) - 142 continue - 143 continue - 144 continue - return - end - subroutine fradf5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,l1,5) ,ch(ido,5,l1) , - 1 wa1(*) ,wa2(*) ,wa3(*) ,wa4(*) - data tr11,ti11,tr12,ti12 /.309016994374947,.951056516295154, - 1-.809016994374947,.587785252292473/ - do 101 k=1,l1 - cr2 = cc(1,k,5)+cc(1,k,2) - ci5 = cc(1,k,5)-cc(1,k,2) - cr3 = cc(1,k,4)+cc(1,k,3) - ci4 = cc(1,k,4)-cc(1,k,3) - ch(1,1,k) = cc(1,k,1)+cr2+cr3 - ch(ido,2,k) = cc(1,k,1)+tr11*cr2+tr12*cr3 - ch(1,3,k) = ti11*ci5+ti12*ci4 - ch(ido,4,k) = cc(1,k,1)+tr12*cr2+tr11*cr3 - ch(1,5,k) = ti12*ci5-ti11*ci4 - 101 continue - if (ido .eq. 1) return - idp2 = ido+2 - do 103 k=1,l1 - do 102 i=3,ido,2 - ic = idp2-i - dr2 = wa1(i-2)*cc(i-1,k,2)+wa1(i-1)*cc(i,k,2) - di2 = wa1(i-2)*cc(i,k,2)-wa1(i-1)*cc(i-1,k,2) - dr3 = wa2(i-2)*cc(i-1,k,3)+wa2(i-1)*cc(i,k,3) - di3 = wa2(i-2)*cc(i,k,3)-wa2(i-1)*cc(i-1,k,3) - dr4 = wa3(i-2)*cc(i-1,k,4)+wa3(i-1)*cc(i,k,4) - di4 = wa3(i-2)*cc(i,k,4)-wa3(i-1)*cc(i-1,k,4) - dr5 = wa4(i-2)*cc(i-1,k,5)+wa4(i-1)*cc(i,k,5) - di5 = wa4(i-2)*cc(i,k,5)-wa4(i-1)*cc(i-1,k,5) - cr2 = dr2+dr5 - ci5 = dr5-dr2 - cr5 = di2-di5 - ci2 = di2+di5 - cr3 = dr3+dr4 - ci4 = dr4-dr3 - cr4 = di3-di4 - ci3 = di3+di4 - ch(i-1,1,k) = cc(i-1,k,1)+cr2+cr3 - ch(i,1,k) = cc(i,k,1)+ci2+ci3 - tr2 = cc(i-1,k,1)+tr11*cr2+tr12*cr3 - ti2 = cc(i,k,1)+tr11*ci2+tr12*ci3 - tr3 = cc(i-1,k,1)+tr12*cr2+tr11*cr3 - ti3 = cc(i,k,1)+tr12*ci2+tr11*ci3 - tr5 = ti11*cr5+ti12*cr4 - ti5 = ti11*ci5+ti12*ci4 - tr4 = ti12*cr5-ti11*cr4 - ti4 = ti12*ci5-ti11*ci4 - ch(i-1,3,k) = tr2+tr5 - ch(ic-1,2,k) = tr2-tr5 - ch(i,3,k) = ti2+ti5 - ch(ic,2,k) = ti5-ti2 - ch(i-1,5,k) = tr3+tr4 - ch(ic-1,4,k) = tr3-tr4 - ch(i,5,k) = ti3+ti4 - ch(ic,4,k) = ti4-ti3 - 102 continue - 103 continue - return - end - subroutine fradf3 (ido,l1,cc,ch,wa1,wa2) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,3,l1) ,cc(ido,l1,3) , - 1 wa1(*) ,wa2(*) - data taur,taui /-.5,.866025403784439/ - do 101 k=1,l1 - cr2 = cc(1,k,2)+cc(1,k,3) - ch(1,1,k) = cc(1,k,1)+cr2 - ch(1,3,k) = taui*(cc(1,k,3)-cc(1,k,2)) - ch(ido,2,k) = cc(1,k,1)+taur*cr2 - 101 continue - if (ido .eq. 1) return - idp2 = ido+2 - do 103 k=1,l1 - do 102 i=3,ido,2 - ic = idp2-i - dr2 = wa1(i-2)*cc(i-1,k,2)+wa1(i-1)*cc(i,k,2) - di2 = wa1(i-2)*cc(i,k,2)-wa1(i-1)*cc(i-1,k,2) - dr3 = wa2(i-2)*cc(i-1,k,3)+wa2(i-1)*cc(i,k,3) - di3 = wa2(i-2)*cc(i,k,3)-wa2(i-1)*cc(i-1,k,3) - cr2 = dr2+dr3 - ci2 = di2+di3 - ch(i-1,1,k) = cc(i-1,k,1)+cr2 - ch(i,1,k) = cc(i,k,1)+ci2 - tr2 = cc(i-1,k,1)+taur*cr2 - ti2 = cc(i,k,1)+taur*ci2 - tr3 = taui*(di2-di3) - ti3 = taui*(dr3-dr2) - ch(i-1,3,k) = tr2+tr3 - ch(ic-1,2,k) = tr2-tr3 - ch(i,3,k) = ti2+ti3 - ch(ic,2,k) = ti3-ti2 - 102 continue - 103 continue - return - end - subroutine fradf2 (ido,l1,cc,ch,wa1) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,2,l1) ,cc(ido,l1,2) , - 1 wa1(*) - do 101 k=1,l1 - ch(1,1,k) = cc(1,k,1)+cc(1,k,2) - ch(ido,2,k) = cc(1,k,1)-cc(1,k,2) - 101 continue - if (ido-2) 107,105,102 - 102 idp2 = ido+2 - do 104 k=1,l1 - do 103 i=3,ido,2 - ic = idp2-i - tr2 = wa1(i-2)*cc(i-1,k,2)+wa1(i-1)*cc(i,k,2) - ti2 = wa1(i-2)*cc(i,k,2)-wa1(i-1)*cc(i-1,k,2) - ch(i,1,k) = cc(i,k,1)+ti2 - ch(ic,2,k) = ti2-cc(i,k,1) - ch(i-1,1,k) = cc(i-1,k,1)+tr2 - ch(ic-1,2,k) = cc(i-1,k,1)-tr2 - 103 continue - 104 continue - if (mod(ido,2) .eq. 1) return - 105 do 106 k=1,l1 - ch(1,2,k) = -cc(ido,k,2) - ch(ido,1,k) = cc(ido,k,1) - 106 continue - 107 return - end - subroutine fradf4 (ido,l1,cc,ch,wa1,wa2,wa3) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,l1,4) ,ch(ido,4,l1) , - 1 wa1(*) ,wa2(*) ,wa3(*) - data hsqt2 /.7071067811865475/ - do 101 k=1,l1 - tr1 = cc(1,k,2)+cc(1,k,4) - tr2 = cc(1,k,1)+cc(1,k,3) - ch(1,1,k) = tr1+tr2 - ch(ido,4,k) = tr2-tr1 - ch(ido,2,k) = cc(1,k,1)-cc(1,k,3) - ch(1,3,k) = cc(1,k,4)-cc(1,k,2) - 101 continue - if (ido-2) 107,105,102 - 102 idp2 = ido+2 - do 104 k=1,l1 - do 103 i=3,ido,2 - ic = idp2-i - cr2 = wa1(i-2)*cc(i-1,k,2)+wa1(i-1)*cc(i,k,2) - ci2 = wa1(i-2)*cc(i,k,2)-wa1(i-1)*cc(i-1,k,2) - cr3 = wa2(i-2)*cc(i-1,k,3)+wa2(i-1)*cc(i,k,3) - ci3 = wa2(i-2)*cc(i,k,3)-wa2(i-1)*cc(i-1,k,3) - cr4 = wa3(i-2)*cc(i-1,k,4)+wa3(i-1)*cc(i,k,4) - ci4 = wa3(i-2)*cc(i,k,4)-wa3(i-1)*cc(i-1,k,4) - tr1 = cr2+cr4 - tr4 = cr4-cr2 - ti1 = ci2+ci4 - ti4 = ci2-ci4 - ti2 = cc(i,k,1)+ci3 - ti3 = cc(i,k,1)-ci3 - tr2 = cc(i-1,k,1)+cr3 - tr3 = cc(i-1,k,1)-cr3 - ch(i-1,1,k) = tr1+tr2 - ch(ic-1,4,k) = tr2-tr1 - ch(i,1,k) = ti1+ti2 - ch(ic,4,k) = ti1-ti2 - ch(i-1,3,k) = ti4+tr3 - ch(ic-1,2,k) = tr3-ti4 - ch(i,3,k) = tr4+ti3 - ch(ic,2,k) = tr4-ti3 - 103 continue - 104 continue - if (mod(ido,2) .eq. 1) return - 105 continue - do 106 k=1,l1 - ti1 = -hsqt2*(cc(ido,k,2)+cc(ido,k,4)) - tr1 = hsqt2*(cc(ido,k,2)-cc(ido,k,4)) - ch(ido,1,k) = tr1+cc(ido,k,1) - ch(ido,3,k) = cc(ido,k,1)-tr1 - ch(1,2,k) = ti1-cc(ido,k,3) - ch(1,4,k) = ti1+cc(ido,k,3) - 106 continue - 107 return - end - - - - subroutine frfftb (n,r,wsave) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension r(*) ,wsave(*) - if (n .eq. 1) return - call frfftb1 (n,r,wsave,wsave(n+1),wsave(2*n+1)) - return - end - subroutine frfftb1 (n,c,ch,wa,xxifac) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(*) ,c(*) ,wa(*) ,xxifac(*) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nf = jfac(2) - na = 0 - l1 = 1 - iw = 1 - do 116 k1=1,nf - ip = jfac(k1+2) - l2 = ip*l1 - ido = n/l2 - idl1 = ido*l1 - if (ip .ne. 4) go to 103 - ix2 = iw+ido - ix3 = ix2+ido - if (na .ne. 0) go to 101 - call fradb4 (ido,l1,c,ch,wa(iw),wa(ix2),wa(ix3)) - go to 102 - 101 call fradb4 (ido,l1,ch,c,wa(iw),wa(ix2),wa(ix3)) - 102 na = 1-na - go to 115 - 103 if (ip .ne. 2) go to 106 - if (na .ne. 0) go to 104 - call fradb2 (ido,l1,c,ch,wa(iw)) - go to 105 - 104 call fradb2 (ido,l1,ch,c,wa(iw)) - 105 na = 1-na - go to 115 - 106 if (ip .ne. 3) go to 109 - ix2 = iw+ido - if (na .ne. 0) go to 107 - call fradb3 (ido,l1,c,ch,wa(iw),wa(ix2)) - go to 108 - 107 call fradb3 (ido,l1,ch,c,wa(iw),wa(ix2)) - 108 na = 1-na - go to 115 - 109 if (ip .ne. 5) go to 112 - ix2 = iw+ido - ix3 = ix2+ido - ix4 = ix3+ido - if (na .ne. 0) go to 110 - call fradb5 (ido,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 111 - 110 call fradb5 (ido,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - 111 na = 1-na - go to 115 - 112 if (na .ne. 0) go to 113 - call fradbg (ido,ip,l1,idl1,c,c,c,ch,ch,wa(iw)) - go to 114 - 113 call fradbg (ido,ip,l1,idl1,ch,ch,ch,c,c,wa(iw)) - 114 if (ido .eq. 1) na = 1-na - 115 l1 = l2 - iw = iw+(ip-1)*ido - 116 continue - if (na .eq. 0) return - do 117 i=1,n - c(i) = ch(i) - 117 continue - return - end - subroutine fradbg (ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,l1,ip) ,cc(ido,ip,l1) , - 1 c1(ido,l1,ip) ,c2(idl1,ip), - 2 ch2(idl1,ip) ,wa(*) - data tpi/6.28318530717959/ - arg = tpi/float(ip) - dcp = cos(arg) - dsp = sin(arg) - idp2 = ido+2 - nbd = (ido-1)/2 - ipp2 = ip+2 - ipph = (ip+1)/2 - if (ido .lt. l1) go to 103 - do 102 k=1,l1 - do 101 i=1,ido - ch(i,k,1) = cc(i,1,k) - 101 continue - 102 continue - go to 106 - 103 do 105 i=1,ido - do 104 k=1,l1 - ch(i,k,1) = cc(i,1,k) - 104 continue - 105 continue - 106 do 108 j=2,ipph - jc = ipp2-j - j2 = j+j - do 107 k=1,l1 - ch(1,k,j) = cc(ido,j2-2,k)+cc(ido,j2-2,k) - ch(1,k,jc) = cc(1,j2-1,k)+cc(1,j2-1,k) - 107 continue - 108 continue - if (ido .eq. 1) go to 116 - if (nbd .lt. l1) go to 112 - do 111 j=2,ipph - jc = ipp2-j - do 110 k=1,l1 - do 109 i=3,ido,2 - ic = idp2-i - ch(i-1,k,j) = cc(i-1,2*j-1,k)+cc(ic-1,2*j-2,k) - ch(i-1,k,jc) = cc(i-1,2*j-1,k)-cc(ic-1,2*j-2,k) - ch(i,k,j) = cc(i,2*j-1,k)-cc(ic,2*j-2,k) - ch(i,k,jc) = cc(i,2*j-1,k)+cc(ic,2*j-2,k) - 109 continue - 110 continue - 111 continue - go to 116 - 112 do 115 j=2,ipph - jc = ipp2-j - do 114 i=3,ido,2 - ic = idp2-i - do 113 k=1,l1 - ch(i-1,k,j) = cc(i-1,2*j-1,k)+cc(ic-1,2*j-2,k) - ch(i-1,k,jc) = cc(i-1,2*j-1,k)-cc(ic-1,2*j-2,k) - ch(i,k,j) = cc(i,2*j-1,k)-cc(ic,2*j-2,k) - ch(i,k,jc) = cc(i,2*j-1,k)+cc(ic,2*j-2,k) - 113 continue - 114 continue - 115 continue - 116 ar1 = 1. - ai1 = 0. - do 120 l=2,ipph - lc = ipp2-l - ar1h = dcp*ar1-dsp*ai1 - ai1 = dcp*ai1+dsp*ar1 - ar1 = ar1h - do 117 ik=1,idl1 - c2(ik,l) = ch2(ik,1)+ar1*ch2(ik,2) - c2(ik,lc) = ai1*ch2(ik,ip) - 117 continue - dc2 = ar1 - ds2 = ai1 - ar2 = ar1 - ai2 = ai1 - do 119 j=3,ipph - jc = ipp2-j - ar2h = dc2*ar2-ds2*ai2 - ai2 = dc2*ai2+ds2*ar2 - ar2 = ar2h - do 118 ik=1,idl1 - c2(ik,l) = c2(ik,l)+ar2*ch2(ik,j) - c2(ik,lc) = c2(ik,lc)+ai2*ch2(ik,jc) - 118 continue - 119 continue - 120 continue - do 122 j=2,ipph - do 121 ik=1,idl1 - ch2(ik,1) = ch2(ik,1)+ch2(ik,j) - 121 continue - 122 continue - do 124 j=2,ipph - jc = ipp2-j - do 123 k=1,l1 - ch(1,k,j) = c1(1,k,j)-c1(1,k,jc) - ch(1,k,jc) = c1(1,k,j)+c1(1,k,jc) - 123 continue - 124 continue - if (ido .eq. 1) go to 132 - if (nbd .lt. l1) go to 128 - do 127 j=2,ipph - jc = ipp2-j - do 126 k=1,l1 - do 125 i=3,ido,2 - ch(i-1,k,j) = c1(i-1,k,j)-c1(i,k,jc) - ch(i-1,k,jc) = c1(i-1,k,j)+c1(i,k,jc) - ch(i,k,j) = c1(i,k,j)+c1(i-1,k,jc) - ch(i,k,jc) = c1(i,k,j)-c1(i-1,k,jc) - 125 continue - 126 continue - 127 continue - go to 132 - 128 do 131 j=2,ipph - jc = ipp2-j - do 130 i=3,ido,2 - do 129 k=1,l1 - ch(i-1,k,j) = c1(i-1,k,j)-c1(i,k,jc) - ch(i-1,k,jc) = c1(i-1,k,j)+c1(i,k,jc) - ch(i,k,j) = c1(i,k,j)+c1(i-1,k,jc) - ch(i,k,jc) = c1(i,k,j)-c1(i-1,k,jc) - 129 continue - 130 continue - 131 continue - 132 continue - if (ido .eq. 1) return - do 133 ik=1,idl1 - c2(ik,1) = ch2(ik,1) - 133 continue - do 135 j=2,ip - do 134 k=1,l1 - c1(1,k,j) = ch(1,k,j) - 134 continue - 135 continue - if (nbd .gt. l1) go to 139 - is = -ido - do 138 j=2,ip - is = is+ido - idij = is - do 137 i=3,ido,2 - idij = idij+2 - do 136 k=1,l1 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j) - 136 continue - 137 continue - 138 continue - go to 143 - 139 is = -ido - do 142 j=2,ip - is = is+ido - do 141 k=1,l1 - idij = is - do 140 i=3,ido,2 - idij = idij+2 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j) - 140 continue - 141 continue - 142 continue - 143 return - end - subroutine fradb5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,5,l1) ,ch(ido,l1,5) , - 1 wa1(*) ,wa2(*) ,wa3(*) ,wa4(*) - data tr11,ti11,tr12,ti12 /.309016994374947,.951056516295154, - 1-.809016994374947,.587785252292473/ - do 101 k=1,l1 - ti5 = cc(1,3,k)+cc(1,3,k) - ti4 = cc(1,5,k)+cc(1,5,k) - tr2 = cc(ido,2,k)+cc(ido,2,k) - tr3 = cc(ido,4,k)+cc(ido,4,k) - ch(1,k,1) = cc(1,1,k)+tr2+tr3 - cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3 - cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3 - ci5 = ti11*ti5+ti12*ti4 - ci4 = ti12*ti5-ti11*ti4 - ch(1,k,2) = cr2-ci5 - ch(1,k,3) = cr3-ci4 - ch(1,k,4) = cr3+ci4 - ch(1,k,5) = cr2+ci5 - 101 continue - if (ido .eq. 1) return - idp2 = ido+2 - do 103 k=1,l1 - do 102 i=3,ido,2 - ic = idp2-i - ti5 = cc(i,3,k)+cc(ic,2,k) - ti2 = cc(i,3,k)-cc(ic,2,k) - ti4 = cc(i,5,k)+cc(ic,4,k) - ti3 = cc(i,5,k)-cc(ic,4,k) - tr5 = cc(i-1,3,k)-cc(ic-1,2,k) - tr2 = cc(i-1,3,k)+cc(ic-1,2,k) - tr4 = cc(i-1,5,k)-cc(ic-1,4,k) - tr3 = cc(i-1,5,k)+cc(ic-1,4,k) - ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3 - ch(i,k,1) = cc(i,1,k)+ti2+ti3 - cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - dr3 = cr3-ci4 - dr4 = cr3+ci4 - di3 = ci3+cr4 - di4 = ci3-cr4 - dr5 = cr2+ci5 - dr2 = cr2-ci5 - di5 = ci2-cr5 - di2 = ci2+cr5 - ch(i-1,k,2) = wa1(i-2)*dr2-wa1(i-1)*di2 - ch(i,k,2) = wa1(i-2)*di2+wa1(i-1)*dr2 - ch(i-1,k,3) = wa2(i-2)*dr3-wa2(i-1)*di3 - ch(i,k,3) = wa2(i-2)*di3+wa2(i-1)*dr3 - ch(i-1,k,4) = wa3(i-2)*dr4-wa3(i-1)*di4 - ch(i,k,4) = wa3(i-2)*di4+wa3(i-1)*dr4 - ch(i-1,k,5) = wa4(i-2)*dr5-wa4(i-1)*di5 - ch(i,k,5) = wa4(i-2)*di5+wa4(i-1)*dr5 - 102 continue - 103 continue - return - end - subroutine fradb3 (ido,l1,cc,ch,wa1,wa2) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,3,l1) ,ch(ido,l1,3) , - 1 wa1(*) ,wa2(*) - data taur,taui /-.5,.866025403784439/ - do 101 k=1,l1 - tr2 = cc(ido,2,k)+cc(ido,2,k) - cr2 = cc(1,1,k)+taur*tr2 - ch(1,k,1) = cc(1,1,k)+tr2 - ci3 = taui*(cc(1,3,k)+cc(1,3,k)) - ch(1,k,2) = cr2-ci3 - ch(1,k,3) = cr2+ci3 - 101 continue - if (ido .eq. 1) return - idp2 = ido+2 - do 103 k=1,l1 - do 102 i=3,ido,2 - ic = idp2-i - tr2 = cc(i-1,3,k)+cc(ic-1,2,k) - cr2 = cc(i-1,1,k)+taur*tr2 - ch(i-1,k,1) = cc(i-1,1,k)+tr2 - ti2 = cc(i,3,k)-cc(ic,2,k) - ci2 = cc(i,1,k)+taur*ti2 - ch(i,k,1) = cc(i,1,k)+ti2 - cr3 = taui*(cc(i-1,3,k)-cc(ic-1,2,k)) - ci3 = taui*(cc(i,3,k)+cc(ic,2,k)) - dr2 = cr2-ci3 - dr3 = cr2+ci3 - di2 = ci2+cr3 - di3 = ci2-cr3 - ch(i-1,k,2) = wa1(i-2)*dr2-wa1(i-1)*di2 - ch(i,k,2) = wa1(i-2)*di2+wa1(i-1)*dr2 - ch(i-1,k,3) = wa2(i-2)*dr3-wa2(i-1)*di3 - ch(i,k,3) = wa2(i-2)*di3+wa2(i-1)*dr3 - 102 continue - 103 continue - return - end - subroutine fradb2 (ido,l1,cc,ch,wa1) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,2,l1) ,ch(ido,l1,2) , - 1 wa1(*) - do 101 k=1,l1 - ch(1,k,1) = cc(1,1,k)+cc(ido,2,k) - ch(1,k,2) = cc(1,1,k)-cc(ido,2,k) - 101 continue - if (ido-2) 107,105,102 - 102 idp2 = ido+2 - do 104 k=1,l1 - do 103 i=3,ido,2 - ic = idp2-i - ch(i-1,k,1) = cc(i-1,1,k)+cc(ic-1,2,k) - tr2 = cc(i-1,1,k)-cc(ic-1,2,k) - ch(i,k,1) = cc(i,1,k)-cc(ic,2,k) - ti2 = cc(i,1,k)+cc(ic,2,k) - ch(i-1,k,2) = wa1(i-2)*tr2-wa1(i-1)*ti2 - ch(i,k,2) = wa1(i-2)*ti2+wa1(i-1)*tr2 - 103 continue - 104 continue - if (mod(ido,2) .eq. 1) return - 105 do 106 k=1,l1 - ch(ido,k,1) = cc(ido,1,k)+cc(ido,1,k) - ch(ido,k,2) = -(cc(1,2,k)+cc(1,2,k)) - 106 continue - 107 return - end - subroutine fradb4 (ido,l1,cc,ch,wa1,wa2,wa3) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,4,l1) ,ch(ido,l1,4) , - 1 wa1(*) ,wa2(*) ,wa3(*) - data sqrt2 /1.414213562373095/ - do 101 k=1,l1 - tr1 = cc(1,1,k)-cc(ido,4,k) - tr2 = cc(1,1,k)+cc(ido,4,k) - tr3 = cc(ido,2,k)+cc(ido,2,k) - tr4 = cc(1,3,k)+cc(1,3,k) - ch(1,k,1) = tr2+tr3 - ch(1,k,2) = tr1-tr4 - ch(1,k,3) = tr2-tr3 - ch(1,k,4) = tr1+tr4 - 101 continue - if (ido-2) 107,105,102 - 102 idp2 = ido+2 - do 104 k=1,l1 - do 103 i=3,ido,2 - ic = idp2-i - ti1 = cc(i,1,k)+cc(ic,4,k) - ti2 = cc(i,1,k)-cc(ic,4,k) - ti3 = cc(i,3,k)-cc(ic,2,k) - tr4 = cc(i,3,k)+cc(ic,2,k) - tr1 = cc(i-1,1,k)-cc(ic-1,4,k) - tr2 = cc(i-1,1,k)+cc(ic-1,4,k) - ti4 = cc(i-1,3,k)-cc(ic-1,2,k) - tr3 = cc(i-1,3,k)+cc(ic-1,2,k) - ch(i-1,k,1) = tr2+tr3 - cr3 = tr2-tr3 - ch(i,k,1) = ti2+ti3 - ci3 = ti2-ti3 - cr2 = tr1-tr4 - cr4 = tr1+tr4 - ci2 = ti1+ti4 - ci4 = ti1-ti4 - ch(i-1,k,2) = wa1(i-2)*cr2-wa1(i-1)*ci2 - ch(i,k,2) = wa1(i-2)*ci2+wa1(i-1)*cr2 - ch(i-1,k,3) = wa2(i-2)*cr3-wa2(i-1)*ci3 - ch(i,k,3) = wa2(i-2)*ci3+wa2(i-1)*cr3 - ch(i-1,k,4) = wa3(i-2)*cr4-wa3(i-1)*ci4 - ch(i,k,4) = wa3(i-2)*ci4+wa3(i-1)*cr4 - 103 continue - 104 continue - if (mod(ido,2) .eq. 1) return - 105 continue - do 106 k=1,l1 - ti1 = cc(1,2,k)+cc(1,4,k) - ti2 = cc(1,4,k)-cc(1,2,k) - tr1 = cc(ido,1,k)-cc(ido,3,k) - tr2 = cc(ido,1,k)+cc(ido,3,k) - ch(ido,k,1) = tr2+tr2 - ch(ido,k,2) = sqrt2*(tr1-ti1) - ch(ido,k,3) = ti2+ti2 - ch(ido,k,4) = -sqrt2*(tr1+ti1) - 106 continue - 107 return - end - - - - subroutine fcffti (n,wsave) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wsave(*) - if (n .eq. 1) return - iw1 = n+n+1 - iw2 = iw1+n+n - call fcffti1 (n,wsave(iw1),wsave(iw2)) - return - end - subroutine fcffti1 (n,wa,xxifac) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wa(*) ,xxifac(*) ,ntryh(4) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - data ntryh(1),ntryh(2),ntryh(3),ntryh(4)/3,4,2,5/ - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nl = n - nf = 0 - j = 0 - 101 j = j+1 - if (j-4) 102,102,103 - 102 ntry = ntryh(j) - go to 104 - 103 ntry = ntry+2 - 104 nq = nl/ntry - nr = nl-ntry*nq - if (nr) 101,105,101 - 105 nf = nf+1 - jfac(nf+2) = ntry - nl = nq - if (ntry .ne. 2) go to 107 - if (nf .eq. 1) go to 107 - do 106 i=2,nf - ib = nf-i+2 - jfac(ib+2) = jfac(ib+1) - 106 continue - jfac(3) = 2 - 107 if (nl .ne. 1) go to 104 - jfac(1) = n - jfac(2) = nf - tpi = 6.28318530717959 - argh = tpi/float(n) - i = 2 - l1 = 1 - do 110 k1=1,nf - ip = jfac(k1+2) - ld = 0 - l2 = l1*ip - ido = n/l2 - idot = ido+ido+2 - ipm = ip-1 - do 109 j=1,ipm - i1 = i - wa(i-1) = 1. - wa(i) = 0. - ld = ld+l1 - fi = 0. - argld = float(ld)*argh - do 108 ii=4,idot,2 - i = i+2 - fi = fi+1. - arg = fi*argld - wa(i-1) = cos(arg) - wa(i) = sin(arg) - 108 continue - if (ip .le. 5) go to 109 - wa(i1-1) = wa(i-1) - wa(i1) = wa(i) - 109 continue - l1 = l2 - 110 continue - do 111 i = 1, 15 - xxifac(i) = rfac(i) - 111 continue - return - end - - - - subroutine fcfftf (n,c,wsave) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension c(*) ,wsave(*) - if (n .eq. 1) return - iw1 = n+n+1 - iw2 = iw1+n+n - call fcfftf1 (n,c,wsave,wsave(iw1),wsave(iw2)) - return - end - subroutine fcfftf1 (n,c,ch,wa,xxifac) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(*) ,c(*) ,wa(*) ,xxifac(*) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nf = jfac(2) - na = 0 - l1 = 1 - iw = 1 - do 116 k1=1,nf - ip = jfac(k1+2) - l2 = ip*l1 - ido = n/l2 - idot = ido+ido - idl1 = idot*l1 - if (ip .ne. 4) go to 103 - ix2 = iw+idot - ix3 = ix2+idot - if (na .ne. 0) go to 101 - call fpassf4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3)) - go to 102 - 101 call fpassf4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3)) - 102 na = 1-na - go to 115 - 103 if (ip .ne. 2) go to 106 - if (na .ne. 0) go to 104 - call fpassf2 (idot,l1,c,ch,wa(iw)) - go to 105 - 104 call fpassf2 (idot,l1,ch,c,wa(iw)) - 105 na = 1-na - go to 115 - 106 if (ip .ne. 3) go to 109 - ix2 = iw+idot - if (na .ne. 0) go to 107 - call fpassf3 (idot,l1,c,ch,wa(iw),wa(ix2)) - go to 108 - 107 call fpassf3 (idot,l1,ch,c,wa(iw),wa(ix2)) - 108 na = 1-na - go to 115 - 109 if (ip .ne. 5) go to 112 - ix2 = iw+idot - ix3 = ix2+idot - ix4 = ix3+idot - if (na .ne. 0) go to 110 - call fpassf5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 111 - 110 call fpassf5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - 111 na = 1-na - go to 115 - 112 if (na .ne. 0) go to 113 - call fpassf (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw)) - go to 114 - 113 call fpassf (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw)) - 114 if (nac .ne. 0) na = 1-na - 115 l1 = l2 - iw = iw+(ip-1)*idot - 116 continue - if (na .eq. 0) return - n2 = n+n - do 117 i=1,n2 - c(i) = ch(i) - 117 continue - return - end - subroutine fpassf (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,l1,ip) ,cc(ido,ip,l1) , - 1 c1(ido,l1,ip) ,wa(*) ,c2(idl1,ip), - 2 ch2(idl1,ip) - idot = ido/2 - nt = ip*idl1 - ipp2 = ip+2 - ipph = (ip+1)/2 - idp = ip*ido -c - if (ido .lt. l1) go to 106 - do 103 j=2,ipph - jc = ipp2-j - do 102 k=1,l1 - do 101 i=1,ido - ch(i,k,j) = cc(i,j,k)+cc(i,jc,k) - ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k) - 101 continue - 102 continue - 103 continue - do 105 k=1,l1 - do 104 i=1,ido - ch(i,k,1) = cc(i,1,k) - 104 continue - 105 continue - go to 112 - 106 do 109 j=2,ipph - jc = ipp2-j - do 108 i=1,ido - do 107 k=1,l1 - ch(i,k,j) = cc(i,j,k)+cc(i,jc,k) - ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k) - 107 continue - 108 continue - 109 continue - do 111 i=1,ido - do 110 k=1,l1 - ch(i,k,1) = cc(i,1,k) - 110 continue - 111 continue - 112 idl = 2-ido - inc = 0 - do 116 l=2,ipph - lc = ipp2-l - idl = idl+ido - do 113 ik=1,idl1 - c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2) - c2(ik,lc) = -wa(idl)*ch2(ik,ip) - 113 continue - idlj = idl - inc = inc+ido - do 115 j=3,ipph - jc = ipp2-j - idlj = idlj+inc - if (idlj .gt. idp) idlj = idlj-idp - war = wa(idlj-1) - wai = wa(idlj) - do 114 ik=1,idl1 - c2(ik,l) = c2(ik,l)+war*ch2(ik,j) - c2(ik,lc) = c2(ik,lc)-wai*ch2(ik,jc) - 114 continue - 115 continue - 116 continue - do 118 j=2,ipph - do 117 ik=1,idl1 - ch2(ik,1) = ch2(ik,1)+ch2(ik,j) - 117 continue - 118 continue - do 120 j=2,ipph - jc = ipp2-j - do 119 ik=2,idl1,2 - ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc) - ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc) - ch2(ik,j) = c2(ik,j)+c2(ik-1,jc) - ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc) - 119 continue - 120 continue - nac = 1 - if (ido .eq. 2) return - nac = 0 - do 121 ik=1,idl1 - c2(ik,1) = ch2(ik,1) - 121 continue - do 123 j=2,ip - do 122 k=1,l1 - c1(1,k,j) = ch(1,k,j) - c1(2,k,j) = ch(2,k,j) - 122 continue - 123 continue - if (idot .gt. l1) go to 127 - idij = 0 - do 126 j=2,ip - idij = idij+2 - do 125 i=4,ido,2 - idij = idij+2 - do 124 k=1,l1 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j) - 124 continue - 125 continue - 126 continue - return - 127 idj = 2-ido - do 130 j=2,ip - idj = idj+ido - do 129 k=1,l1 - idij = idj - do 128 i=4,ido,2 - idij = idij+2 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)+wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)-wa(idij)*ch(i-1,k,j) - 128 continue - 129 continue - 130 continue - return - end - subroutine fpassf5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,5,l1) ,ch(ido,l1,5) , - 1 wa1(*) ,wa2(*) ,wa3(*) ,wa4(*) - data tr11,ti11,tr12,ti12 /.309016994374947,-.951056516295154, - 1-.809016994374947,-.587785252292473/ - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - ti5 = cc(2,2,k)-cc(2,5,k) - ti2 = cc(2,2,k)+cc(2,5,k) - ti4 = cc(2,3,k)-cc(2,4,k) - ti3 = cc(2,3,k)+cc(2,4,k) - tr5 = cc(1,2,k)-cc(1,5,k) - tr2 = cc(1,2,k)+cc(1,5,k) - tr4 = cc(1,3,k)-cc(1,4,k) - tr3 = cc(1,3,k)+cc(1,4,k) - ch(1,k,1) = cc(1,1,k)+tr2+tr3 - ch(2,k,1) = cc(2,1,k)+ti2+ti3 - cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - ch(1,k,2) = cr2-ci5 - ch(1,k,5) = cr2+ci5 - ch(2,k,2) = ci2+cr5 - ch(2,k,3) = ci3+cr4 - ch(1,k,3) = cr3-ci4 - ch(1,k,4) = cr3+ci4 - ch(2,k,4) = ci3-cr4 - ch(2,k,5) = ci2-cr5 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ti5 = cc(i,2,k)-cc(i,5,k) - ti2 = cc(i,2,k)+cc(i,5,k) - ti4 = cc(i,3,k)-cc(i,4,k) - ti3 = cc(i,3,k)+cc(i,4,k) - tr5 = cc(i-1,2,k)-cc(i-1,5,k) - tr2 = cc(i-1,2,k)+cc(i-1,5,k) - tr4 = cc(i-1,3,k)-cc(i-1,4,k) - tr3 = cc(i-1,3,k)+cc(i-1,4,k) - ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3 - ch(i,k,1) = cc(i,1,k)+ti2+ti3 - cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - dr3 = cr3-ci4 - dr4 = cr3+ci4 - di3 = ci3+cr4 - di4 = ci3-cr4 - dr5 = cr2+ci5 - dr2 = cr2-ci5 - di5 = ci2-cr5 - di2 = ci2+cr5 - ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2 - ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2 - ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3 - ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3 - ch(i-1,k,4) = wa3(i-1)*dr4+wa3(i)*di4 - ch(i,k,4) = wa3(i-1)*di4-wa3(i)*dr4 - ch(i-1,k,5) = wa4(i-1)*dr5+wa4(i)*di5 - ch(i,k,5) = wa4(i-1)*di5-wa4(i)*dr5 - 103 continue - 104 continue - return - end - subroutine fpassf3 (ido,l1,cc,ch,wa1,wa2) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,3,l1) ,ch(ido,l1,3) , - 1 wa1(*) ,wa2(*) - data taur,taui /-.5,-.866025403784439/ - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - tr2 = cc(1,2,k)+cc(1,3,k) - cr2 = cc(1,1,k)+taur*tr2 - ch(1,k,1) = cc(1,1,k)+tr2 - ti2 = cc(2,2,k)+cc(2,3,k) - ci2 = cc(2,1,k)+taur*ti2 - ch(2,k,1) = cc(2,1,k)+ti2 - cr3 = taui*(cc(1,2,k)-cc(1,3,k)) - ci3 = taui*(cc(2,2,k)-cc(2,3,k)) - ch(1,k,2) = cr2-ci3 - ch(1,k,3) = cr2+ci3 - ch(2,k,2) = ci2+cr3 - ch(2,k,3) = ci2-cr3 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - tr2 = cc(i-1,2,k)+cc(i-1,3,k) - cr2 = cc(i-1,1,k)+taur*tr2 - ch(i-1,k,1) = cc(i-1,1,k)+tr2 - ti2 = cc(i,2,k)+cc(i,3,k) - ci2 = cc(i,1,k)+taur*ti2 - ch(i,k,1) = cc(i,1,k)+ti2 - cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k)) - ci3 = taui*(cc(i,2,k)-cc(i,3,k)) - dr2 = cr2-ci3 - dr3 = cr2+ci3 - di2 = ci2+cr3 - di3 = ci2-cr3 - ch(i,k,2) = wa1(i-1)*di2-wa1(i)*dr2 - ch(i-1,k,2) = wa1(i-1)*dr2+wa1(i)*di2 - ch(i,k,3) = wa2(i-1)*di3-wa2(i)*dr3 - ch(i-1,k,3) = wa2(i-1)*dr3+wa2(i)*di3 - 103 continue - 104 continue - return - end - subroutine fpassf2 (ido,l1,cc,ch,wa1) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,2,l1) ,ch(ido,l1,2) , - 1 wa1(*) - if (ido .gt. 2) go to 102 - do 101 k=1,l1 - ch(1,k,1) = cc(1,1,k)+cc(1,2,k) - ch(1,k,2) = cc(1,1,k)-cc(1,2,k) - ch(2,k,1) = cc(2,1,k)+cc(2,2,k) - ch(2,k,2) = cc(2,1,k)-cc(2,2,k) - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k) - tr2 = cc(i-1,1,k)-cc(i-1,2,k) - ch(i,k,1) = cc(i,1,k)+cc(i,2,k) - ti2 = cc(i,1,k)-cc(i,2,k) - ch(i,k,2) = wa1(i-1)*ti2-wa1(i)*tr2 - ch(i-1,k,2) = wa1(i-1)*tr2+wa1(i)*ti2 - 103 continue - 104 continue - return - end - subroutine fpassf4 (ido,l1,cc,ch,wa1,wa2,wa3) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,4,l1) ,ch(ido,l1,4) , - 1 wa1(*) ,wa2(*) ,wa3(*) - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - ti1 = cc(2,1,k)-cc(2,3,k) - ti2 = cc(2,1,k)+cc(2,3,k) - tr4 = cc(2,2,k)-cc(2,4,k) - ti3 = cc(2,2,k)+cc(2,4,k) - tr1 = cc(1,1,k)-cc(1,3,k) - tr2 = cc(1,1,k)+cc(1,3,k) - ti4 = cc(1,4,k)-cc(1,2,k) - tr3 = cc(1,2,k)+cc(1,4,k) - ch(1,k,1) = tr2+tr3 - ch(1,k,3) = tr2-tr3 - ch(2,k,1) = ti2+ti3 - ch(2,k,3) = ti2-ti3 - ch(1,k,2) = tr1+tr4 - ch(1,k,4) = tr1-tr4 - ch(2,k,2) = ti1+ti4 - ch(2,k,4) = ti1-ti4 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ti1 = cc(i,1,k)-cc(i,3,k) - ti2 = cc(i,1,k)+cc(i,3,k) - ti3 = cc(i,2,k)+cc(i,4,k) - tr4 = cc(i,2,k)-cc(i,4,k) - tr1 = cc(i-1,1,k)-cc(i-1,3,k) - tr2 = cc(i-1,1,k)+cc(i-1,3,k) - ti4 = cc(i-1,4,k)-cc(i-1,2,k) - tr3 = cc(i-1,2,k)+cc(i-1,4,k) - ch(i-1,k,1) = tr2+tr3 - cr3 = tr2-tr3 - ch(i,k,1) = ti2+ti3 - ci3 = ti2-ti3 - cr2 = tr1+tr4 - cr4 = tr1-tr4 - ci2 = ti1+ti4 - ci4 = ti1-ti4 - ch(i-1,k,2) = wa1(i-1)*cr2+wa1(i)*ci2 - ch(i,k,2) = wa1(i-1)*ci2-wa1(i)*cr2 - ch(i-1,k,3) = wa2(i-1)*cr3+wa2(i)*ci3 - ch(i,k,3) = wa2(i-1)*ci3-wa2(i)*cr3 - ch(i-1,k,4) = wa3(i-1)*cr4+wa3(i)*ci4 - ch(i,k,4) = wa3(i-1)*ci4-wa3(i)*cr4 - 103 continue - 104 continue - return - end - - - - subroutine fcfftb (n,c,wsave) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension c(*) ,wsave(*) - if (n .eq. 1) return - iw1 = n+n+1 - iw2 = iw1+n+n - call fcfftb1 (n,c,wsave,wsave(iw1),wsave(iw2)) - return - end - subroutine fcfftb1 (n,c,ch,wa,xxifac) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(*) ,c(*) ,wa(*) ,xxifac(*) - dimension rfac(15), jfac(15) - equivalence (rfac(1), jfac(1)) - do 100 i = 1, 15 - rfac(i) = xxifac(i) - 100 continue - nf = jfac(2) - na = 0 - l1 = 1 - iw = 1 - do 116 k1=1,nf - ip = jfac(k1+2) - l2 = ip*l1 - ido = n/l2 - idot = ido+ido - idl1 = idot*l1 - if (ip .ne. 4) go to 103 - ix2 = iw+idot - ix3 = ix2+idot - if (na .ne. 0) go to 101 - call fpassb4 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3)) - go to 102 - 101 call fpassb4 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3)) - 102 na = 1-na - go to 115 - 103 if (ip .ne. 2) go to 106 - if (na .ne. 0) go to 104 - call fpassb2 (idot,l1,c,ch,wa(iw)) - go to 105 - 104 call fpassb2 (idot,l1,ch,c,wa(iw)) - 105 na = 1-na - go to 115 - 106 if (ip .ne. 3) go to 109 - ix2 = iw+idot - if (na .ne. 0) go to 107 - call fpassb3 (idot,l1,c,ch,wa(iw),wa(ix2)) - go to 108 - 107 call fpassb3 (idot,l1,ch,c,wa(iw),wa(ix2)) - 108 na = 1-na - go to 115 - 109 if (ip .ne. 5) go to 112 - ix2 = iw+idot - ix3 = ix2+idot - ix4 = ix3+idot - if (na .ne. 0) go to 110 - call fpassb5 (idot,l1,c,ch,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - go to 111 - 110 call fpassb5 (idot,l1,ch,c,wa(iw),wa(ix2),wa(ix3),wa(ix4)) - 111 na = 1-na - go to 115 - 112 if (na .ne. 0) go to 113 - call fpassb (nac,idot,ip,l1,idl1,c,c,c,ch,ch,wa(iw)) - go to 114 - 113 call fpassb (nac,idot,ip,l1,idl1,ch,ch,ch,c,c,wa(iw)) - 114 if (nac .ne. 0) na = 1-na - 115 l1 = l2 - iw = iw+(ip-1)*idot - 116 continue - if (na .eq. 0) return - n2 = n+n - do 117 i=1,n2 - c(i) = ch(i) - 117 continue - return - end - subroutine fpassb (nac,ido,ip,l1,idl1,cc,c1,c2,ch,ch2,wa) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension ch(ido,l1,ip) ,cc(ido,ip,l1) , - 1 c1(ido,l1,ip) ,wa(*) ,c2(idl1,ip), - 2 ch2(idl1,ip) - idot = ido/2 - nt = ip*idl1 - ipp2 = ip+2 - ipph = (ip+1)/2 - idp = ip*ido -c - if (ido .lt. l1) go to 106 - do 103 j=2,ipph - jc = ipp2-j - do 102 k=1,l1 - do 101 i=1,ido - ch(i,k,j) = cc(i,j,k)+cc(i,jc,k) - ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k) - 101 continue - 102 continue - 103 continue - do 105 k=1,l1 - do 104 i=1,ido - ch(i,k,1) = cc(i,1,k) - 104 continue - 105 continue - go to 112 - 106 do 109 j=2,ipph - jc = ipp2-j - do 108 i=1,ido - do 107 k=1,l1 - ch(i,k,j) = cc(i,j,k)+cc(i,jc,k) - ch(i,k,jc) = cc(i,j,k)-cc(i,jc,k) - 107 continue - 108 continue - 109 continue - do 111 i=1,ido - do 110 k=1,l1 - ch(i,k,1) = cc(i,1,k) - 110 continue - 111 continue - 112 idl = 2-ido - inc = 0 - do 116 l=2,ipph - lc = ipp2-l - idl = idl+ido - do 113 ik=1,idl1 - c2(ik,l) = ch2(ik,1)+wa(idl-1)*ch2(ik,2) - c2(ik,lc) = wa(idl)*ch2(ik,ip) - 113 continue - idlj = idl - inc = inc+ido - do 115 j=3,ipph - jc = ipp2-j - idlj = idlj+inc - if (idlj .gt. idp) idlj = idlj-idp - war = wa(idlj-1) - wai = wa(idlj) - do 114 ik=1,idl1 - c2(ik,l) = c2(ik,l)+war*ch2(ik,j) - c2(ik,lc) = c2(ik,lc)+wai*ch2(ik,jc) - 114 continue - 115 continue - 116 continue - do 118 j=2,ipph - do 117 ik=1,idl1 - ch2(ik,1) = ch2(ik,1)+ch2(ik,j) - 117 continue - 118 continue - do 120 j=2,ipph - jc = ipp2-j - do 119 ik=2,idl1,2 - ch2(ik-1,j) = c2(ik-1,j)-c2(ik,jc) - ch2(ik-1,jc) = c2(ik-1,j)+c2(ik,jc) - ch2(ik,j) = c2(ik,j)+c2(ik-1,jc) - ch2(ik,jc) = c2(ik,j)-c2(ik-1,jc) - 119 continue - 120 continue - nac = 1 - if (ido .eq. 2) return - nac = 0 - do 121 ik=1,idl1 - c2(ik,1) = ch2(ik,1) - 121 continue - do 123 j=2,ip - do 122 k=1,l1 - c1(1,k,j) = ch(1,k,j) - c1(2,k,j) = ch(2,k,j) - 122 continue - 123 continue - if (idot .gt. l1) go to 127 - idij = 0 - do 126 j=2,ip - idij = idij+2 - do 125 i=4,ido,2 - idij = idij+2 - do 124 k=1,l1 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j) - 124 continue - 125 continue - 126 continue - return - 127 idj = 2-ido - do 130 j=2,ip - idj = idj+ido - do 129 k=1,l1 - idij = idj - do 128 i=4,ido,2 - idij = idij+2 - c1(i-1,k,j) = wa(idij-1)*ch(i-1,k,j)-wa(idij)*ch(i,k,j) - c1(i,k,j) = wa(idij-1)*ch(i,k,j)+wa(idij)*ch(i-1,k,j) - 128 continue - 129 continue - 130 continue - return - end - subroutine fpassb5 (ido,l1,cc,ch,wa1,wa2,wa3,wa4) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,5,l1) ,ch(ido,l1,5) , - 1 wa1(*) ,wa2(*) ,wa3(*) ,wa4(*) - data tr11,ti11,tr12,ti12 /.309016994374947,.951056516295154, - 1-.809016994374947,.587785252292473/ - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - ti5 = cc(2,2,k)-cc(2,5,k) - ti2 = cc(2,2,k)+cc(2,5,k) - ti4 = cc(2,3,k)-cc(2,4,k) - ti3 = cc(2,3,k)+cc(2,4,k) - tr5 = cc(1,2,k)-cc(1,5,k) - tr2 = cc(1,2,k)+cc(1,5,k) - tr4 = cc(1,3,k)-cc(1,4,k) - tr3 = cc(1,3,k)+cc(1,4,k) - ch(1,k,1) = cc(1,1,k)+tr2+tr3 - ch(2,k,1) = cc(2,1,k)+ti2+ti3 - cr2 = cc(1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(2,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(2,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - ch(1,k,2) = cr2-ci5 - ch(1,k,5) = cr2+ci5 - ch(2,k,2) = ci2+cr5 - ch(2,k,3) = ci3+cr4 - ch(1,k,3) = cr3-ci4 - ch(1,k,4) = cr3+ci4 - ch(2,k,4) = ci3-cr4 - ch(2,k,5) = ci2-cr5 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ti5 = cc(i,2,k)-cc(i,5,k) - ti2 = cc(i,2,k)+cc(i,5,k) - ti4 = cc(i,3,k)-cc(i,4,k) - ti3 = cc(i,3,k)+cc(i,4,k) - tr5 = cc(i-1,2,k)-cc(i-1,5,k) - tr2 = cc(i-1,2,k)+cc(i-1,5,k) - tr4 = cc(i-1,3,k)-cc(i-1,4,k) - tr3 = cc(i-1,3,k)+cc(i-1,4,k) - ch(i-1,k,1) = cc(i-1,1,k)+tr2+tr3 - ch(i,k,1) = cc(i,1,k)+ti2+ti3 - cr2 = cc(i-1,1,k)+tr11*tr2+tr12*tr3 - ci2 = cc(i,1,k)+tr11*ti2+tr12*ti3 - cr3 = cc(i-1,1,k)+tr12*tr2+tr11*tr3 - ci3 = cc(i,1,k)+tr12*ti2+tr11*ti3 - cr5 = ti11*tr5+ti12*tr4 - ci5 = ti11*ti5+ti12*ti4 - cr4 = ti12*tr5-ti11*tr4 - ci4 = ti12*ti5-ti11*ti4 - dr3 = cr3-ci4 - dr4 = cr3+ci4 - di3 = ci3+cr4 - di4 = ci3-cr4 - dr5 = cr2+ci5 - dr2 = cr2-ci5 - di5 = ci2-cr5 - di2 = ci2+cr5 - ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2 - ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2 - ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3 - ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3 - ch(i-1,k,4) = wa3(i-1)*dr4-wa3(i)*di4 - ch(i,k,4) = wa3(i-1)*di4+wa3(i)*dr4 - ch(i-1,k,5) = wa4(i-1)*dr5-wa4(i)*di5 - ch(i,k,5) = wa4(i-1)*di5+wa4(i)*dr5 - 103 continue - 104 continue - return - end - subroutine fpassb3 (ido,l1,cc,ch,wa1,wa2) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,3,l1) ,ch(ido,l1,3) , - 1 wa1(*) ,wa2(*) - data taur,taui /-.5,.866025403784439/ - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - tr2 = cc(1,2,k)+cc(1,3,k) - cr2 = cc(1,1,k)+taur*tr2 - ch(1,k,1) = cc(1,1,k)+tr2 - ti2 = cc(2,2,k)+cc(2,3,k) - ci2 = cc(2,1,k)+taur*ti2 - ch(2,k,1) = cc(2,1,k)+ti2 - cr3 = taui*(cc(1,2,k)-cc(1,3,k)) - ci3 = taui*(cc(2,2,k)-cc(2,3,k)) - ch(1,k,2) = cr2-ci3 - ch(1,k,3) = cr2+ci3 - ch(2,k,2) = ci2+cr3 - ch(2,k,3) = ci2-cr3 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - tr2 = cc(i-1,2,k)+cc(i-1,3,k) - cr2 = cc(i-1,1,k)+taur*tr2 - ch(i-1,k,1) = cc(i-1,1,k)+tr2 - ti2 = cc(i,2,k)+cc(i,3,k) - ci2 = cc(i,1,k)+taur*ti2 - ch(i,k,1) = cc(i,1,k)+ti2 - cr3 = taui*(cc(i-1,2,k)-cc(i-1,3,k)) - ci3 = taui*(cc(i,2,k)-cc(i,3,k)) - dr2 = cr2-ci3 - dr3 = cr2+ci3 - di2 = ci2+cr3 - di3 = ci2-cr3 - ch(i,k,2) = wa1(i-1)*di2+wa1(i)*dr2 - ch(i-1,k,2) = wa1(i-1)*dr2-wa1(i)*di2 - ch(i,k,3) = wa2(i-1)*di3+wa2(i)*dr3 - ch(i-1,k,3) = wa2(i-1)*dr3-wa2(i)*di3 - 103 continue - 104 continue - return - end - subroutine fpassb2 (ido,l1,cc,ch,wa1) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,2,l1) ,ch(ido,l1,2) , - 1 wa1(*) - if (ido .gt. 2) go to 102 - do 101 k=1,l1 - ch(1,k,1) = cc(1,1,k)+cc(1,2,k) - ch(1,k,2) = cc(1,1,k)-cc(1,2,k) - ch(2,k,1) = cc(2,1,k)+cc(2,2,k) - ch(2,k,2) = cc(2,1,k)-cc(2,2,k) - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ch(i-1,k,1) = cc(i-1,1,k)+cc(i-1,2,k) - tr2 = cc(i-1,1,k)-cc(i-1,2,k) - ch(i,k,1) = cc(i,1,k)+cc(i,2,k) - ti2 = cc(i,1,k)-cc(i,2,k) - ch(i,k,2) = wa1(i-1)*ti2+wa1(i)*tr2 - ch(i-1,k,2) = wa1(i-1)*tr2-wa1(i)*ti2 - 103 continue - 104 continue - return - end - subroutine fpassb4 (ido,l1,cc,ch,wa1,wa2,wa3) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension cc(ido,4,l1) ,ch(ido,l1,4) , - 1 wa1(*) ,wa2(*) ,wa3(*) - if (ido .ne. 2) go to 102 - do 101 k=1,l1 - ti1 = cc(2,1,k)-cc(2,3,k) - ti2 = cc(2,1,k)+cc(2,3,k) - tr4 = cc(2,4,k)-cc(2,2,k) - ti3 = cc(2,2,k)+cc(2,4,k) - tr1 = cc(1,1,k)-cc(1,3,k) - tr2 = cc(1,1,k)+cc(1,3,k) - ti4 = cc(1,2,k)-cc(1,4,k) - tr3 = cc(1,2,k)+cc(1,4,k) - ch(1,k,1) = tr2+tr3 - ch(1,k,3) = tr2-tr3 - ch(2,k,1) = ti2+ti3 - ch(2,k,3) = ti2-ti3 - ch(1,k,2) = tr1+tr4 - ch(1,k,4) = tr1-tr4 - ch(2,k,2) = ti1+ti4 - ch(2,k,4) = ti1-ti4 - 101 continue - return - 102 do 104 k=1,l1 - do 103 i=2,ido,2 - ti1 = cc(i,1,k)-cc(i,3,k) - ti2 = cc(i,1,k)+cc(i,3,k) - ti3 = cc(i,2,k)+cc(i,4,k) - tr4 = cc(i,4,k)-cc(i,2,k) - tr1 = cc(i-1,1,k)-cc(i-1,3,k) - tr2 = cc(i-1,1,k)+cc(i-1,3,k) - ti4 = cc(i-1,2,k)-cc(i-1,4,k) - tr3 = cc(i-1,2,k)+cc(i-1,4,k) - ch(i-1,k,1) = tr2+tr3 - cr3 = tr2-tr3 - ch(i,k,1) = ti2+ti3 - ci3 = ti2-ti3 - cr2 = tr1+tr4 - cr4 = tr1-tr4 - ci2 = ti1+ti4 - ci4 = ti1-ti4 - ch(i-1,k,2) = wa1(i-1)*cr2-wa1(i)*ci2 - ch(i,k,2) = wa1(i-1)*ci2+wa1(i)*cr2 - ch(i-1,k,3) = wa2(i-1)*cr3-wa2(i)*ci3 - ch(i,k,3) = wa2(i-1)*ci3+wa2(i)*cr3 - ch(i-1,k,4) = wa3(i-1)*cr4-wa3(i)*ci4 - ch(i,k,4) = wa3(i-1)*ci4+wa3(i)*cr4 - 103 continue - 104 continue - return - end - - - - subroutine fsinti (n,wsave) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension wsave(*) - data pi /3.14159265358979/ - if (n .le. 1) return - ns2 = n/2 - np1 = n+1 - dt = pi/float(np1) - do 101 k=1,ns2 - wsave(k) = 2.*sin(k*dt) - 101 continue - call frffti (np1,wsave(ns2+1)) - return - end - - - - subroutine fsint (n,x,wsave) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension x(*) ,wsave(*) - np1 = n+1 - iw1 = n/2+1 - iw2 = iw1+np1 - iw3 = iw2+np1 - call fsint1(n,x,wsave,wsave(iw1),wsave(iw2),wsave(iw3)) - return - end - subroutine fsint1(n,war,was,xh,x,xxifac) -c----------------------------TJW - implicit real (a-h,o-z) - implicit integer (i-n) -c----------------------------TJW - dimension war(*),was(*),x(*),xh(*),xxifac(*) - data sqrt3 /1.73205080756888/ - do 100 i=1,n - xh(i) = war(i) - war(i) = x(i) - 100 continue - if (n-2) 101,102,103 - 101 xh(1) = xh(1)+xh(1) - go to 106 - 102 xhold = sqrt3*(xh(1)+xh(2)) - xh(2) = sqrt3*(xh(1)-xh(2)) - xh(1) = xhold - go to 106 - 103 np1 = n+1 - ns2 = n/2 - x(1) = 0. - do 104 k=1,ns2 - kc = np1-k - t1 = xh(k)-xh(kc) - t2 = was(k)*(xh(k)+xh(kc)) - x(k+1) = t1+t2 - x(kc+1) = t2-t1 - 104 continue - modn = mod(n,2) - if (modn .ne. 0) x(ns2+2) = 4.*xh(ns2+1) - call frfftf1 (np1,x,xh,war,xxifac) - xh(1) = .5*x(1) - do 105 i=3,n,2 - xh(i-1) = -x(i) - xh(i) = xh(i-2)+x(i-1) - 105 continue - if (modn .ne. 0) go to 106 - xh(n) = -x(n+1) - 106 do 107 i=1,n - x(i) = war(i) - war(i) = xh(i) - 107 continue - return - end - - - -c======================================================================== -c $RCSfile: fftpack.F,v $ $Author: adelmann $ -c $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $ -c IPPL_VERSION_ID: $Id: fftpack.F,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ -c======================================================================== - diff --git a/ippl/src/FFT/fftpack.cpp b/ippl/src/FFT/fftpack.cpp index fdf9706c0eaaed42279bce3ad1d1a120c30eb6e5..e8a01e72790b8ae38d081796f91ee4411d7f054d 100644 --- a/ippl/src/FFT/fftpack.cpp +++ b/ippl/src/FFT/fftpack.cpp @@ -1,3 +1,13 @@ +// +// IPPL FFT +// +// Copyright (c) 2008-2018 +// Paul Scherrer Institut, Villigen PSI, Switzerland +// All rights reserved. +// +// OPAL is licensed under GNU GPL version 3. +// + /* * This file is part of libfftpack. * @@ -30,6 +40,7 @@ C port by Martin Reinecke (2010) */ +#include <stdio.h> #include <math.h> #include <stdlib.h> #include <string.h> @@ -38,10 +49,46 @@ extern "C" { #endif +/****************************************************************************** + some helper functions and macros formerly in c_utils.c and c_utils.h +*/ + void *util_malloc_ (size_t sz) { + void *res; + if (sz==0) return NULL; + res = malloc(sz); + if (!(res)) { + fprintf (stderr, "%s, %i (%s):\n%s\n", + __FILE__, __LINE__, __func__, + "malloc() failed"); + exit (1); + } + return res; + } -#include "fftpack.h" +#define ALLOC(ptr,type,num) \ + do { (ptr)=(type *)util_malloc_((num)*sizeof(type)); } while (0) -#include "c_utils.c" +#define RALLOC(type,num) \ + ((type *)util_malloc_((num)*sizeof(type))) + +#define DEALLOC(ptr) \ + { if ((ptr) != 0) free (ptr); (ptr) = NULL; } + + void util_free_ (void *ptr) { + if ((ptr) != NULL) { + free(ptr); + } + } + +#define SWAP(a,b,type) \ + do { type tmp_=(a); (a)=(b); (b)=tmp_; } while(0) +/******************************************************************************/ + + typedef struct { + double r,i; + } cmplx; + +#include "fftpack.h" #define WA(x,i) wa[(i)+(x)*ido] #define CH(a,b,c) ch[(a)+ido*((b)+l1*(c))] @@ -54,10 +101,6 @@ extern "C" { /* (a+ib) = conj(c+id) * (e+if) */ #define MULPM(a,b,c,d,e,f) { a=c*e+d*f; b=c*f-d*e; } - typedef struct { - double r,i; - } cmplx; - #define CONCAT(a,b) a ## b #define X(arg) CONCAT(passb,arg) @@ -75,155 +118,155 @@ extern "C" { #define CC(a,b,c) cc[(a)+ido*((b)+l1*(c))] #define CH(a,b,c) ch[(a)+ido*((b)+cdim*(c))] - static void radf2 (size_t ido, size_t l1, const double *cc, double *ch, - const double *wa) - { - const size_t cdim=2; - size_t i, k, ic; - double ti2, tr2; - - for (k=0; k<l1; k++) - PM (CH(0,0,k),CH(ido-1,1,k),CC(0,k,0),CC(0,k,1)) - if ((ido&1)==0) - for (k=0; k<l1; k++) - { - CH( 0,1,k) = -CC(ido-1,k,1); - CH(ido-1,0,k) = CC(ido-1,k,0); - } - if (ido<=2) return; - for (k=0; k<l1; k++) - for (i=2; i<ido; i+=2) - { - ic=ido-i; - MULPM (tr2,ti2,WA(0,i-2),WA(0,i-1),CC(i-1,k,1),CC(i,k,1)) - PM (CH(i-1,0,k),CH(ic-1,1,k),CC(i-1,k,0),tr2) - PM (CH(i ,0,k),CH(ic ,1,k),ti2,CC(i ,k,0)) - } - } - - static void radf3(size_t ido, size_t l1, const double *cc, double *ch, - const double *wa) - { - const size_t cdim=3; - static const double taur=-0.5, taui=0.86602540378443864676; - size_t i, k, ic; - double ci2, di2, di3, cr2, dr2, dr3, ti2, ti3, tr2, tr3; - - for (k=0; k<l1; k++) - { - cr2=CC(0,k,1)+CC(0,k,2); - CH(0,0,k) = CC(0,k,0)+cr2; - CH(0,2,k) = taui*(CC(0,k,2)-CC(0,k,1)); - CH(ido-1,1,k) = CC(0,k,0)+taur*cr2; - } - if (ido==1) return; - for (k=0; k<l1; k++) - for (i=2; i<ido; i+=2) - { - ic=ido-i; - MULPM (dr2,di2,WA(0,i-2),WA(0,i-1),CC(i-1,k,1),CC(i,k,1)) - MULPM (dr3,di3,WA(1,i-2),WA(1,i-1),CC(i-1,k,2),CC(i,k,2)) - cr2=dr2+dr3; - ci2=di2+di3; - CH(i-1,0,k) = CC(i-1,k,0)+cr2; - CH(i ,0,k) = CC(i ,k,0)+ci2; - tr2 = CC(i-1,k,0)+taur*cr2; - ti2 = CC(i ,k,0)+taur*ci2; - tr3 = taui*(di2-di3); - ti3 = taui*(dr3-dr2); - PM(CH(i-1,2,k),CH(ic-1,1,k),tr2,tr3) - PM(CH(i ,2,k),CH(ic ,1,k),ti3,ti2) - } - } - - static void radf4(size_t ido, size_t l1, const double *cc, double *ch, - const double *wa) - { - const size_t cdim=4; - static const double hsqt2=0.70710678118654752440; - size_t i, k, ic; - double ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4; - - for (k=0; k<l1; k++) - { - PM (tr1,CH(0,2,k),CC(0,k,3),CC(0,k,1)) - PM (tr2,CH(ido-1,1,k),CC(0,k,0),CC(0,k,2)) - PM (CH(0,0,k),CH(ido-1,3,k),tr2,tr1) - } - if ((ido&1)==0) - for (k=0; k<l1; k++) - { - ti1=-hsqt2*(CC(ido-1,k,1)+CC(ido-1,k,3)); - tr1= hsqt2*(CC(ido-1,k,1)-CC(ido-1,k,3)); - PM (CH(ido-1,0,k),CH(ido-1,2,k),CC(ido-1,k,0),tr1) - PM (CH( 0,3,k),CH( 0,1,k),ti1,CC(ido-1,k,2)) - } - if (ido<=2) return; - for (k=0; k<l1; k++) - for (i=2; i<ido; i+=2) - { - ic=ido-i; - MULPM(cr2,ci2,WA(0,i-2),WA(0,i-1),CC(i-1,k,1),CC(i,k,1)) - MULPM(cr3,ci3,WA(1,i-2),WA(1,i-1),CC(i-1,k,2),CC(i,k,2)) - MULPM(cr4,ci4,WA(2,i-2),WA(2,i-1),CC(i-1,k,3),CC(i,k,3)) - PM(tr1,tr4,cr4,cr2) - PM(ti1,ti4,ci2,ci4) - PM(tr2,tr3,CC(i-1,k,0),cr3) - PM(ti2,ti3,CC(i ,k,0),ci3) - PM(CH(i-1,0,k),CH(ic-1,3,k),tr2,tr1) - PM(CH(i ,0,k),CH(ic ,3,k),ti1,ti2) - PM(CH(i-1,2,k),CH(ic-1,1,k),tr3,ti4) - PM(CH(i ,2,k),CH(ic ,1,k),tr4,ti3) - } - } - - static void radf5(size_t ido, size_t l1, const double *cc, double *ch, - const double *wa) - { - const size_t cdim=5; - static const double tr11= 0.3090169943749474241, ti11=0.95105651629515357212, - tr12=-0.8090169943749474241, ti12=0.58778525229247312917; - size_t i, k, ic; - double ci2, di2, ci4, ci5, di3, di4, di5, ci3, cr2, cr3, dr2, dr3, - dr4, dr5, cr5, cr4, ti2, ti3, ti5, ti4, tr2, tr3, tr4, tr5; - - for (k=0; k<l1; k++) - { - PM (cr2,ci5,CC(0,k,4),CC(0,k,1)) - PM (cr3,ci4,CC(0,k,3),CC(0,k,2)) - CH(0,0,k)=CC(0,k,0)+cr2+cr3; - CH(ido-1,1,k)=CC(0,k,0)+tr11*cr2+tr12*cr3; - CH(0,2,k)=ti11*ci5+ti12*ci4; - CH(ido-1,3,k)=CC(0,k,0)+tr12*cr2+tr11*cr3; - CH(0,4,k)=ti12*ci5-ti11*ci4; - } - if (ido==1) return; - for (k=0; k<l1;++k) - for (i=2; i<ido; i+=2) - { - ic=ido-i; - MULPM (dr2,di2,WA(0,i-2),WA(0,i-1),CC(i-1,k,1),CC(i,k,1)) - MULPM (dr3,di3,WA(1,i-2),WA(1,i-1),CC(i-1,k,2),CC(i,k,2)) - MULPM (dr4,di4,WA(2,i-2),WA(2,i-1),CC(i-1,k,3),CC(i,k,3)) - MULPM (dr5,di5,WA(3,i-2),WA(3,i-1),CC(i-1,k,4),CC(i,k,4)) - PM(cr2,ci5,dr5,dr2) - PM(ci2,cr5,di2,di5) - PM(cr3,ci4,dr4,dr3) - PM(ci3,cr4,di3,di4) - CH(i-1,0,k)=CC(i-1,k,0)+cr2+cr3; - CH(i ,0,k)=CC(i ,k,0)+ci2+ci3; - tr2=CC(i-1,k,0)+tr11*cr2+tr12*cr3; - ti2=CC(i ,k,0)+tr11*ci2+tr12*ci3; - tr3=CC(i-1,k,0)+tr12*cr2+tr11*cr3; - ti3=CC(i ,k,0)+tr12*ci2+tr11*ci3; - MULPM(tr5,tr4,cr5,cr4,ti11,ti12) - MULPM(ti5,ti4,ci5,ci4,ti11,ti12) - PM(CH(i-1,2,k),CH(ic-1,1,k),tr2,tr5) - PM(CH(i ,2,k),CH(ic ,1,k),ti5,ti2) - PM(CH(i-1,4,k),CH(ic-1,3,k),tr3,tr4) - PM(CH(i ,4,k),CH(ic ,3,k),ti4,ti3) - } - } + static void radf2 (size_t ido, size_t l1, const double *cc, double *ch, + const double *wa) + { + const size_t cdim=2; + size_t i, k, ic; + double ti2, tr2; + + for (k=0; k<l1; k++) + PM (CH(0,0,k),CH(ido-1,1,k),CC(0,k,0),CC(0,k,1)) + if ((ido&1)==0) + for (k=0; k<l1; k++) + { + CH( 0,1,k) = -CC(ido-1,k,1); + CH(ido-1,0,k) = CC(ido-1,k,0); + } + if (ido<=2) return; + for (k=0; k<l1; k++) + for (i=2; i<ido; i+=2) + { + ic=ido-i; + MULPM (tr2,ti2,WA(0,i-2),WA(0,i-1),CC(i-1,k,1),CC(i,k,1)) + PM (CH(i-1,0,k),CH(ic-1,1,k),CC(i-1,k,0),tr2) + PM (CH(i ,0,k),CH(ic ,1,k),ti2,CC(i ,k,0)) + } + } + + static void radf3(size_t ido, size_t l1, const double *cc, double *ch, + const double *wa) + { + const size_t cdim=3; + static const double taur=-0.5, taui=0.86602540378443864676; + size_t i, k, ic; + double ci2, di2, di3, cr2, dr2, dr3, ti2, ti3, tr2, tr3; + + for (k=0; k<l1; k++) + { + cr2=CC(0,k,1)+CC(0,k,2); + CH(0,0,k) = CC(0,k,0)+cr2; + CH(0,2,k) = taui*(CC(0,k,2)-CC(0,k,1)); + CH(ido-1,1,k) = CC(0,k,0)+taur*cr2; + } + if (ido==1) return; + for (k=0; k<l1; k++) + for (i=2; i<ido; i+=2) + { + ic=ido-i; + MULPM (dr2,di2,WA(0,i-2),WA(0,i-1),CC(i-1,k,1),CC(i,k,1)) + MULPM (dr3,di3,WA(1,i-2),WA(1,i-1),CC(i-1,k,2),CC(i,k,2)) + cr2=dr2+dr3; + ci2=di2+di3; + CH(i-1,0,k) = CC(i-1,k,0)+cr2; + CH(i ,0,k) = CC(i ,k,0)+ci2; + tr2 = CC(i-1,k,0)+taur*cr2; + ti2 = CC(i ,k,0)+taur*ci2; + tr3 = taui*(di2-di3); + ti3 = taui*(dr3-dr2); + PM(CH(i-1,2,k),CH(ic-1,1,k),tr2,tr3) + PM(CH(i ,2,k),CH(ic ,1,k),ti3,ti2) + } + } + + static void radf4(size_t ido, size_t l1, const double *cc, double *ch, + const double *wa) + { + const size_t cdim=4; + static const double hsqt2=0.70710678118654752440; + size_t i, k, ic; + double ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4; + + for (k=0; k<l1; k++) + { + PM (tr1,CH(0,2,k),CC(0,k,3),CC(0,k,1)) + PM (tr2,CH(ido-1,1,k),CC(0,k,0),CC(0,k,2)) + PM (CH(0,0,k),CH(ido-1,3,k),tr2,tr1) + } + if ((ido&1)==0) + for (k=0; k<l1; k++) + { + ti1=-hsqt2*(CC(ido-1,k,1)+CC(ido-1,k,3)); + tr1= hsqt2*(CC(ido-1,k,1)-CC(ido-1,k,3)); + PM (CH(ido-1,0,k),CH(ido-1,2,k),CC(ido-1,k,0),tr1) + PM (CH( 0,3,k),CH( 0,1,k),ti1,CC(ido-1,k,2)) + } + if (ido<=2) return; + for (k=0; k<l1; k++) + for (i=2; i<ido; i+=2) + { + ic=ido-i; + MULPM(cr2,ci2,WA(0,i-2),WA(0,i-1),CC(i-1,k,1),CC(i,k,1)) + MULPM(cr3,ci3,WA(1,i-2),WA(1,i-1),CC(i-1,k,2),CC(i,k,2)) + MULPM(cr4,ci4,WA(2,i-2),WA(2,i-1),CC(i-1,k,3),CC(i,k,3)) + PM(tr1,tr4,cr4,cr2) + PM(ti1,ti4,ci2,ci4) + PM(tr2,tr3,CC(i-1,k,0),cr3) + PM(ti2,ti3,CC(i ,k,0),ci3) + PM(CH(i-1,0,k),CH(ic-1,3,k),tr2,tr1) + PM(CH(i ,0,k),CH(ic ,3,k),ti1,ti2) + PM(CH(i-1,2,k),CH(ic-1,1,k),tr3,ti4) + PM(CH(i ,2,k),CH(ic ,1,k),tr4,ti3) + } + } + + static void radf5(size_t ido, size_t l1, const double *cc, double *ch, + const double *wa) + { + const size_t cdim=5; + static const double tr11= 0.3090169943749474241, ti11=0.95105651629515357212, + tr12=-0.8090169943749474241, ti12=0.58778525229247312917; + size_t i, k, ic; + double ci2, di2, ci4, ci5, di3, di4, di5, ci3, cr2, cr3, dr2, dr3, + dr4, dr5, cr5, cr4, ti2, ti3, ti5, ti4, tr2, tr3, tr4, tr5; + + for (k=0; k<l1; k++) + { + PM (cr2,ci5,CC(0,k,4),CC(0,k,1)) + PM (cr3,ci4,CC(0,k,3),CC(0,k,2)) + CH(0,0,k)=CC(0,k,0)+cr2+cr3; + CH(ido-1,1,k)=CC(0,k,0)+tr11*cr2+tr12*cr3; + CH(0,2,k)=ti11*ci5+ti12*ci4; + CH(ido-1,3,k)=CC(0,k,0)+tr12*cr2+tr11*cr3; + CH(0,4,k)=ti12*ci5-ti11*ci4; + } + if (ido==1) return; + for (k=0; k<l1;++k) + for (i=2; i<ido; i+=2) + { + ic=ido-i; + MULPM (dr2,di2,WA(0,i-2),WA(0,i-1),CC(i-1,k,1),CC(i,k,1)) + MULPM (dr3,di3,WA(1,i-2),WA(1,i-1),CC(i-1,k,2),CC(i,k,2)) + MULPM (dr4,di4,WA(2,i-2),WA(2,i-1),CC(i-1,k,3),CC(i,k,3)) + MULPM (dr5,di5,WA(3,i-2),WA(3,i-1),CC(i-1,k,4),CC(i,k,4)) + PM(cr2,ci5,dr5,dr2) + PM(ci2,cr5,di2,di5) + PM(cr3,ci4,dr4,dr3) + PM(ci3,cr4,di3,di4) + CH(i-1,0,k)=CC(i-1,k,0)+cr2+cr3; + CH(i ,0,k)=CC(i ,k,0)+ci2+ci3; + tr2=CC(i-1,k,0)+tr11*cr2+tr12*cr3; + ti2=CC(i ,k,0)+tr11*ci2+tr12*ci3; + tr3=CC(i-1,k,0)+tr12*cr2+tr11*cr3; + ti3=CC(i ,k,0)+tr12*ci2+tr11*ci3; + MULPM(tr5,tr4,cr5,cr4,ti11,ti12) + MULPM(ti5,ti4,ci5,ci4,ti11,ti12) + PM(CH(i-1,2,k),CH(ic-1,1,k),tr2,tr5) + PM(CH(i ,2,k),CH(ic ,1,k),ti5,ti2) + PM(CH(i-1,4,k),CH(ic-1,3,k),tr3,tr4) + PM(CH(i ,4,k),CH(ic ,3,k),ti4,ti3) + } + } #undef CH #undef CC @@ -232,378 +275,378 @@ extern "C" { #define C1(a,b,c) cc[(a)+ido*((b)+l1*(c))] #define C2(a,b) cc[(a)+idl1*(b)] #define CH2(a,b) ch[(a)+idl1*(b)] - static void radfg(size_t ido, size_t ip, size_t l1, size_t idl1, - double *cc, double *ch, const double *wa) - { - const size_t cdim=ip; - static const double twopi=6.28318530717958647692; - size_t idij, ipph, i, j, k, l, j2, ic, jc, lc, ik; - double ai1, ai2, ar1, ar2, arg; - double *csarr; - size_t aidx; - - ipph=(ip+1)/ 2; - if(ido!=1) - { - memcpy(ch,cc,idl1*sizeof(double)); - - for(j=1; j<ip; j++) - for(k=0; k<l1; k++) - { - CH(0,k,j)=C1(0,k,j); - idij=(j-1)*ido+1; - for(i=2; i<ido; i+=2,idij+=2) - MULPM(CH(i-1,k,j),CH(i,k,j),wa[idij-1],wa[idij],C1(i-1,k,j),C1(i,k,j)) - } - - for(j=1,jc=ip-1; j<ipph; j++,jc--) - for(k=0; k<l1; k++) - for(i=2; i<ido; i+=2) - { - PM(C1(i-1,k,j),C1(i ,k,jc),CH(i-1,k,jc),CH(i-1,k,j )) - PM(C1(i ,k,j),C1(i-1,k,jc),CH(i ,k,j ),CH(i ,k,jc)) - } - } - else - memcpy(cc,ch,idl1*sizeof(double)); - - for(j=1,jc=ip-1; j<ipph; j++,jc--) - for(k=0; k<l1; k++) - PM(C1(0,k,j),C1(0,k,jc),CH(0,k,jc),CH(0,k,j)) - - csarr=RALLOC(double,2*ip); - arg=twopi / ip; - csarr[0]=1.; - csarr[1]=0.; - csarr[2]=csarr[2*ip-2]=cos(arg); - csarr[3]=sin(arg); csarr[2*ip-1]=-csarr[3]; - for (i=2; i<=ip/2; ++i) - { - csarr[2*i]=csarr[2*ip-2*i]=cos(i*arg); - csarr[2*i+1]=sin(i*arg); - csarr[2*ip-2*i+1]=-csarr[2*i+1]; - } - for(l=1,lc=ip-1; l<ipph; l++,lc--) - { - ar1=csarr[2*l]; - ai1=csarr[2*l+1]; - for(ik=0; ik<idl1; ik++) - { - CH2(ik,l)=C2(ik,0)+ar1*C2(ik,1); - CH2(ik,lc)=ai1*C2(ik,ip-1); - } - aidx=2*l; - for(j=2,jc=ip-2; j<ipph; j++,jc--) - { - aidx+=2*l; - if (aidx>=2*ip) aidx-=2*ip; - ar2=csarr[aidx]; - ai2=csarr[aidx+1]; - for(ik=0; ik<idl1; ik++) - { - CH2(ik,l )+=ar2*C2(ik,j ); - CH2(ik,lc)+=ai2*C2(ik,jc); - } - } - } - DEALLOC(csarr); - - for(j=1; j<ipph; j++) - for(ik=0; ik<idl1; ik++) - CH2(ik,0)+=C2(ik,j); - - for(k=0; k<l1; k++) - memcpy(&CC(0,0,k),&CH(0,k,0),ido*sizeof(double)); - for(j=1; j<ipph; j++) - { - jc=ip-j; - j2=2*j; - for(k=0; k<l1; k++) - { - CC(ido-1,j2-1,k) = CH(0,k,j ); - CC(0 ,j2 ,k) = CH(0,k,jc); - } - } - if(ido==1) return; - - for(j=1; j<ipph; j++) - { - jc=ip-j; - j2=2*j; - for(k=0; k<l1; k++) - for(i=2; i<ido; i+=2) - { - ic=ido-i; - PM (CC(i-1,j2,k),CC(ic-1,j2-1,k),CH(i-1,k,j ),CH(i-1,k,jc)) - PM (CC(i ,j2,k),CC(ic ,j2-1,k),CH(i ,k,jc),CH(i ,k,j )) - } - } - } + static void radfg(size_t ido, size_t ip, size_t l1, size_t idl1, + double *cc, double *ch, const double *wa) + { + const size_t cdim=ip; + static const double twopi=6.28318530717958647692; + size_t idij, ipph, i, j, k, l, j2, ic, jc, lc, ik; + double ai1, ai2, ar1, ar2, arg; + double *csarr; + size_t aidx; + + ipph=(ip+1)/ 2; + if(ido!=1) + { + memcpy(ch,cc,idl1*sizeof(double)); + + for(j=1; j<ip; j++) + for(k=0; k<l1; k++) + { + CH(0,k,j)=C1(0,k,j); + idij=(j-1)*ido+1; + for(i=2; i<ido; i+=2,idij+=2) + MULPM(CH(i-1,k,j),CH(i,k,j),wa[idij-1],wa[idij],C1(i-1,k,j),C1(i,k,j)) + } + + for(j=1,jc=ip-1; j<ipph; j++,jc--) + for(k=0; k<l1; k++) + for(i=2; i<ido; i+=2) + { + PM(C1(i-1,k,j),C1(i ,k,jc),CH(i-1,k,jc),CH(i-1,k,j )) + PM(C1(i ,k,j),C1(i-1,k,jc),CH(i ,k,j ),CH(i ,k,jc)) + } + } + else + memcpy(cc,ch,idl1*sizeof(double)); + + for(j=1,jc=ip-1; j<ipph; j++,jc--) + for(k=0; k<l1; k++) + PM(C1(0,k,j),C1(0,k,jc),CH(0,k,jc),CH(0,k,j)) + + csarr=RALLOC(double,2*ip); + arg=twopi / ip; + csarr[0]=1.; + csarr[1]=0.; + csarr[2]=csarr[2*ip-2]=cos(arg); + csarr[3]=sin(arg); csarr[2*ip-1]=-csarr[3]; + for (i=2; i<=ip/2; ++i) + { + csarr[2*i]=csarr[2*ip-2*i]=cos(i*arg); + csarr[2*i+1]=sin(i*arg); + csarr[2*ip-2*i+1]=-csarr[2*i+1]; + } + for(l=1,lc=ip-1; l<ipph; l++,lc--) + { + ar1=csarr[2*l]; + ai1=csarr[2*l+1]; + for(ik=0; ik<idl1; ik++) + { + CH2(ik,l)=C2(ik,0)+ar1*C2(ik,1); + CH2(ik,lc)=ai1*C2(ik,ip-1); + } + aidx=2*l; + for(j=2,jc=ip-2; j<ipph; j++,jc--) + { + aidx+=2*l; + if (aidx>=2*ip) aidx-=2*ip; + ar2=csarr[aidx]; + ai2=csarr[aidx+1]; + for(ik=0; ik<idl1; ik++) + { + CH2(ik,l )+=ar2*C2(ik,j ); + CH2(ik,lc)+=ai2*C2(ik,jc); + } + } + } + DEALLOC(csarr); + + for(j=1; j<ipph; j++) + for(ik=0; ik<idl1; ik++) + CH2(ik,0)+=C2(ik,j); + + for(k=0; k<l1; k++) + memcpy(&CC(0,0,k),&CH(0,k,0),ido*sizeof(double)); + for(j=1; j<ipph; j++) + { + jc=ip-j; + j2=2*j; + for(k=0; k<l1; k++) + { + CC(ido-1,j2-1,k) = CH(0,k,j ); + CC(0 ,j2 ,k) = CH(0,k,jc); + } + } + if(ido==1) return; + + for(j=1; j<ipph; j++) + { + jc=ip-j; + j2=2*j; + for(k=0; k<l1; k++) + for(i=2; i<ido; i+=2) + { + ic=ido-i; + PM (CC(i-1,j2,k),CC(ic-1,j2-1,k),CH(i-1,k,j ),CH(i-1,k,jc)) + PM (CC(i ,j2,k),CC(ic ,j2-1,k),CH(i ,k,jc),CH(i ,k,j )) + } + } + } #undef CC #undef CH #define CH(a,b,c) ch[(a)+ido*((b)+l1*(c))] #define CC(a,b,c) cc[(a)+ido*((b)+cdim*(c))] - static void radb2(size_t ido, size_t l1, const double *cc, double *ch, - const double *wa) - { - const size_t cdim=2; - size_t i, k, ic; - double ti2, tr2; - - for (k=0; k<l1; k++) - PM (CH(0,k,0),CH(0,k,1),CC(0,0,k),CC(ido-1,1,k)) - if ((ido&1)==0) - for (k=0; k<l1; k++) - { - CH(ido-1,k,0) = 2*CC(ido-1,0,k); - CH(ido-1,k,1) = -2*CC(0 ,1,k); - } - if (ido<=2) return; - for (k=0; k<l1;++k) - for (i=2; i<ido; i+=2) - { - ic=ido-i; - PM (CH(i-1,k,0),tr2,CC(i-1,0,k),CC(ic-1,1,k)) - PM (ti2,CH(i ,k,0),CC(i ,0,k),CC(ic ,1,k)) - MULPM (CH(i,k,1),CH(i-1,k,1),WA(0,i-2),WA(0,i-1),ti2,tr2) - } - } - - static void radb3(size_t ido, size_t l1, const double *cc, double *ch, - const double *wa) - { - const size_t cdim=3; - static const double taur=-0.5, taui=0.86602540378443864676; - size_t i, k, ic; - double ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2; - - for (k=0; k<l1; k++) - { - tr2=2*CC(ido-1,1,k); - cr2=CC(0,0,k)+taur*tr2; - CH(0,k,0)=CC(0,0,k)+tr2; - ci3=2*taui*CC(0,2,k); - PM (CH(0,k,2),CH(0,k,1),cr2,ci3); - } - if (ido==1) return; - for (k=0; k<l1; k++) - for (i=2; i<ido; i+=2) - { - ic=ido-i; - tr2=CC(i-1,2,k)+CC(ic-1,1,k); - ti2=CC(i ,2,k)-CC(ic ,1,k); - cr2=CC(i-1,0,k)+taur*tr2; - ci2=CC(i ,0,k)+taur*ti2; - CH(i-1,k,0)=CC(i-1,0,k)+tr2; - CH(i ,k,0)=CC(i ,0,k)+ti2; - cr3=taui*(CC(i-1,2,k)-CC(ic-1,1,k)); - ci3=taui*(CC(i ,2,k)+CC(ic ,1,k)); - PM(dr3,dr2,cr2,ci3) - PM(di2,di3,ci2,cr3) - MULPM(CH(i,k,1),CH(i-1,k,1),WA(0,i-2),WA(0,i-1),di2,dr2) - MULPM(CH(i,k,2),CH(i-1,k,2),WA(1,i-2),WA(1,i-1),di3,dr3) - } - } - - static void radb4(size_t ido, size_t l1, const double *cc, double *ch, - const double *wa) - { - const size_t cdim=4; - static const double sqrt2=1.41421356237309504880; - size_t i, k, ic; - double ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4; - - for (k=0; k<l1; k++) - { - PM (tr2,tr1,CC(0,0,k),CC(ido-1,3,k)) - tr3=2*CC(ido-1,1,k); - tr4=2*CC(0,2,k); - PM (CH(0,k,0),CH(0,k,2),tr2,tr3) - PM (CH(0,k,3),CH(0,k,1),tr1,tr4) - } - if ((ido&1)==0) - for (k=0; k<l1; k++) - { - PM (ti1,ti2,CC(0 ,3,k),CC(0 ,1,k)) - PM (tr2,tr1,CC(ido-1,0,k),CC(ido-1,2,k)) - CH(ido-1,k,0)=tr2+tr2; - CH(ido-1,k,1)=sqrt2*(tr1-ti1); - CH(ido-1,k,2)=ti2+ti2; - CH(ido-1,k,3)=-sqrt2*(tr1+ti1); - } - if (ido<=2) return; - for (k=0; k<l1;++k) - for (i=2; i<ido; i+=2) - { - ic=ido-i; - PM (tr2,tr1,CC(i-1,0,k),CC(ic-1,3,k)) - PM (ti1,ti2,CC(i ,0,k),CC(ic ,3,k)) - PM (tr4,ti3,CC(i ,2,k),CC(ic ,1,k)) - PM (tr3,ti4,CC(i-1,2,k),CC(ic-1,1,k)) - PM (CH(i-1,k,0),cr3,tr2,tr3) - PM (CH(i ,k,0),ci3,ti2,ti3) - PM (cr4,cr2,tr1,tr4) - PM (ci2,ci4,ti1,ti4) - MULPM (CH(i,k,1),CH(i-1,k,1),WA(0,i-2),WA(0,i-1),ci2,cr2) - MULPM (CH(i,k,2),CH(i-1,k,2),WA(1,i-2),WA(1,i-1),ci3,cr3) - MULPM (CH(i,k,3),CH(i-1,k,3),WA(2,i-2),WA(2,i-1),ci4,cr4) - } - } - - static void radb5(size_t ido, size_t l1, const double *cc, double *ch, - const double *wa) - { - const size_t cdim=5; - static const double tr11= 0.3090169943749474241, ti11=0.95105651629515357212, - tr12=-0.8090169943749474241, ti12=0.58778525229247312917; - size_t i, k, ic; - double ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5, cr4, - ti2, ti3, ti4, ti5, dr3, dr4, dr5, dr2, tr2, tr3, tr4, tr5; - - for (k=0; k<l1; k++) - { - ti5=2*CC(0,2,k); - ti4=2*CC(0,4,k); - tr2=2*CC(ido-1,1,k); - tr3=2*CC(ido-1,3,k); - CH(0,k,0)=CC(0,0,k)+tr2+tr3; - cr2=CC(0,0,k)+tr11*tr2+tr12*tr3; - cr3=CC(0,0,k)+tr12*tr2+tr11*tr3; - MULPM(ci5,ci4,ti5,ti4,ti11,ti12) - PM(CH(0,k,4),CH(0,k,1),cr2,ci5) - PM(CH(0,k,3),CH(0,k,2),cr3,ci4) - } - if (ido==1) return; - for (k=0; k<l1;++k) - for (i=2; i<ido; i+=2) - { - ic=ido-i; - PM(tr2,tr5,CC(i-1,2,k),CC(ic-1,1,k)) - PM(ti5,ti2,CC(i ,2,k),CC(ic ,1,k)) - PM(tr3,tr4,CC(i-1,4,k),CC(ic-1,3,k)) - PM(ti4,ti3,CC(i ,4,k),CC(ic ,3,k)) - CH(i-1,k,0)=CC(i-1,0,k)+tr2+tr3; - CH(i ,k,0)=CC(i ,0,k)+ti2+ti3; - cr2=CC(i-1,0,k)+tr11*tr2+tr12*tr3; - ci2=CC(i ,0,k)+tr11*ti2+tr12*ti3; - cr3=CC(i-1,0,k)+tr12*tr2+tr11*tr3; - ci3=CC(i ,0,k)+tr12*ti2+tr11*ti3; - MULPM(cr5,cr4,tr5,tr4,ti11,ti12) - MULPM(ci5,ci4,ti5,ti4,ti11,ti12) - PM(dr4,dr3,cr3,ci4) - PM(di3,di4,ci3,cr4) - PM(dr5,dr2,cr2,ci5) - PM(di2,di5,ci2,cr5) - MULPM(CH(i,k,1),CH(i-1,k,1),WA(0,i-2),WA(0,i-1),di2,dr2) - MULPM(CH(i,k,2),CH(i-1,k,2),WA(1,i-2),WA(1,i-1),di3,dr3) - MULPM(CH(i,k,3),CH(i-1,k,3),WA(2,i-2),WA(2,i-1),di4,dr4) - MULPM(CH(i,k,4),CH(i-1,k,4),WA(3,i-2),WA(3,i-1),di5,dr5) - } - } - - static void radbg(size_t ido, size_t ip, size_t l1, size_t idl1, - double *cc, double *ch, const double *wa) - { - const size_t cdim=ip; - static const double twopi=6.28318530717958647692; - size_t idij, ipph, i, j, k, l, j2, ic, jc, lc, ik; - double ai1, ai2, ar1, ar2, arg; - double *csarr; - size_t aidx; - - ipph=(ip+1)/ 2; - for(k=0; k<l1; k++) - memcpy(&CH(0,k,0),&CC(0,0,k),ido*sizeof(double)); - for(j=1; j<ipph; j++) - { - jc=ip-j; - j2=2*j; - for(k=0; k<l1; k++) - { - CH(0,k,j )=2*CC(ido-1,j2-1,k); - CH(0,k,jc)=2*CC(0 ,j2 ,k); - } - } - - if(ido!=1) - for(j=1,jc=ip-1; j<ipph; j++,jc--) - for(k=0; k<l1; k++) - for(i=2; i<ido; i+=2) - { - ic=ido-i; - PM (CH(i-1,k,j ),CH(i-1,k,jc),CC(i-1,2*j,k),CC(ic-1,2*j-1,k)) - PM (CH(i ,k,jc),CH(i ,k,j ),CC(i ,2*j,k),CC(ic ,2*j-1,k)) - } - - csarr=RALLOC(double,2*ip); - arg=twopi/ip; - csarr[0]=1.; - csarr[1]=0.; - csarr[2]=csarr[2*ip-2]=cos(arg); - csarr[3]=sin(arg); csarr[2*ip-1]=-csarr[3]; - for (i=2; i<=ip/2; ++i) - { - csarr[2*i]=csarr[2*ip-2*i]=cos(i*arg); - csarr[2*i+1]=sin(i*arg); - csarr[2*ip-2*i+1]=-csarr[2*i+1]; - } - for(l=1; l<ipph; l++) - { - lc=ip-l; - ar1=csarr[2*l]; - ai1=csarr[2*l+1]; - for(ik=0; ik<idl1; ik++) - { - C2(ik,l)=CH2(ik,0)+ar1*CH2(ik,1); - C2(ik,lc)=ai1*CH2(ik,ip-1); - } - aidx=2*l; - for(j=2; j<ipph; j++) - { - jc=ip-j; - aidx+=2*l; - if (aidx>=2*ip) aidx-=2*ip; - ar2=csarr[aidx]; - ai2=csarr[aidx+1]; - for(ik=0; ik<idl1; ik++) - { - C2(ik,l )+=ar2*CH2(ik,j ); - C2(ik,lc)+=ai2*CH2(ik,jc); - } - } - } - DEALLOC(csarr); - - for(j=1; j<ipph; j++) - for(ik=0; ik<idl1; ik++) - CH2(ik,0)+=CH2(ik,j); - - for(j=1,jc=ip-1; j<ipph; j++,jc--) - for(k=0; k<l1; k++) - PM (CH(0,k,jc),CH(0,k,j),C1(0,k,j),C1(0,k,jc)) - - if(ido==1) - return; - for(j=1,jc=ip-1; j<ipph; j++,jc--) - for(k=0; k<l1; k++) - for(i=2; i<ido; i+=2) - { - PM (CH(i-1,k,jc),CH(i-1,k,j ),C1(i-1,k,j),C1(i ,k,jc)) - PM (CH(i ,k,j ),CH(i ,k,jc),C1(i ,k,j),C1(i-1,k,jc)) - } - memcpy(cc,ch,idl1*sizeof(double)); - - for(j=1; j<ip; j++) - for(k=0; k<l1; k++) - { - C1(0,k,j)=CH(0,k,j); - idij=(j-1)*ido+1; - for(i=2; i<ido; i+=2,idij+=2) - MULPM (C1(i,k,j),C1(i-1,k,j),wa[idij-1],wa[idij],CH(i,k,j),CH(i-1,k,j)) - } - } + static void radb2(size_t ido, size_t l1, const double *cc, double *ch, + const double *wa) + { + const size_t cdim=2; + size_t i, k, ic; + double ti2, tr2; + + for (k=0; k<l1; k++) + PM (CH(0,k,0),CH(0,k,1),CC(0,0,k),CC(ido-1,1,k)) + if ((ido&1)==0) + for (k=0; k<l1; k++) + { + CH(ido-1,k,0) = 2*CC(ido-1,0,k); + CH(ido-1,k,1) = -2*CC(0 ,1,k); + } + if (ido<=2) return; + for (k=0; k<l1;++k) + for (i=2; i<ido; i+=2) + { + ic=ido-i; + PM (CH(i-1,k,0),tr2,CC(i-1,0,k),CC(ic-1,1,k)) + PM (ti2,CH(i ,k,0),CC(i ,0,k),CC(ic ,1,k)) + MULPM (CH(i,k,1),CH(i-1,k,1),WA(0,i-2),WA(0,i-1),ti2,tr2) + } + } + + static void radb3(size_t ido, size_t l1, const double *cc, double *ch, + const double *wa) + { + const size_t cdim=3; + static const double taur=-0.5, taui=0.86602540378443864676; + size_t i, k, ic; + double ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2; + + for (k=0; k<l1; k++) + { + tr2=2*CC(ido-1,1,k); + cr2=CC(0,0,k)+taur*tr2; + CH(0,k,0)=CC(0,0,k)+tr2; + ci3=2*taui*CC(0,2,k); + PM (CH(0,k,2),CH(0,k,1),cr2,ci3); + } + if (ido==1) return; + for (k=0; k<l1; k++) + for (i=2; i<ido; i+=2) + { + ic=ido-i; + tr2=CC(i-1,2,k)+CC(ic-1,1,k); + ti2=CC(i ,2,k)-CC(ic ,1,k); + cr2=CC(i-1,0,k)+taur*tr2; + ci2=CC(i ,0,k)+taur*ti2; + CH(i-1,k,0)=CC(i-1,0,k)+tr2; + CH(i ,k,0)=CC(i ,0,k)+ti2; + cr3=taui*(CC(i-1,2,k)-CC(ic-1,1,k)); + ci3=taui*(CC(i ,2,k)+CC(ic ,1,k)); + PM(dr3,dr2,cr2,ci3) + PM(di2,di3,ci2,cr3) + MULPM(CH(i,k,1),CH(i-1,k,1),WA(0,i-2),WA(0,i-1),di2,dr2) + MULPM(CH(i,k,2),CH(i-1,k,2),WA(1,i-2),WA(1,i-1),di3,dr3) + } + } + + static void radb4(size_t ido, size_t l1, const double *cc, double *ch, + const double *wa) + { + const size_t cdim=4; + static const double sqrt2=1.41421356237309504880; + size_t i, k, ic; + double ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4; + + for (k=0; k<l1; k++) + { + PM (tr2,tr1,CC(0,0,k),CC(ido-1,3,k)) + tr3=2*CC(ido-1,1,k); + tr4=2*CC(0,2,k); + PM (CH(0,k,0),CH(0,k,2),tr2,tr3) + PM (CH(0,k,3),CH(0,k,1),tr1,tr4) + } + if ((ido&1)==0) + for (k=0; k<l1; k++) + { + PM (ti1,ti2,CC(0 ,3,k),CC(0 ,1,k)) + PM (tr2,tr1,CC(ido-1,0,k),CC(ido-1,2,k)) + CH(ido-1,k,0)=tr2+tr2; + CH(ido-1,k,1)=sqrt2*(tr1-ti1); + CH(ido-1,k,2)=ti2+ti2; + CH(ido-1,k,3)=-sqrt2*(tr1+ti1); + } + if (ido<=2) return; + for (k=0; k<l1;++k) + for (i=2; i<ido; i+=2) + { + ic=ido-i; + PM (tr2,tr1,CC(i-1,0,k),CC(ic-1,3,k)) + PM (ti1,ti2,CC(i ,0,k),CC(ic ,3,k)) + PM (tr4,ti3,CC(i ,2,k),CC(ic ,1,k)) + PM (tr3,ti4,CC(i-1,2,k),CC(ic-1,1,k)) + PM (CH(i-1,k,0),cr3,tr2,tr3) + PM (CH(i ,k,0),ci3,ti2,ti3) + PM (cr4,cr2,tr1,tr4) + PM (ci2,ci4,ti1,ti4) + MULPM (CH(i,k,1),CH(i-1,k,1),WA(0,i-2),WA(0,i-1),ci2,cr2) + MULPM (CH(i,k,2),CH(i-1,k,2),WA(1,i-2),WA(1,i-1),ci3,cr3) + MULPM (CH(i,k,3),CH(i-1,k,3),WA(2,i-2),WA(2,i-1),ci4,cr4) + } + } + + static void radb5(size_t ido, size_t l1, const double *cc, double *ch, + const double *wa) + { + const size_t cdim=5; + static const double tr11= 0.3090169943749474241, ti11=0.95105651629515357212, + tr12=-0.8090169943749474241, ti12=0.58778525229247312917; + size_t i, k, ic; + double ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5, cr4, + ti2, ti3, ti4, ti5, dr3, dr4, dr5, dr2, tr2, tr3, tr4, tr5; + + for (k=0; k<l1; k++) + { + ti5=2*CC(0,2,k); + ti4=2*CC(0,4,k); + tr2=2*CC(ido-1,1,k); + tr3=2*CC(ido-1,3,k); + CH(0,k,0)=CC(0,0,k)+tr2+tr3; + cr2=CC(0,0,k)+tr11*tr2+tr12*tr3; + cr3=CC(0,0,k)+tr12*tr2+tr11*tr3; + MULPM(ci5,ci4,ti5,ti4,ti11,ti12) + PM(CH(0,k,4),CH(0,k,1),cr2,ci5) + PM(CH(0,k,3),CH(0,k,2),cr3,ci4) + } + if (ido==1) return; + for (k=0; k<l1;++k) + for (i=2; i<ido; i+=2) + { + ic=ido-i; + PM(tr2,tr5,CC(i-1,2,k),CC(ic-1,1,k)) + PM(ti5,ti2,CC(i ,2,k),CC(ic ,1,k)) + PM(tr3,tr4,CC(i-1,4,k),CC(ic-1,3,k)) + PM(ti4,ti3,CC(i ,4,k),CC(ic ,3,k)) + CH(i-1,k,0)=CC(i-1,0,k)+tr2+tr3; + CH(i ,k,0)=CC(i ,0,k)+ti2+ti3; + cr2=CC(i-1,0,k)+tr11*tr2+tr12*tr3; + ci2=CC(i ,0,k)+tr11*ti2+tr12*ti3; + cr3=CC(i-1,0,k)+tr12*tr2+tr11*tr3; + ci3=CC(i ,0,k)+tr12*ti2+tr11*ti3; + MULPM(cr5,cr4,tr5,tr4,ti11,ti12) + MULPM(ci5,ci4,ti5,ti4,ti11,ti12) + PM(dr4,dr3,cr3,ci4) + PM(di3,di4,ci3,cr4) + PM(dr5,dr2,cr2,ci5) + PM(di2,di5,ci2,cr5) + MULPM(CH(i,k,1),CH(i-1,k,1),WA(0,i-2),WA(0,i-1),di2,dr2) + MULPM(CH(i,k,2),CH(i-1,k,2),WA(1,i-2),WA(1,i-1),di3,dr3) + MULPM(CH(i,k,3),CH(i-1,k,3),WA(2,i-2),WA(2,i-1),di4,dr4) + MULPM(CH(i,k,4),CH(i-1,k,4),WA(3,i-2),WA(3,i-1),di5,dr5) + } + } + + static void radbg(size_t ido, size_t ip, size_t l1, size_t idl1, + double *cc, double *ch, const double *wa) + { + const size_t cdim=ip; + static const double twopi=6.28318530717958647692; + size_t idij, ipph, i, j, k, l, j2, ic, jc, lc, ik; + double ai1, ai2, ar1, ar2, arg; + double *csarr; + size_t aidx; + + ipph=(ip+1)/ 2; + for(k=0; k<l1; k++) + memcpy(&CH(0,k,0),&CC(0,0,k),ido*sizeof(double)); + for(j=1; j<ipph; j++) + { + jc=ip-j; + j2=2*j; + for(k=0; k<l1; k++) + { + CH(0,k,j )=2*CC(ido-1,j2-1,k); + CH(0,k,jc)=2*CC(0 ,j2 ,k); + } + } + + if(ido!=1) + for(j=1,jc=ip-1; j<ipph; j++,jc--) + for(k=0; k<l1; k++) + for(i=2; i<ido; i+=2) + { + ic=ido-i; + PM (CH(i-1,k,j ),CH(i-1,k,jc),CC(i-1,2*j,k),CC(ic-1,2*j-1,k)) + PM (CH(i ,k,jc),CH(i ,k,j ),CC(i ,2*j,k),CC(ic ,2*j-1,k)) + } + + csarr=RALLOC(double,2*ip); + arg=twopi/ip; + csarr[0]=1.; + csarr[1]=0.; + csarr[2]=csarr[2*ip-2]=cos(arg); + csarr[3]=sin(arg); csarr[2*ip-1]=-csarr[3]; + for (i=2; i<=ip/2; ++i) + { + csarr[2*i]=csarr[2*ip-2*i]=cos(i*arg); + csarr[2*i+1]=sin(i*arg); + csarr[2*ip-2*i+1]=-csarr[2*i+1]; + } + for(l=1; l<ipph; l++) + { + lc=ip-l; + ar1=csarr[2*l]; + ai1=csarr[2*l+1]; + for(ik=0; ik<idl1; ik++) + { + C2(ik,l)=CH2(ik,0)+ar1*CH2(ik,1); + C2(ik,lc)=ai1*CH2(ik,ip-1); + } + aidx=2*l; + for(j=2; j<ipph; j++) + { + jc=ip-j; + aidx+=2*l; + if (aidx>=2*ip) aidx-=2*ip; + ar2=csarr[aidx]; + ai2=csarr[aidx+1]; + for(ik=0; ik<idl1; ik++) + { + C2(ik,l )+=ar2*CH2(ik,j ); + C2(ik,lc)+=ai2*CH2(ik,jc); + } + } + } + DEALLOC(csarr); + + for(j=1; j<ipph; j++) + for(ik=0; ik<idl1; ik++) + CH2(ik,0)+=CH2(ik,j); + + for(j=1,jc=ip-1; j<ipph; j++,jc--) + for(k=0; k<l1; k++) + PM (CH(0,k,jc),CH(0,k,j),C1(0,k,j),C1(0,k,jc)) + + if(ido==1) + return; + for(j=1,jc=ip-1; j<ipph; j++,jc--) + for(k=0; k<l1; k++) + for(i=2; i<ido; i+=2) + { + PM (CH(i-1,k,jc),CH(i-1,k,j ),C1(i-1,k,j),C1(i ,k,jc)) + PM (CH(i ,k,j ),CH(i ,k,jc),C1(i ,k,j),C1(i-1,k,jc)) + } + memcpy(cc,ch,idl1*sizeof(double)); + + for(j=1; j<ip; j++) + for(k=0; k<l1; k++) + { + C1(0,k,j)=CH(0,k,j); + idij=(j-1)*ido+1; + for(i=2; i<ido; i+=2,idij+=2) + MULPM (C1(i,k,j),C1(i-1,k,j),wa[idij-1],wa[idij],CH(i,k,j),CH(i-1,k,j)) + } + } #undef CC #undef CH @@ -615,318 +658,324 @@ extern "C" { cfftf1, cfftb1, cfftf, cfftb, cffti1, cffti. Complex FFTs. ----------------------------------------------------------------------*/ - static void cfft1(size_t n, cmplx c[], cmplx ch[], const cmplx wa[], - const size_t ifac[], int isign) - { - size_t k1, l1=1, nf=ifac[1], iw=0; - cmplx *p1=c, *p2=ch; - - for(k1=0; k1<nf; k1++) - { - size_t ip=ifac[k1+2]; - size_t l2=ip*l1; - size_t ido = n/l2; - if(ip==4) - (isign>0) ? passb4(ido, l1, p1, p2, wa+iw) - : passf4(ido, l1, p1, p2, wa+iw); - else if(ip==2) - (isign>0) ? passb2(ido, l1, p1, p2, wa+iw) - : passf2(ido, l1, p1, p2, wa+iw); - else if(ip==3) - (isign>0) ? passb3(ido, l1, p1, p2, wa+iw) - : passf3(ido, l1, p1, p2, wa+iw); - else if(ip==5) - (isign>0) ? passb5(ido, l1, p1, p2, wa+iw) - : passf5(ido, l1, p1, p2, wa+iw); - else if(ip==6) - (isign>0) ? passb6(ido, l1, p1, p2, wa+iw) - : passf6(ido, l1, p1, p2, wa+iw); - else - (isign>0) ? passbg(ido, ip, l1, p1, p2, wa+iw) - : passfg(ido, ip, l1, p1, p2, wa+iw); - SWAP(p1,p2,cmplx *); - l1=l2; - iw+=(ip-1)*ido; - } - if (p1!=c) - memcpy (c,p1,n*sizeof(cmplx)); - } - - void cfftf(size_t n, double c[], double wsave[]) - { - if (n!=1) - cfft1(n, (cmplx*)c, (cmplx*)wsave, (cmplx*)(wsave+2*n), - (size_t*)(wsave+4*n),-1); - } - - void cfftb(size_t n, double c[], double wsave[]) - { - if (n!=1) - cfft1(n, (cmplx*)c, (cmplx*)wsave, (cmplx*)(wsave+2*n), - (size_t*)(wsave+4*n),+1); - } - - static void factorize (size_t n, const size_t *pf, size_t npf, size_t *ifac) - { - size_t nl=n, nf=0, ntry=0, j=0, i; - - startloop: - j++; - ntry = (j<=npf) ? pf[j-1] : ntry+2; - do - { - size_t nq=nl / ntry; - size_t nr=nl-ntry*nq; - if (nr!=0) - goto startloop; - nf++; - ifac[nf+1]=ntry; - nl=nq; - if ((ntry==2) && (nf!=1)) - { - for (i=nf+1; i>2; --i) - ifac[i]=ifac[i-1]; - ifac[2]=2; - } - } - while(nl!=1); - ifac[0]=n; - ifac[1]=nf; - } - - static void cffti1(size_t n, double wa[], size_t ifac[]) - { - static const size_t ntryh[5]={4,6,3,2,5}; - static const double twopi=6.28318530717958647692; - size_t j, k, fi; - - double argh=twopi/n; - size_t i=0, l1=1; - factorize (n,ntryh,5,ifac); - for(k=1; k<=ifac[1]; k++) - { - size_t ip=ifac[k+1]; - size_t ido=n/(l1*ip); - for(j=1; j<ip; j++) - { - size_t is = i; - double argld=j*l1*argh; - wa[i ]=1; - wa[i+1]=0; - for(fi=1; fi<=ido; fi++) - { - double arg=fi*argld; - i+=2; - wa[i ]=cos(arg); - wa[i+1]=sin(arg); - } - if(ip>6) - { - wa[is ]=wa[i ]; - wa[is+1]=wa[i+1]; - } - } - l1*=ip; - } - } - - void cffti(size_t n, double wsave[]) - { if (n!=1) cffti1(n, wsave+2*n,(size_t*)(wsave+4*n)); } + static void cfft1(size_t n, cmplx c[], cmplx ch[], const cmplx wa[], + const size_t ifac[], int isign) + { + size_t k1, l1=1, nf=ifac[1], iw=0; + cmplx *p1=c, *p2=ch; + + for(k1=0; k1<nf; k1++) + { + size_t ip=ifac[k1+2]; + size_t l2=ip*l1; + size_t ido = n/l2; + if(ip==4) + (isign>0) ? passb4(ido, l1, p1, p2, wa+iw) + : passf4(ido, l1, p1, p2, wa+iw); + else if(ip==2) + (isign>0) ? passb2(ido, l1, p1, p2, wa+iw) + : passf2(ido, l1, p1, p2, wa+iw); + else if(ip==3) + (isign>0) ? passb3(ido, l1, p1, p2, wa+iw) + : passf3(ido, l1, p1, p2, wa+iw); + else if(ip==5) + (isign>0) ? passb5(ido, l1, p1, p2, wa+iw) + : passf5(ido, l1, p1, p2, wa+iw); + else if(ip==6) + (isign>0) ? passb6(ido, l1, p1, p2, wa+iw) + : passf6(ido, l1, p1, p2, wa+iw); + else + (isign>0) ? passbg(ido, ip, l1, p1, p2, wa+iw) + : passfg(ido, ip, l1, p1, p2, wa+iw); + SWAP(p1,p2,cmplx *); + l1=l2; + iw+=(ip-1)*ido; + } + if (p1!=c) + memcpy (c,p1,n*sizeof(cmplx)); + } + + void cfftf(size_t n, double c[], double wsave[]) + { + if (n!=1) + cfft1(n, (cmplx*)c, (cmplx*)wsave, (cmplx*)(wsave+2*n), + (size_t*)(wsave+4*n),-1); + } + + void cfftb(size_t n, double c[], double wsave[]) + { + if (n!=1) + cfft1(n, (cmplx*)c, (cmplx*)wsave, (cmplx*)(wsave+2*n), + (size_t*)(wsave+4*n),+1); + } + + static void factorize (size_t n, const size_t *pf, size_t npf, size_t *ifac) + { + size_t nl=n, nf=0, ntry=0, j=0, i; + + startloop: + j++; + ntry = (j<=npf) ? pf[j-1] : ntry+2; + do + { + size_t nq=nl / ntry; + size_t nr=nl-ntry*nq; + if (nr!=0) + goto startloop; + nf++; + ifac[nf+1]=ntry; + nl=nq; + if ((ntry==2) && (nf!=1)) + { + for (i=nf+1; i>2; --i) + ifac[i]=ifac[i-1]; + ifac[2]=2; + } + } + while(nl!=1); + ifac[0]=n; + ifac[1]=nf; + } + + static void cffti1(size_t n, double wa[], size_t ifac[]) + { + static const size_t ntryh[5]={4,6,3,2,5}; + static const double twopi=6.28318530717958647692; + size_t j, k, fi; + + double argh=twopi/n; + size_t i=0, l1=1; + factorize (n,ntryh,5,ifac); + for(k=1; k<=ifac[1]; k++) + { + size_t ip=ifac[k+1]; + size_t ido=n/(l1*ip); + for(j=1; j<ip; j++) + { + size_t is = i; + double argld=j*l1*argh; + wa[i ]=1; + wa[i+1]=0; + for(fi=1; fi<=ido; fi++) + { + double arg=fi*argld; + i+=2; + wa[i ]=cos(arg); + wa[i+1]=sin(arg); + } + if(ip>6) + { + wa[is ]=wa[i ]; + wa[is+1]=wa[i+1]; + } + } + l1*=ip; + } + } + + void cffti(size_t n, double wsave[]) + { if (n!=1) cffti1(n, wsave+2*n,(size_t*)(wsave+4*n)); } /*---------------------------------------------------------------------- rfftf1, rfftb1, rfftf, rfftb, rffti1, rffti. Real FFTs. ----------------------------------------------------------------------*/ - static void rfftf1( - size_t n, - double c[], - double ch[], - const double wa[], - const size_t ifac[] - ) { - size_t k1, l1=n, nf=ifac[1], iw=n-1; - double *p1=ch, *p2=c; - - for(k1=1; k1<=nf;++k1) - { - size_t ip=ifac[nf-k1+2]; - size_t ido=n / l1; - l1 /= ip; - iw-=(ip-1)*ido; - SWAP (p1,p2,double *); - if(ip==4) - radf4(ido, l1, p1, p2, wa+iw); - else if(ip==2) - radf2(ido, l1, p1, p2, wa+iw); - else if(ip==3) - radf3(ido, l1, p1, p2, wa+iw); - else if(ip==5) - radf5(ido, l1, p1, p2, wa+iw); - else - { - if (ido==1) - SWAP (p1,p2,double *); - radfg(ido, ip, l1, ido*l1, p1, p2, wa+iw); - SWAP (p1,p2,double *); - } - } - if (p1==c) - memcpy (c,ch,n*sizeof(double)); - } - - static void rfftb1(size_t n, double c[], double ch[], const double wa[], - const size_t ifac[]) - { - size_t k1, l1=1, nf=ifac[1], iw=0; - double *p1=c, *p2=ch; - - for(k1=1; k1<=nf; k1++) - { - size_t ip = ifac[k1+1], - ido= n/(ip*l1); - if(ip==4) - radb4(ido, l1, p1, p2, wa+iw); - else if(ip==2) - radb2(ido, l1, p1, p2, wa+iw); - else if(ip==3) - radb3(ido, l1, p1, p2, wa+iw); - else if(ip==5) - radb5(ido, l1, p1, p2, wa+iw); - else - { - radbg(ido, ip, l1, ido*l1, p1, p2, wa+iw); - if (ido!=1) - SWAP (p1,p2,double *); - } - SWAP (p1,p2,double *); - l1*=ip; - iw+=(ip-1)*ido; - } - if (p1!=c) - memcpy (c,ch,n*sizeof(double)); - } - - void rfftf(size_t n, double r[], double wsave[]) - { if(n!=1) rfftf1(n, r, wsave, wsave+n,(size_t*)(wsave+2*n)); } - - void rfftb(size_t n, double r[], double wsave[]) - { if(n!=1) rfftb1(n, r, wsave, wsave+n,(size_t*)(wsave+2*n)); } - - static void rffti1(size_t n, double wa[], size_t ifac[]) - { - static const size_t ntryh[4]={4,2,3,5}; - static const double twopi=6.28318530717958647692; - size_t i, j, k, fi; - - double argh=twopi/n; - size_t is=0, l1=1; - factorize (n,ntryh,4,ifac); - for (k=1; k<ifac[1]; k++) - { - size_t ip=ifac[k+1], - ido=n/(l1*ip); - for (j=1; j<ip; ++j) - { - double argld=j*l1*argh; - for(i=is,fi=1; i<=ido+is-3; i+=2,++fi) - { - double arg=fi*argld; - wa[i ]=cos(arg); - wa[i+1]=sin(arg); - } - is+=ido; - } - l1*=ip; - } - } - - void rffti(size_t n, double wsave[]) - { - if (n!=1) { - rffti1(n, wsave+n,(size_t*)(wsave+2*n)); - } - } - - const double pi = 3.14159265358979; - void sinti (size_t n, double wsave[]) - { - if (n <= 1) return; - size_t ns2 = n / 2; - double dt = pi / double (n+1); - for (size_t k = 0; k < ns2; k++) { - wsave[k] = 2.0 * sin ((k+1) * dt); - } - rffti (n+1, wsave+ns2); - } - - /* - with n = 20 - +0 -> was wsave[0..9] - +10 -> xh wsave[10..30] - +31 -> x wsave[31..51] - +52 -> xxifac wsave[52..] - */ - - void sint1 (size_t n, double war[], double was[], double xh[], double x[], double xxifac[]) - { - double sqrt3 = 1.73205080756888; - - for (size_t i = 0; i < n; i++) { - xh[i] = war[i]; - war[i] = x[i]; - } - - if (n < 2) { - xh[0] *= 2; - } else if (n == 2) { - double xhold = sqrt3*(xh[0]+xh[1]); - xh[1] = sqrt3*(xh[0]-xh[1]); - xh[0] = xhold; - } else { - size_t np1 = n + 1; - size_t ns2 = n / 2; - x[0] = 0.0; - for (size_t k = 0; k < ns2; k++) { - size_t kc = np1 - k; - double t1 = xh[k] - xh[kc]; - double t2 = was[k] * (xh[k] + xh[kc]); - x[k+1] = t1 + t2; - x[kc+1] = t2 - t1; - } - size_t modn = n % 2; - if (modn != 0) { - x[ns2+2] = 4.0 * xh[ns2+1]; - } - rfftf1 (np1, x, xh, war, (size_t*)xxifac); - xh[0] *= 0.5; - for (size_t i = 2; i < n; i += 2) { - xh[i-1] = -x[i]; - xh[i] = xh[i-2] + x[i-1]; - } - if (modn == 0) { - xh[n-1] = -x[n]; - } - } - for (size_t i = 0; i < n; i++) { - x[i] = war[i]; - war[i] = xh[i]; - } - } - - void sint (size_t n, double x[], double wsave[]) - { - sint1 ( - n, - x, - wsave, - wsave + n/2, - wsave + n/2 + n + 1, - wsave + n/2 + 2*n + 2 - ); - } + static void rfftf1( + size_t n, + double c[], + double ch[], + const double wa[], + const size_t ifac[] + ) { + size_t k1, l1=n, nf=ifac[1], iw=n-1; + double *p1=ch, *p2=c; + + for(k1=1; k1<=nf;++k1) + { + size_t ip=ifac[nf-k1+2]; + size_t ido=n / l1; + l1 /= ip; + iw-=(ip-1)*ido; + SWAP (p1,p2,double *); + if(ip==4) + radf4(ido, l1, p1, p2, wa+iw); + else if(ip==2) + radf2(ido, l1, p1, p2, wa+iw); + else if(ip==3) + radf3(ido, l1, p1, p2, wa+iw); + else if(ip==5) + radf5(ido, l1, p1, p2, wa+iw); + else + { + if (ido==1) + SWAP (p1,p2,double *); + radfg(ido, ip, l1, ido*l1, p1, p2, wa+iw); + SWAP (p1,p2,double *); + } + } + if (p1==c) + memcpy (c,ch,n*sizeof(double)); + } + + static void rfftb1(size_t n, double c[], double ch[], const double wa[], + const size_t ifac[]) + { + size_t k1, l1=1, nf=ifac[1], iw=0; + double *p1=c, *p2=ch; + + for(k1=1; k1<=nf; k1++) + { + size_t ip = ifac[k1+1], + ido= n/(ip*l1); + if(ip==4) + radb4(ido, l1, p1, p2, wa+iw); + else if(ip==2) + radb2(ido, l1, p1, p2, wa+iw); + else if(ip==3) + radb3(ido, l1, p1, p2, wa+iw); + else if(ip==5) + radb5(ido, l1, p1, p2, wa+iw); + else + { + radbg(ido, ip, l1, ido*l1, p1, p2, wa+iw); + if (ido!=1) + SWAP (p1,p2,double *); + } + SWAP (p1,p2,double *); + l1*=ip; + iw+=(ip-1)*ido; + } + if (p1!=c) + memcpy (c,ch,n*sizeof(double)); + } + + void rfftf(size_t n, double r[], double wsave[]) + { if(n!=1) rfftf1(n, r, wsave, wsave+n,(size_t*)(wsave+2*n)); } + + void rfftb(size_t n, double r[], double wsave[]) + { if(n!=1) rfftb1(n, r, wsave, wsave+n,(size_t*)(wsave+2*n)); } + + static void rffti1(size_t n, double wa[], size_t ifac[]) + { + static const size_t ntryh[4]={4,2,3,5}; + static const double twopi=6.28318530717958647692; + size_t i, j, k, fi; + + double argh=twopi/n; + size_t is=0, l1=1; + factorize (n,ntryh,4,ifac); + for (k=1; k<ifac[1]; k++) + { + size_t ip=ifac[k+1], + ido=n/(l1*ip); + for (j=1; j<ip; ++j) + { + double argld=j*l1*argh; + for(i=is,fi=1; i<=ido+is-3; i+=2,++fi) + { + double arg=fi*argld; + wa[i ]=cos(arg); + wa[i+1]=sin(arg); + } + is+=ido; + } + l1*=ip; + } + } + + void rffti(size_t n, double wsave[]) + { + if (n!=1) { + rffti1(n, wsave+n,(size_t*)(wsave+2*n)); + } + } + + const double pi = 3.14159265358979; + void sinti (size_t n, double wsave[]) + { + if (n <= 1) return; + size_t ns2 = n / 2; + double dt = pi / double (n+1); + for (size_t k = 0; k < ns2; k++) { + wsave[k] = 2.0 * sin ((k+1) * dt); + } + rffti (n+1, wsave+ns2); + } + + /* + with n = 20 + +0 -> was wsave[0..9] + +10 -> xh wsave[10..30] + +31 -> x wsave[31..51] + +52 -> xxifac wsave[52..] + */ + + void sint1 (size_t n, double war[], double was[], double xh[], double x[], double xxifac[]) + { + double sqrt3 = 1.73205080756888; + + for (size_t i = 0; i < n; i++) { + xh[i] = war[i]; + war[i] = x[i]; + } + + if (n < 2) { + xh[0] *= 2; + } else if (n == 2) { + double xhold = sqrt3*(xh[0]+xh[1]); + xh[1] = sqrt3*(xh[0]-xh[1]); + xh[0] = xhold; + } else { + size_t np1 = n + 1; + size_t ns2 = n / 2; + x[0] = 0.0; + for (size_t k = 0; k < ns2; k++) { + size_t kc = np1 - k; + double t1 = xh[k] - xh[kc]; + double t2 = was[k] * (xh[k] + xh[kc]); + x[k+1] = t1 + t2; + x[kc+1] = t2 - t1; + } + size_t modn = n % 2; + if (modn != 0) { + x[ns2+2] = 4.0 * xh[ns2+1]; + } + rfftf1 (np1, x, xh, war, (size_t*)xxifac); + xh[0] *= 0.5; + for (size_t i = 2; i < n; i += 2) { + xh[i-1] = -x[i]; + xh[i] = xh[i-2] + x[i-1]; + } + if (modn == 0) { + xh[n-1] = -x[n]; + } + } + for (size_t i = 0; i < n; i++) { + x[i] = war[i]; + war[i] = xh[i]; + } + } + + void sint (size_t n, double x[], double wsave[]) + { + sint1 ( + n, + x, + wsave, + wsave + n/2, + wsave + n/2 + n + 1, + wsave + n/2 + 2*n + 2 + ); + } #ifdef __cplusplus } #endif +// vi: set et ts=4 sw=4 sts=4: +// Local Variables: +// mode:c +// c-basic-offset: 4 +// indent-tabs-mode:nil +// End: diff --git a/ippl/src/FFT/fftpack.h b/ippl/src/FFT/fftpack.h index 0d6b2de9b58fc3939cb36e57d782bd9b131d7a09..9cfccd053259873dc8f59a592e2a1cca0403f40d 100644 --- a/ippl/src/FFT/fftpack.h +++ b/ippl/src/FFT/fftpack.h @@ -1,3 +1,13 @@ +// +// IPPL FFT +// +// Copyright (c) 2008-2018 +// Paul Scherrer Institut, Villigen PSI, Switzerland +// All rights reserved. +// +// OPAL is licensed under GNU GPL version 3. +// + /* * This file is part of libfftpack. * @@ -32,33 +42,38 @@ (reformatted by joerg arndt) reformatted and slightly enhanced by Martin Reinecke (2004) - */ +*/ #ifndef PLANCK_FFTPACK_H #define PLANCK_FFTPACK_H -/* #include "c_utils.h" */ - #ifdef __cplusplus extern "C" { #endif /*! forward complex transform */ -void cfftf(size_t N, double complex_data[], double wrk[]); + void cfftf(size_t N, double complex_data[], double wrk[]); /*! backward complex transform */ -void cfftb(size_t N, double complex_data[], double wrk[]); + void cfftb(size_t N, double complex_data[], double wrk[]); /*! initializer for complex transforms */ -void cffti(size_t N, double wrk[]); + void cffti(size_t N, double wrk[]); /*! forward real transform */ -void rfftf(size_t N, double data[], double wrk[]); + void rfftf(size_t N, double data[], double wrk[]); /*! backward real transform */ -void rfftb(size_t N, double data[], double wrk[]); + void rfftb(size_t N, double data[], double wrk[]); /*! initializer for real transforms */ -void rffti(size_t N, double wrk[]); + void rffti(size_t N, double wrk[]); #ifdef __cplusplus } #endif #endif + +// vi: set et ts=4 sw=4 sts=4: +// Local Variables: +// mode:c +// c-basic-offset: 4 +// indent-tabs-mode:nil +// End: diff --git a/ippl/src/FFT/fftpack_FFT.h b/ippl/src/FFT/fftpack_FFT.h index ccfc72d14449eb69b225c881be45e5550e63583d..2e289fc76bd16adbd2006a224ac0a40ad4167884 100644 --- a/ippl/src/FFT/fftpack_FFT.h +++ b/ippl/src/FFT/fftpack_FFT.h @@ -1,12 +1,19 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ +// +// IPPL FFT +// +// Copyright (c) 2008-2018 +// Paul Scherrer Institut, Villigen PSI, Switzerland +// All rights reserved. +// +// OPAL is licensed under GNU GPL version 3. +// + +/* + Prototypes for accessing Fortran 1D FFT routines from + Netlib, and definitions for templated class FFTPACK, which acts as an + FFT engine for the FFT class, providing storage for trigonometric + information and performing the 1D FFTs as needed. +*/ #ifndef IPPL_FFT_FFTPACK_FFT_H #define IPPL_FFT_FFTPACK_FFT_H @@ -14,39 +21,30 @@ #include "Utility/PAssert.h" #include "Utility/IpplInfo.h" - -/************************************************************************** - * fftpack_FFT.h: Prototypes for accessing Fortran 1D FFT routines from - * Netlib, and definitions for templated class FFTPACK, which acts as an - * FFT engine for the FFT class, providing storage for trigonometric - * information and performing the 1D FFTs as needed. - **************************************************************************/ - - // FFTPACK function prototypes for Fortran routines extern "C" { - // double-precision CC FFT - void cffti (size_t n, double& wsave); - void cfftf (size_t n, double& r, double& wsave); - void cfftb (size_t n, double& r, double& wsave); - // double-precision RC FFT - void rffti (size_t n, double& wsave); - void rfftf (size_t n, double& r, double& wsave); - void rfftb (size_t n, double& r, double& wsave); - // double-precision sine transform - void sinti (size_t n, double& wsave); - void sint (size_t n, double& r, double& wsave); - // single-precision CC FFT - void fcffti (size_t n, float& wsave); - void fcfftf (size_t n, float& r, float& wsave); - void fcfftb (size_t n, float& r, float& wsave); - // single-precision RC FFT - void frffti (size_t n, float& wsave); - void frfftf (size_t n, float& r, float& wsave); - void frfftb (size_t n, float& r, float& wsave); - // single-precision sine transform - void fsinti (size_t n, float& wsave); - void fsint (size_t n, float& r, float& wsave); + // double-precision CC FFT + void cffti (size_t n, double& wsave); + void cfftf (size_t n, double& r, double& wsave); + void cfftb (size_t n, double& r, double& wsave); + // double-precision RC FFT + void rffti (size_t n, double& wsave); + void rfftf (size_t n, double& r, double& wsave); + void rfftb (size_t n, double& r, double& wsave); + // double-precision sine transform + void sinti (size_t n, double& wsave); + void sint (size_t n, double& r, double& wsave); + // single-precision CC FFT + void fcffti (size_t n, float& wsave); + void fcfftf (size_t n, float& r, float& wsave); + void fcfftb (size_t n, float& r, float& wsave); + // single-precision RC FFT + void frffti (size_t n, float& wsave); + void frfftf (size_t n, float& r, float& wsave); + void frfftb (size_t n, float& r, float& wsave); + // single-precision sine transform + void fsinti (size_t n, float& wsave); + void fsint (size_t n, float& r, float& wsave); } @@ -60,21 +58,20 @@ template <> class FFTPACK_wrap<float> { public: - // interface functions used by class FFTPACK - - // initialization functions for CC FFT, RC FFT, and sine transform - static void ccffti(size_t n, float* wsave) { fcffti (n, *wsave); } - static void rcffti(size_t n, float* wsave) { frffti (n, *wsave); } - static void rrffti(size_t n, float* wsave) { fsinti (n, *wsave); } - // forward and backward CC FFT - static void ccfftf(size_t n, float* r, float* wsave) { fcfftf (n, *r, *wsave); } - static void ccfftb(size_t n, float* r, float* wsave) { fcfftb (n, *r, *wsave); } - // forward and backward RC FFT - static void rcfftf(size_t n, float* r, float* wsave) { frfftf (n, *r, *wsave); } - static void rcfftb(size_t n, float* r, float* wsave) { frfftb (n, *r, *wsave); } - // sine transform - static void rrfft(size_t n, float* r, float* wsave) { fsint (n, *r, *wsave); } - + // interface functions used by class FFTPACK + + // initialization functions for CC FFT, RC FFT, and sine transform + static void ccffti(size_t n, float* wsave) { fcffti (n, *wsave); } + static void rcffti(size_t n, float* wsave) { frffti (n, *wsave); } + static void rrffti(size_t n, float* wsave) { fsinti (n, *wsave); } + // forward and backward CC FFT + static void ccfftf(size_t n, float* r, float* wsave) { fcfftf (n, *r, *wsave); } + static void ccfftb(size_t n, float* r, float* wsave) { fcfftb (n, *r, *wsave); } + // forward and backward RC FFT + static void rcfftf(size_t n, float* r, float* wsave) { frfftf (n, *r, *wsave); } + static void rcfftb(size_t n, float* r, float* wsave) { frfftb (n, *r, *wsave); } + // sine transform + static void rrfft(size_t n, float* r, float* wsave) { fsint (n, *r, *wsave); } }; // Specialization for double @@ -82,20 +79,20 @@ template <> class FFTPACK_wrap<double> { public: - // interface functions used by class FFTPACK - - // initialization functions for CC FFT, RC FFT, and sine transform - static void ccffti(size_t n, double* wsave) { cffti (n, *wsave); } - static void rcffti(size_t n, double* wsave) { rffti (n, *wsave); } - static void rrffti(size_t n, double* wsave) { sinti (n, *wsave); } - // forward and backward CC FFT - static void ccfftf(size_t n, double* r, double* wsave) {cfftf (n, *r, *wsave);} - static void ccfftb(size_t n, double* r, double* wsave) {cfftb (n, *r, *wsave);} - // forward and backward RC FFT - static void rcfftf(size_t n, double* r, double* wsave) {rfftf (n, *r, *wsave);} - static void rcfftb(size_t n, double* r, double* wsave) {rfftb (n, *r, *wsave);} - // sine transform - static void rrfft(size_t n, double* r, double* wsave) { sint (n, *r, *wsave); } + // interface functions used by class FFTPACK + + // initialization functions for CC FFT, RC FFT, and sine transform + static void ccffti(size_t n, double* wsave) { cffti (n, *wsave); } + static void rcffti(size_t n, double* wsave) { rffti (n, *wsave); } + static void rrffti(size_t n, double* wsave) { sinti (n, *wsave); } + // forward and backward CC FFT + static void ccfftf(size_t n, double* r, double* wsave) {cfftf (n, *r, *wsave);} + static void ccfftb(size_t n, double* r, double* wsave) {cfftb (n, *r, *wsave);} + // forward and backward RC FFT + static void rcfftf(size_t n, double* r, double* wsave) {rfftf (n, *r, *wsave);} + static void rcfftb(size_t n, double* r, double* wsave) {rfftb (n, *r, *wsave);} + // sine transform + static void rrfft(size_t n, double* r, double* wsave) { sint (n, *r, *wsave); } }; @@ -105,37 +102,33 @@ class FFTPACK { public: - // definition of complex type -#ifdef IPPL_HAS_TEMPLATED_COMPLEX - typedef std::complex<T> Complex_t; -#else - typedef complex Complex_t; -#endif + // definition of complex type + typedef std::complex<T> Complex_t; - // Trivial constructor. Do the real work in setup function. - FFTPACK(void) {} + // Trivial constructor. Do the real work in setup function. + FFTPACK(void) {} - // destructor - ~FFTPACK(void); + // destructor + ~FFTPACK(void); - // setup internal storage and prepare to perform FFTs - // inputs are number of dimensions to transform, the transform types, - // and the lengths of these dimensions. - void setup(unsigned numTransformDims, const int* transformTypes, - const int* axisLengths); + // setup internal storage and prepare to perform FFTs + // inputs are number of dimensions to transform, the transform types, + // and the lengths of these dimensions. + void setup(unsigned numTransformDims, const int* transformTypes, + const int* axisLengths); - // invoke FFT on complex data for given dimension and direction - void callFFT(unsigned transformDim, int direction, Complex_t* data); + // invoke FFT on complex data for given dimension and direction + void callFFT(unsigned transformDim, int direction, Complex_t* data); - // invoke FFT on real data for given dimension and direction - void callFFT(unsigned transformDim, int direction, T* data); + // invoke FFT on real data for given dimension and direction + void callFFT(unsigned transformDim, int direction, T* data); private: - unsigned numTransformDims_m; // number of dimensions to transform - int* transformType_m; // transform type for each dimension - int* axisLength_m; // length of each transform dimension - T** trig_m; // trigonometric tables + unsigned numTransformDims_m; // number of dimensions to transform + int* transformType_m; // transform type for each dimension + int* axisLength_m; // length of each transform dimension + T** trig_m; // trigonometric tables }; @@ -146,12 +139,12 @@ private: template <class T> inline FFTPACK<T>::~FFTPACK(void) { - // delete storage - for (unsigned d=0; d<numTransformDims_m; ++d) - delete [] trig_m[d]; - delete [] trig_m; - delete [] transformType_m; - delete [] axisLength_m; + // delete storage + for (unsigned d=0; d<numTransformDims_m; ++d) + delete [] trig_m[d]; + delete [] trig_m; + delete [] transformType_m; + delete [] axisLength_m; } // setup internal storage to prepare for FFTs @@ -160,39 +153,39 @@ inline void FFTPACK<T>::setup(unsigned numTransformDims, const int* transformTypes, const int* axisLengths) { - // store transform types and lengths for each transform dim - numTransformDims_m = numTransformDims; - transformType_m = new int[numTransformDims_m]; - axisLength_m = new int[numTransformDims_m]; - unsigned d; - for (d=0; d<numTransformDims_m; ++d) { - transformType_m[d] = transformTypes[d]; - axisLength_m[d] = axisLengths[d]; - } - - // allocate and initialize trig table - trig_m = new T*[numTransformDims_m]; - for (d=0; d<numTransformDims_m; ++d) { - switch (transformType_m[d]) { - case 0: // CC FFT - trig_m[d] = new T[4 * axisLength_m[d] + 15]; - FFTPACK_wrap<T>::ccffti(axisLength_m[d], trig_m[d]); - break; - case 1: // RC FFT - trig_m[d] = new T[2 * axisLength_m[d] + 15]; - FFTPACK_wrap<T>::rcffti(axisLength_m[d], trig_m[d]); - break; - case 2: // Sine transform - trig_m[d] = new T[static_cast<int>(2.5 * axisLength_m[d] + 0.5) + 15]; - FFTPACK_wrap<T>::rrffti(axisLength_m[d], trig_m[d]); - break; - default: - ERRORMSG("Unknown transform type requested!!" << endl); - break; + // store transform types and lengths for each transform dim + numTransformDims_m = numTransformDims; + transformType_m = new int[numTransformDims_m]; + axisLength_m = new int[numTransformDims_m]; + unsigned d; + for (d=0; d<numTransformDims_m; ++d) { + transformType_m[d] = transformTypes[d]; + axisLength_m[d] = axisLengths[d]; + } + + // allocate and initialize trig table + trig_m = new T*[numTransformDims_m]; + for (d=0; d<numTransformDims_m; ++d) { + switch (transformType_m[d]) { + case 0: // CC FFT + trig_m[d] = new T[4 * axisLength_m[d] + 15]; + FFTPACK_wrap<T>::ccffti(axisLength_m[d], trig_m[d]); + break; + case 1: // RC FFT + trig_m[d] = new T[2 * axisLength_m[d] + 15]; + FFTPACK_wrap<T>::rcffti(axisLength_m[d], trig_m[d]); + break; + case 2: // Sine transform + trig_m[d] = new T[static_cast<int>(2.5 * axisLength_m[d] + 0.5) + 15]; + FFTPACK_wrap<T>::rrffti(axisLength_m[d], trig_m[d]); + break; + default: + ERRORMSG("Unknown transform type requested!!" << endl); + break; + } } - } - return; + return; } // invoke FFT on complex data for given dimension and direction @@ -201,59 +194,59 @@ inline void FFTPACK<T>::callFFT(unsigned transformDim, int direction, FFTPACK<T>::Complex_t* data) { - // check transform dimension and direction arguments - PAssert_LT(transformDim, numTransformDims_m); - PAssert_EQ(std::abs(direction), 1); + // check transform dimension and direction arguments + PAssert_LT(transformDim, numTransformDims_m); + PAssert_EQ(std::abs(direction), 1); - // cast complex number pointer to T* for calling Fortran routines - T* rdata = reinterpret_cast<T*>(data); + // cast complex number pointer to T* for calling Fortran routines + T* rdata = reinterpret_cast<T*>(data); - // branch on transform type for this dimension - switch (transformType_m[transformDim]) { - case 0: // CC FFT - if (direction == +1) { - // call forward complex-to-complex FFT - FFTPACK_wrap<T>::ccfftf(axisLength_m[transformDim], rdata, - trig_m[transformDim]); - } - else { - // call backward complex-to-complex FFT - FFTPACK_wrap<T>::ccfftb(axisLength_m[transformDim], rdata, - trig_m[transformDim]); - } - break; - case 1: // RC FFT - if (direction == +1) { - // call forward real-to-complex FFT - FFTPACK_wrap<T>::rcfftf(axisLength_m[transformDim], rdata, - trig_m[transformDim]); - // rearrange output to conform with SGI format for complex result - int clen = axisLength_m[transformDim]/2 + 1; - data[clen-1] = Complex_t(imag(data[clen-2]),0.0); - for (int i = clen-2; i > 0; --i) - data[i] = Complex_t(imag(data[i-1]),real(data[i])); - data[0] = Complex_t(real(data[0]),0.0); - } - else { - // rearrange input to conform with Netlib format for complex modes - int clen = axisLength_m[transformDim]/2 + 1; - data[0] = Complex_t(real(data[0]),real(data[1])); - for (int i = 1; i < clen-1; ++i) - data[i] = Complex_t(imag(data[i]),real(data[i+1])); - // call backward complex-to-real FFT - FFTPACK_wrap<T>::rcfftb(axisLength_m[transformDim], rdata, - trig_m[transformDim]); + // branch on transform type for this dimension + switch (transformType_m[transformDim]) { + case 0: // CC FFT + if (direction == +1) { + // call forward complex-to-complex FFT + FFTPACK_wrap<T>::ccfftf(axisLength_m[transformDim], rdata, + trig_m[transformDim]); + } + else { + // call backward complex-to-complex FFT + FFTPACK_wrap<T>::ccfftb(axisLength_m[transformDim], rdata, + trig_m[transformDim]); + } + break; + case 1: // RC FFT + if (direction == +1) { + // call forward real-to-complex FFT + FFTPACK_wrap<T>::rcfftf(axisLength_m[transformDim], rdata, + trig_m[transformDim]); + // rearrange output to conform with SGI format for complex result + int clen = axisLength_m[transformDim]/2 + 1; + data[clen-1] = Complex_t(imag(data[clen-2]),0.0); + for (int i = clen-2; i > 0; --i) + data[i] = Complex_t(imag(data[i-1]),real(data[i])); + data[0] = Complex_t(real(data[0]),0.0); + } + else { + // rearrange input to conform with Netlib format for complex modes + int clen = axisLength_m[transformDim]/2 + 1; + data[0] = Complex_t(real(data[0]),real(data[1])); + for (int i = 1; i < clen-1; ++i) + data[i] = Complex_t(imag(data[i]),real(data[i+1])); + // call backward complex-to-real FFT + FFTPACK_wrap<T>::rcfftb(axisLength_m[transformDim], rdata, + trig_m[transformDim]); + } + break; + case 2: // Sine transform + ERRORMSG("Input for real-to-real FFT should be real!!" << endl); + break; + default: + ERRORMSG("Unknown transform type requested!!" << endl); + break; } - break; - case 2: // Sine transform - ERRORMSG("Input for real-to-real FFT should be real!!" << endl); - break; - default: - ERRORMSG("Unknown transform type requested!!" << endl); - break; - } - - return; + + return; } // invoke FFT on real data for given dimension and direction @@ -261,37 +254,36 @@ template <class T> inline void FFTPACK<T>::callFFT(unsigned transformDim, int direction, T* data) { - // check transform dimension and direction arguments - PAssert_LT(transformDim, numTransformDims_m); - PAssert_EQ(std::abs(direction), 1); - - // branch on transform type for this dimension - switch (transformType_m[transformDim]) { - case 0: // CC FFT - ERRORMSG("Input for complex-to-complex FFT should be complex!!" << endl); - break; - case 1: // RC FFT - ERRORMSG("real-to-complex FFT uses complex input!!" << endl); - break; - case 2: // Sine transform - // invoke the real-to-real transform on the data - FFTPACK_wrap<T>::rrfft(axisLength_m[transformDim], data, - trig_m[transformDim]); - break; - default: - ERRORMSG("Unknown transform type requested!!" << endl); - break; - } - - return; -} + // check transform dimension and direction arguments + PAssert_LT(transformDim, numTransformDims_m); + PAssert_EQ(std::abs(direction), 1); + // branch on transform type for this dimension + switch (transformType_m[transformDim]) { + case 0: // CC FFT + ERRORMSG("Input for complex-to-complex FFT should be complex!!" << endl); + break; + case 1: // RC FFT + ERRORMSG("real-to-complex FFT uses complex input!!" << endl); + break; + case 2: // Sine transform + // invoke the real-to-real transform on the data + FFTPACK_wrap<T>::rrfft(axisLength_m[transformDim], data, + trig_m[transformDim]); + break; + default: + ERRORMSG("Unknown transform type requested!!" << endl); + break; + } + return; +} #endif // IPPL_FFT_FFTPACK_FFT_H -/*************************************************************************** - * $RCSfile: fftpack_FFT.h,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $ - * IPPL_VERSION_ID: $Id: fftpack_FFT.h,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $ - ***************************************************************************/ +// vi: set et ts=4 sw=4 sts=4: +// Local Variables: +// mode:c +// c-basic-offset: 4 +// indent-tabs-mode:nil +// End: diff --git a/ippl/src/FFT/fftpack_inc.c b/ippl/src/FFT/fftpack_inc.c index 55d0ac579d7199a5eb4c1a85ad804dabdf906c5c..d17960d5a09d7b37247d724856ecc5537957fe8f 100644 --- a/ippl/src/FFT/fftpack_inc.c +++ b/ippl/src/FFT/fftpack_inc.c @@ -1,3 +1,13 @@ +// +// IPPL FFT +// +// Copyright (c) 2008-2018 +// Paul Scherrer Institut, Villigen PSI, Switzerland +// All rights reserved. +// +// OPAL is licensed under GNU GPL version 3. +// + /* * This file is part of libfftpack. * @@ -28,7 +38,7 @@ (Version 4, 1985). C port by Martin Reinecke (2010) - */ +*/ #ifdef BACKWARD #define PSIGN + @@ -43,264 +53,271 @@ #endif static void X(2) (size_t ido, size_t l1, const cmplx *cc, cmplx *ch, - const cmplx *wa) - { - const size_t cdim=2; - size_t k,i; - cmplx t; - if (ido==1) - for (k=0;k<l1;++k) - PMC (CH(0,k,0),CH(0,k,1),CC(0,0,k),CC(0,1,k)) - else - for (k=0;k<l1;++k) - for (i=0;i<ido;++i) - { - PMC (CH(i,k,0),t,CC(i,0,k),CC(i,1,k)) - MULPMSIGNC (CH(i,k,1),WA(0,i),t) - } - } + const cmplx *wa) +{ + const size_t cdim=2; + size_t k,i; + cmplx t; + if (ido==1) + for (k=0;k<l1;++k) + PMC (CH(0,k,0),CH(0,k,1),CC(0,0,k),CC(0,1,k)) + else + for (k=0;k<l1;++k) + for (i=0;i<ido;++i) + { + PMC (CH(i,k,0),t,CC(i,0,k),CC(i,1,k)) + MULPMSIGNC (CH(i,k,1),WA(0,i),t) + } +} static void X(3)(size_t ido, size_t l1, const cmplx *cc, cmplx *ch, - const cmplx *wa) - { - const size_t cdim=3; - static const double taur=-0.5, taui= PSIGN 0.86602540378443864676; - size_t i, k; - cmplx c2, c3, d2, d3, t2; + const cmplx *wa) +{ + const size_t cdim=3; + static const double taur=-0.5, taui= PSIGN 0.86602540378443864676; + size_t i, k; + cmplx c2, c3, d2, d3, t2; - if (ido==1) - for (k=0; k<l1; ++k) - { - PMC (t2,c3,CC(0,1,k),CC(0,2,k)) - ADDC (CH(0,k,0),t2,CC(0,0,k)) - SCALEC(t2,taur) - ADDC(c2,CC(0,0,k),t2) - SCALEC(c3,taui) - CONJFLIPC(c3) - PMC(CH(0,k,1),CH(0,k,2),c2,c3) - } - else - for (k=0; k<l1; ++k) - for (i=0; i<ido; ++i) + if (ido==1) + for (k=0; k<l1; ++k) { - PMC (t2,c3,CC(i,1,k),CC(i,2,k)) - ADDC (CH(i,k,0),t2,CC(i,0,k)) - SCALEC(t2,taur) - ADDC(c2,CC(i,0,k),t2) - SCALEC(c3,taui) - CONJFLIPC(c3) - PMC(d2,d3,c2,c3) - MULPMSIGNC(CH(i,k,1),WA(0,i),d2) - MULPMSIGNC(CH(i,k,2),WA(1,i),d3) - } - } + PMC (t2,c3,CC(0,1,k),CC(0,2,k)) + ADDC (CH(0,k,0),t2,CC(0,0,k)) + SCALEC(t2,taur) + ADDC(c2,CC(0,0,k),t2) + SCALEC(c3,taui) + CONJFLIPC(c3) + PMC(CH(0,k,1),CH(0,k,2),c2,c3) + } + else + for (k=0; k<l1; ++k) + for (i=0; i<ido; ++i) + { + PMC (t2,c3,CC(i,1,k),CC(i,2,k)) + ADDC (CH(i,k,0),t2,CC(i,0,k)) + SCALEC(t2,taur) + ADDC(c2,CC(i,0,k),t2) + SCALEC(c3,taui) + CONJFLIPC(c3) + PMC(d2,d3,c2,c3) + MULPMSIGNC(CH(i,k,1),WA(0,i),d2) + MULPMSIGNC(CH(i,k,2),WA(1,i),d3) + } +} static void X(4)(size_t ido, size_t l1, const cmplx *cc, cmplx *ch, - const cmplx *wa) - { - const size_t cdim=4; - size_t i, k; - cmplx c2, c3, c4, t1, t2, t3, t4; + const cmplx *wa) +{ + const size_t cdim=4; + size_t i, k; + cmplx c2, c3, c4, t1, t2, t3, t4; - if (ido==1) - for (k=0; k<l1; ++k) - { - PMC(t2,t1,CC(0,0,k),CC(0,2,k)) - PMC(t3,t4,CC(0,1,k),CC(0,3,k)) - CONJFLIPC(t4) - PMC(CH(0,k,0),CH(0,k,2),t2,t3) - PMSIGNC (CH(0,k,1),CH(0,k,3),t1,t4) - } - else - for (k=0; k<l1; ++k) - for (i=0; i<ido; ++i) + if (ido==1) + for (k=0; k<l1; ++k) { - PMC(t2,t1,CC(i,0,k),CC(i,2,k)) - PMC(t3,t4,CC(i,1,k),CC(i,3,k)) - CONJFLIPC(t4) - PMC(CH(i,k,0),c3,t2,t3) - PMSIGNC (c2,c4,t1,t4) - MULPMSIGNC (CH(i,k,1),WA(0,i),c2) - MULPMSIGNC (CH(i,k,2),WA(1,i),c3) - MULPMSIGNC (CH(i,k,3),WA(2,i),c4) - } - } + PMC(t2,t1,CC(0,0,k),CC(0,2,k)) + PMC(t3,t4,CC(0,1,k),CC(0,3,k)) + CONJFLIPC(t4) + PMC(CH(0,k,0),CH(0,k,2),t2,t3) + PMSIGNC (CH(0,k,1),CH(0,k,3),t1,t4) + } + else + for (k=0; k<l1; ++k) + for (i=0; i<ido; ++i) + { + PMC(t2,t1,CC(i,0,k),CC(i,2,k)) + PMC(t3,t4,CC(i,1,k),CC(i,3,k)) + CONJFLIPC(t4) + PMC(CH(i,k,0),c3,t2,t3) + PMSIGNC (c2,c4,t1,t4) + MULPMSIGNC (CH(i,k,1),WA(0,i),c2) + MULPMSIGNC (CH(i,k,2),WA(1,i),c3) + MULPMSIGNC (CH(i,k,3),WA(2,i),c4) + } +} static void X(5)(size_t ido, size_t l1, const cmplx *cc, cmplx *ch, - const cmplx *wa) - { - const size_t cdim=5; - static const double tr11= 0.3090169943749474241, - ti11= PSIGN 0.95105651629515357212, - tr12=-0.8090169943749474241, - ti12= PSIGN 0.58778525229247312917; - size_t i, k; - cmplx c2, c3, c4, c5, d2, d3, d4, d5, t2, t3, t4, t5; + const cmplx *wa) +{ + const size_t cdim=5; + static const double tr11= 0.3090169943749474241, + ti11= PSIGN 0.95105651629515357212, + tr12=-0.8090169943749474241, + ti12= PSIGN 0.58778525229247312917; + size_t i, k; + cmplx c2, c3, c4, c5, d2, d3, d4, d5, t2, t3, t4, t5; - if (ido==1) - for (k=0; k<l1; ++k) - { - PMC (t2,t5,CC(0,1,k),CC(0,4,k)) - PMC (t3,t4,CC(0,2,k),CC(0,3,k)) - CH(0,k,0).r=CC(0,0,k).r+t2.r+t3.r; - CH(0,k,0).i=CC(0,0,k).i+t2.i+t3.i; - c2.r=CC(0,0,k).r+tr11*t2.r+tr12*t3.r; - c2.i=CC(0,0,k).i+tr11*t2.i+tr12*t3.i; - c3.r=CC(0,0,k).r+tr12*t2.r+tr11*t3.r; - c3.i=CC(0,0,k).i+tr12*t2.i+tr11*t3.i; - c5.r=ti11*t5.r+ti12*t4.r; - c5.i=ti11*t5.i+ti12*t4.i; - c4.r=ti12*t5.r-ti11*t4.r; - c4.i=ti12*t5.i-ti11*t4.i; - CONJFLIPC(c5) - PMC(CH(0,k,1),CH(0,k,4),c2,c5) - CONJFLIPC(c4) - PMC(CH(0,k,2),CH(0,k,3),c3,c4) - } - else - for (k=0; k<l1; ++k) - for (i=0; i<ido; ++i) + if (ido==1) + for (k=0; k<l1; ++k) { - PMC (t2,t5,CC(i,1,k),CC(i,4,k)) - PMC (t3,t4,CC(i,2,k),CC(i,3,k)) - CH(i,k,0).r=CC(i,0,k).r+t2.r+t3.r; - CH(i,k,0).i=CC(i,0,k).i+t2.i+t3.i; - c2.r=CC(i,0,k).r+tr11*t2.r+tr12*t3.r; - c2.i=CC(i,0,k).i+tr11*t2.i+tr12*t3.i; - c3.r=CC(i,0,k).r+tr12*t2.r+tr11*t3.r; - c3.i=CC(i,0,k).i+tr12*t2.i+tr11*t3.i; - c5.r=ti11*t5.r+ti12*t4.r; - c5.i=ti11*t5.i+ti12*t4.i; - c4.r=ti12*t5.r-ti11*t4.r; - c4.i=ti12*t5.i-ti11*t4.i; - CONJFLIPC(c5) - PMC(d2,d5,c2,c5) - CONJFLIPC(c4) - PMC(d3,d4,c3,c4) - MULPMSIGNC (CH(i,k,1),WA(0,i),d2) - MULPMSIGNC (CH(i,k,2),WA(1,i),d3) - MULPMSIGNC (CH(i,k,3),WA(2,i),d4) - MULPMSIGNC (CH(i,k,4),WA(3,i),d5) - } - } + PMC (t2,t5,CC(0,1,k),CC(0,4,k)) + PMC (t3,t4,CC(0,2,k),CC(0,3,k)) + CH(0,k,0).r=CC(0,0,k).r+t2.r+t3.r; + CH(0,k,0).i=CC(0,0,k).i+t2.i+t3.i; + c2.r=CC(0,0,k).r+tr11*t2.r+tr12*t3.r; + c2.i=CC(0,0,k).i+tr11*t2.i+tr12*t3.i; + c3.r=CC(0,0,k).r+tr12*t2.r+tr11*t3.r; + c3.i=CC(0,0,k).i+tr12*t2.i+tr11*t3.i; + c5.r=ti11*t5.r+ti12*t4.r; + c5.i=ti11*t5.i+ti12*t4.i; + c4.r=ti12*t5.r-ti11*t4.r; + c4.i=ti12*t5.i-ti11*t4.i; + CONJFLIPC(c5) + PMC(CH(0,k,1),CH(0,k,4),c2,c5) + CONJFLIPC(c4) + PMC(CH(0,k,2),CH(0,k,3),c3,c4) + } + else + for (k=0; k<l1; ++k) + for (i=0; i<ido; ++i) + { + PMC (t2,t5,CC(i,1,k),CC(i,4,k)) + PMC (t3,t4,CC(i,2,k),CC(i,3,k)) + CH(i,k,0).r=CC(i,0,k).r+t2.r+t3.r; + CH(i,k,0).i=CC(i,0,k).i+t2.i+t3.i; + c2.r=CC(i,0,k).r+tr11*t2.r+tr12*t3.r; + c2.i=CC(i,0,k).i+tr11*t2.i+tr12*t3.i; + c3.r=CC(i,0,k).r+tr12*t2.r+tr11*t3.r; + c3.i=CC(i,0,k).i+tr12*t2.i+tr11*t3.i; + c5.r=ti11*t5.r+ti12*t4.r; + c5.i=ti11*t5.i+ti12*t4.i; + c4.r=ti12*t5.r-ti11*t4.r; + c4.i=ti12*t5.i-ti11*t4.i; + CONJFLIPC(c5) + PMC(d2,d5,c2,c5) + CONJFLIPC(c4) + PMC(d3,d4,c3,c4) + MULPMSIGNC (CH(i,k,1),WA(0,i),d2) + MULPMSIGNC (CH(i,k,2),WA(1,i),d3) + MULPMSIGNC (CH(i,k,3),WA(2,i),d4) + MULPMSIGNC (CH(i,k,4),WA(3,i),d5) + } +} static void X(6)(size_t ido, size_t l1, const cmplx *cc, cmplx *ch, - const cmplx *wa) - { - const size_t cdim=6; - static const double taui= PSIGN 0.86602540378443864676; - cmplx ta1,ta2,ta3,a0,a1,a2,tb1,tb2,tb3,b0,b1,b2,d1,d2,d3,d4,d5; - size_t i, k; + const cmplx *wa) +{ + const size_t cdim=6; + static const double taui= PSIGN 0.86602540378443864676; + cmplx ta1,ta2,ta3,a0,a1,a2,tb1,tb2,tb3,b0,b1,b2,d1,d2,d3,d4,d5; + size_t i, k; - if (ido==1) - for (k=0; k<l1; ++k) - { - PMC(ta1,ta3,CC(0,2,k),CC(0,4,k)) - ta2.r = CC(0,0,k).r - .5*ta1.r; - ta2.i = CC(0,0,k).i - .5*ta1.i; - SCALEC(ta3,taui) - ADDC(a0,CC(0,0,k),ta1) - CONJFLIPC(ta3) - PMC(a1,a2,ta2,ta3) - PMC(tb1,tb3,CC(0,5,k),CC(0,1,k)) - tb2.r = CC(0,3,k).r - .5*tb1.r; - tb2.i = CC(0,3,k).i - .5*tb1.i; - SCALEC(tb3,taui) - ADDC(b0,CC(0,3,k),tb1) - CONJFLIPC(tb3) - PMC(b1,b2,tb2,tb3) - PMC(CH(0,k,0),CH(0,k,3),a0,b0) - PMC(CH(0,k,4),CH(0,k,1),a1,b1) - PMC(CH(0,k,2),CH(0,k,5),a2,b2) - } - else - for (k=0; k<l1; ++k) - for (i=0; i<ido; ++i) + if (ido==1) + for (k=0; k<l1; ++k) { - PMC(ta1,ta3,CC(i,2,k),CC(i,4,k)) - ta2.r = CC(i,0,k).r - .5*ta1.r; - ta2.i = CC(i,0,k).i - .5*ta1.i; - SCALEC(ta3,taui) - ADDC(a0,CC(i,0,k),ta1) - CONJFLIPC(ta3) - PMC(a1,a2,ta2,ta3) - PMC(tb1,tb3,CC(i,5,k),CC(i,1,k)) - tb2.r = CC(i,3,k).r - .5*tb1.r; - tb2.i = CC(i,3,k).i - .5*tb1.i; - SCALEC(tb3,taui) - ADDC(b0,CC(i,3,k),tb1) - CONJFLIPC(tb3) - PMC(b1,b2,tb2,tb3) - PMC(CH(i,k,0),d3,a0,b0) - PMC(d4,d1,a1,b1) - PMC(d2,d5,a2,b2) - MULPMSIGNC (CH(i,k,1),WA(0,i),d1) - MULPMSIGNC (CH(i,k,2),WA(1,i),d2) - MULPMSIGNC (CH(i,k,3),WA(2,i),d3) - MULPMSIGNC (CH(i,k,4),WA(3,i),d4) - MULPMSIGNC (CH(i,k,5),WA(4,i),d5) - } - } + PMC(ta1,ta3,CC(0,2,k),CC(0,4,k)) + ta2.r = CC(0,0,k).r - .5*ta1.r; + ta2.i = CC(0,0,k).i - .5*ta1.i; + SCALEC(ta3,taui) + ADDC(a0,CC(0,0,k),ta1) + CONJFLIPC(ta3) + PMC(a1,a2,ta2,ta3) + PMC(tb1,tb3,CC(0,5,k),CC(0,1,k)) + tb2.r = CC(0,3,k).r - .5*tb1.r; + tb2.i = CC(0,3,k).i - .5*tb1.i; + SCALEC(tb3,taui) + ADDC(b0,CC(0,3,k),tb1) + CONJFLIPC(tb3) + PMC(b1,b2,tb2,tb3) + PMC(CH(0,k,0),CH(0,k,3),a0,b0) + PMC(CH(0,k,4),CH(0,k,1),a1,b1) + PMC(CH(0,k,2),CH(0,k,5),a2,b2) + } + else + for (k=0; k<l1; ++k) + for (i=0; i<ido; ++i) + { + PMC(ta1,ta3,CC(i,2,k),CC(i,4,k)) + ta2.r = CC(i,0,k).r - .5*ta1.r; + ta2.i = CC(i,0,k).i - .5*ta1.i; + SCALEC(ta3,taui) + ADDC(a0,CC(i,0,k),ta1) + CONJFLIPC(ta3) + PMC(a1,a2,ta2,ta3) + PMC(tb1,tb3,CC(i,5,k),CC(i,1,k)) + tb2.r = CC(i,3,k).r - .5*tb1.r; + tb2.i = CC(i,3,k).i - .5*tb1.i; + SCALEC(tb3,taui) + ADDC(b0,CC(i,3,k),tb1) + CONJFLIPC(tb3) + PMC(b1,b2,tb2,tb3) + PMC(CH(i,k,0),d3,a0,b0) + PMC(d4,d1,a1,b1) + PMC(d2,d5,a2,b2) + MULPMSIGNC (CH(i,k,1),WA(0,i),d1) + MULPMSIGNC (CH(i,k,2),WA(1,i),d2) + MULPMSIGNC (CH(i,k,3),WA(2,i),d3) + MULPMSIGNC (CH(i,k,4),WA(3,i),d4) + MULPMSIGNC (CH(i,k,5),WA(4,i),d5) + } +} static void X(g)(size_t ido, size_t ip, size_t l1, const cmplx *cc, cmplx *ch, - const cmplx *wa) - { - const size_t cdim=ip; - cmplx *tarr=RALLOC(cmplx,2*ip); - cmplx *ccl=tarr, *wal=tarr+ip; - size_t i,j,k,l,jc,lc; - size_t ipph = (ip+1)/2; + const cmplx *wa) +{ + const size_t cdim=ip; + cmplx *tarr=RALLOC(cmplx,2*ip); + cmplx *ccl=tarr, *wal=tarr+ip; + size_t i,j,k,l,jc,lc; + size_t ipph = (ip+1)/2; - for (i=1; i<ip; ++i) - wal[i]=wa[ido*(i-1)]; - for (k=0; k<l1; ++k) - for (i=0; i<ido; ++i) - { - cmplx s=CC(i,0,k); - ccl[0] = CC(i,0,k); - for(j=1,jc=ip-1; j<ipph; ++j,--jc) - { - PMC (ccl[j],ccl[jc],CC(i,j,k),CC(i,jc,k)) - ADDC (s,s,ccl[j]) - } - CH(i,k,0) = s; - for (j=1, jc=ip-1; j<=ipph; ++j,--jc) + for (i=1; i<ip; ++i) + wal[i]=wa[ido*(i-1)]; + for (k=0; k<l1; ++k) + for (i=0; i<ido; ++i) { - cmplx abr=ccl[0], abi={0.,0.}; - size_t iang=0; - for (l=1,lc=ip-1; l<ipph; ++l,--lc) - { - iang+=j; - if (iang>ip) iang-=ip; - abr.r += ccl[l ].r*wal[iang].r; - abr.i += ccl[l ].i*wal[iang].r; - abi.r += ccl[lc].r*wal[iang].i; - abi.i += ccl[lc].i*wal[iang].i; - } + cmplx s=CC(i,0,k); + ccl[0] = CC(i,0,k); + for(j=1,jc=ip-1; j<ipph; ++j,--jc) + { + PMC (ccl[j],ccl[jc],CC(i,j,k),CC(i,jc,k)) + ADDC (s,s,ccl[j]) + } + CH(i,k,0) = s; + for (j=1, jc=ip-1; j<=ipph; ++j,--jc) + { + cmplx abr=ccl[0], abi={0.,0.}; + size_t iang=0; + for (l=1,lc=ip-1; l<ipph; ++l,--lc) + { + iang+=j; + if (iang>ip) iang-=ip; + abr.r += ccl[l ].r*wal[iang].r; + abr.i += ccl[l ].i*wal[iang].r; + abi.r += ccl[lc].r*wal[iang].i; + abi.i += ccl[lc].i*wal[iang].i; + } #ifndef BACKWARD - { abi.i=-abi.i; abi.r=-abi.r; } + { abi.i=-abi.i; abi.r=-abi.r; } #endif - CONJFLIPC(abi) - PMC(CH(i,k,j),CH(i,k,jc),abr,abi) + CONJFLIPC(abi) + PMC(CH(i,k,j),CH(i,k,jc),abr,abi) + } } - } - DEALLOC(tarr); + DEALLOC(tarr); - if (ido==1) return; + if (ido==1) return; - for (j=1; j<ip; ++j) - for (k=0; k<l1; ++k) - { - size_t idij=(j-1)*ido+1; - for(i=1; i<ido; ++i, ++idij) + for (j=1; j<ip; ++j) + for (k=0; k<l1; ++k) { - cmplx t=CH(i,k,j); - MULPMSIGNC (CH(i,k,j),wa[idij],t) + size_t idij=(j-1)*ido+1; + for(i=1; i<ido; ++i, ++idij) + { + cmplx t=CH(i,k,j); + MULPMSIGNC (CH(i,k,j),wa[idij],t) + } } - } - } +} #undef PSIGN #undef PMSIGNC #undef MULPMSIGNC + +// vi: set et ts=4 sw=4 sts=4: +// Local Variables: +// mode:c +// c-basic-offset: 4 +// indent-tabs-mode:nil +// End: diff --git a/ippl/src/Message/Message.h b/ippl/src/Message/Message.h index b8d81355ae1bd5fb80580725c278b584d5cfb28e..392540111fe8b07fde4c4554ae7bdcdcf543e41f 100644 --- a/ippl/src/Message/Message.h +++ b/ippl/src/Message/Message.h @@ -97,7 +97,6 @@ DEFINE_ALL_BUILTIN_TRAIT_CLASS(long long) DEFINE_ALL_BUILTIN_TRAIT_CLASS(float) DEFINE_ALL_BUILTIN_TRAIT_CLASS(double) DEFINE_ALL_BUILTIN_TRAIT_CLASS(dcomplex) -DEFINE_ALL_BUILTIN_TRAIT_CLASS(fComplex) ///////////////////////////////////////////////////////////////////// // a class to put single items into a Message, which can be specialized diff --git a/ippl/test/6dtrack/GTDistribution/makeranlib b/ippl/test/6dtrack/GTDistribution/makeranlib index 8b4db33534b7e513a9ad1109e17cc5352ab073c3..d8259e58e793c86e3e870dcb3ff673099a51e21f 100644 --- a/ippl/test/6dtrack/GTDistribution/makeranlib +++ b/ippl/test/6dtrack/GTDistribution/makeranlib @@ -1,2 +1,2 @@ -CC -fpermissive -Wno-deprecated -ftemplate-depth-80 -funroll-loops -fstrict-aliasing -g -I/users/adelmann/svnwork/ippl/src/expde -I/users/adelmann/svnwork/ippl/src -I/ufs/packages/hdf5/include -DTTProf -DOLDLAYOUT -DMAPS -DTTRACK -D__cplusplus -I. -I/users/adelmann/svnwork/classic/3.3/src -I/users/adelmann/svnwork/gsl/include -I/users/adelmann/svnwork/gte/GTConst -I/users/adelmann/svnwork/gte/GTUtilities -I./GTElements -I./GTDistribution -I./GTConfigure -I/users/adelmann/svnwork/gte/GTIntegrators -I/users/adelmann/svnwork/gte/GTUtilities -I./GTChargedParticles -I/users/adelmann/svnwork/gte/GTDataSink -I/users/adelmann/svnwork/gte/GTQRSolver -I/users/adelmann/svnwork/ippl/src/hdf5/H5ecloud -DIPPL_NO_STRINGSTREAM -DPETE_BITWISE_COPY -DIPPL_HAS_TEMPLATED_COMPLEX -DIPPL_USE_STANDARD_HEADERS -DIPPL_USE_PARTIAL_SPECIALIZATION -DIPPL_STDSTL -DIPPL_LONGLONG -DWITH_BRICK -DnoCOMP_GNUOLD -DIPPL_STRINGSTREAM -Drestrict=__restrict__ -DNOCTAssert -DIPPL_MPI -DMPICH_SKIP_MPICXX -DIPPL_DEBUG -DIPPL_GCC -DIPPL_DONT_POOL -DIPPL_USE_XDIV_RNG -DIPPL_LINUX -DGTHDF5 -DPARALLEL_IO -I. -c ranlib.cc +CC -fpermissive -Wno-deprecated -ftemplate-depth-80 -funroll-loops -fstrict-aliasing -g -I/users/adelmann/svnwork/ippl/src/expde -I/users/adelmann/svnwork/ippl/src -I/ufs/packages/hdf5/include -DTTProf -DOLDLAYOUT -DMAPS -DTTRACK -D__cplusplus -I. -I/users/adelmann/svnwork/classic/3.3/src -I/users/adelmann/svnwork/gsl/include -I/users/adelmann/svnwork/gte/GTConst -I/users/adelmann/svnwork/gte/GTUtilities -I./GTElements -I./GTDistribution -I./GTConfigure -I/users/adelmann/svnwork/gte/GTIntegrators -I/users/adelmann/svnwork/gte/GTUtilities -I./GTChargedParticles -I/users/adelmann/svnwork/gte/GTDataSink -I/users/adelmann/svnwork/gte/GTQRSolver -I/users/adelmann/svnwork/ippl/src/hdf5/H5ecloud -DIPPL_NO_STRINGSTREAM -DPETE_BITWISE_COPY -DIPPL_USE_STANDARD_HEADERS -DIPPL_USE_PARTIAL_SPECIALIZATION -DIPPL_STDSTL -DIPPL_LONGLONG -DWITH_BRICK -DnoCOMP_GNUOLD -DIPPL_STRINGSTREAM -Drestrict=__restrict__ -DNOCTAssert -DIPPL_MPI -DMPICH_SKIP_MPICXX -DIPPL_DEBUG -DIPPL_GCC -DIPPL_DONT_POOL -DIPPL_USE_XDIV_RNG -DIPPL_LINUX -DGTHDF5 -DPARALLEL_IO -I. -c ranlib.cc diff --git a/ippl/test/6dtrack/Makefile b/ippl/test/6dtrack/Makefile deleted file mode 100644 index 210d375c1ecc85163dd877a7febe4036b94a0cbe..0000000000000000000000000000000000000000 --- a/ippl/test/6dtrack/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/6dtrack/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/6dtrack/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/6dtrack/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/6dtrack/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/6dtrack/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/6dtrack/Makefile.def b/ippl/test/6dtrack/Makefile.def deleted file mode 100644 index 7c573aa385d96b2ca696263d0e45166ba57d365f..0000000000000000000000000000000000000000 --- a/ippl/test/6dtrack/Makefile.def +++ /dev/null @@ -1,77 +0,0 @@ -############################################################# -# Automatically generated Makefile.def -# It is generally not a good idea to modify this by hand. -############################################################# -# -# Defines that characterize the architecture. -# - -USER_INCLUDES = -I~roberto/iobuf -INCLUDES = $(USER_INCLUDES) -I$(IPPL_ROOT)/src/hdf5/H5ecloud -USER_DEFINES = -DGTHDF5 -DPARALLEL_IO -DEFINES = -DIPPL_MPI -DMPICH_SKIP_MPICXX -DIPPL_DEBUG -DIPPL_GCC -DIPPL_DONT_POOL -DIPPL_USE_XDIV_RNG -DIPPL_LINUX $(USER_DEFINES) -USER_CXXINCLUDES = -CXXINCLUDES = -I$(IPPL_ROOT)/src/expde -I$(IPPL_ROOT)/src -I$(H5HOME)/include $(USER_CXXINCLUDES) $(INCLUDES) -USER_CINCLUDES = -CINCLUDES = $(USER_CINCLUDES) $(INCLUDES) -USER_F77INCLUDES = -F77INCLUDES = $(USER_F77INCLUDES) $(INCLUDES) -USER_CXXDEFINES = -CXXDEFINES = -DIPPL_NO_STRINGSTREAM -DPETE_BITWISE_COPY -DIPPL_HAS_TEMPLATED_COMPLEX\ - -DIPPL_USE_STANDARD_HEADERS -DIPPL_USE_PARTIAL_SPECIALIZATION -DIPPL_STDSTL -DIPPL_LONGLONG\ - -DWITH_BRICK -DnoCOMP_GNUOLD -DIPPL_STRINGSTREAM\ - -Drestrict=__restrict__ -DNOCTAssert $(USER_CXXDEFINES) $(DEFINES) -USER_CDEFINES = -CDEFINES = $(USER_CDEFINES) $(DEFINES) -USER_F77DEFINES = -F77DEFINES = $(USER_F77DEFINES) $(DEFINES) -USER_CXXOPT = -CXXOPT = -g $(USER_CXXOPT) -USER_COPT = -COPT = -g $(USER_COPT) -USER_F77OPT = -F77OPT = $(USER_F77OPT) - -CXXFLAGS = -fpermissive -Wno-deprecated -ftemplate-depth-80 -funroll-loops -fstrict-aliasing $(CXXOPT) $(CXXINCLUDES) $(CXXDEFINES) - -USER_CXXFLAGSLIB = -USER_CXXFLAGSAPP = -USER_LDFLAGS = -CXXFLAGSLIB = $(CXXFLAGS) $(USER_CXXFLAGSLIB) -CXXFLAGSAPP = $(CXXFLAGS) $(USER_CXXFLAGSAPP) -CFLAGS = -Drestrict=__restrict__ $(COPT) $(CINCLUDES) $(CDEFINES) -F77FLAGS = -w $(F77OPT) $(F77INCLUDES) $(F77DEFINES) -F77FLAGSLIB = $(F77FLAGS) $(USER_F77FLAGSLIB) -F77FLAGSAPP = $(F77FLAGS) $(USER_F77FLAGSAPP) -AR = ar rc -CXX_APP_COMPILE_LINE = $(CXX) $(CXXFLAGSAPP) -c -CXX_LIB_COMPILE_LINE = $(CXX) $(CXXFLAGSLIB) -c -CC_LIB_COMPILE_LINE = $(CC) $(CXXFLAGSLIB) -c -CC_COMPILE_LINE = $(CC) $(CFLAGS) -c -F77_COMPILE_LINE = $(F77) $(F77FLAGS) -c -F77AR = ar rc -LDFLAGS = $(CXXFLAGSAPP) $(USER_LDFLAGS) - -############################################################ -# The part below is for linking -# to include the flags and dependencies for the library. -############################################################ - -LINKER = $(CXX) -v -USER_LFLAGS = -LFLAGS = -L$(IPPL_ROOT)/lib/$(IPPL_ARCH) $(USER_LFLAGS) -USER_LIBS = -lsz -lhwpc -lpapi ~roberto/iobuf/iobuf.o -LIBS = -L$(H5HOME)/lib -lhdf5 -lz -lippl -lm -lfft -lstdc++ $(USER_LIBS) - -.cpp.o: - $(CXX) $(CXXFLAGSAPP) -I. -c $< - -.F.o: - $(F77) $(F77FLAGSAPP) -I. -c $< - -.cpp: - $(CXX) $(CXXFLAGSAPP) -I. -c $< - $(LINKER) $(LDFLAGS) -o $@ $(<:.cpp=.o) $(LFLAGS) $(LIBS) - -.o: - $(LINKER) $(LDFLAGS) -o $@ $< $(LFLAGS) $(LIBS) diff --git a/ippl/test/Cartesian/Makefile b/ippl/test/Cartesian/Makefile deleted file mode 100644 index 702c43409ad50da89482ea72dce5b342e4482b12..0000000000000000000000000000000000000000 --- a/ippl/test/Cartesian/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/Cartesian/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/Cartesian/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/Cartesian/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/Cartesian/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/Cartesian/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/CavityTrack/Makefile b/ippl/test/CavityTrack/Makefile deleted file mode 100644 index 388d834aef222e6db9b2d5ea4578de8e05c0d5f9..0000000000000000000000000000000000000000 --- a/ippl/test/CavityTrack/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/CavityTrack/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/CavityTrack/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/CavityTrack/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/CavityTrack/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/CavityTrack/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/FFT/Makefile b/ippl/test/FFT/Makefile deleted file mode 100644 index ef2d55267805a185c533cf15796e541df99a15b3..0000000000000000000000000000000000000000 --- a/ippl/test/FFT/Makefile +++ /dev/null @@ -1,254 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/FFT/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/FFT/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/FFT/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/FFT/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/FFT/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Convenience name for target. -test/FFT/CMakeFiles/TestFFT.dir/rule: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/FFT/CMakeFiles/TestFFT.dir/rule -.PHONY : test/FFT/CMakeFiles/TestFFT.dir/rule - -# Convenience name for target. -TestFFT: test/FFT/CMakeFiles/TestFFT.dir/rule -.PHONY : TestFFT - -# fast build rule for target. -TestFFT/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/FFT/CMakeFiles/TestFFT.dir/build.make test/FFT/CMakeFiles/TestFFT.dir/build -.PHONY : TestFFT/fast - -# Convenience name for target. -test/FFT/CMakeFiles/TestRC.dir/rule: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/FFT/CMakeFiles/TestRC.dir/rule -.PHONY : test/FFT/CMakeFiles/TestRC.dir/rule - -# Convenience name for target. -TestRC: test/FFT/CMakeFiles/TestRC.dir/rule -.PHONY : TestRC - -# fast build rule for target. -TestRC/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/FFT/CMakeFiles/TestRC.dir/build.make test/FFT/CMakeFiles/TestRC.dir/build -.PHONY : TestRC/fast - -TestFFT.o: TestFFT.cpp.o -.PHONY : TestFFT.o - -# target to build an object file -TestFFT.cpp.o: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/FFT/CMakeFiles/TestFFT.dir/build.make test/FFT/CMakeFiles/TestFFT.dir/TestFFT.cpp.o -.PHONY : TestFFT.cpp.o - -TestFFT.i: TestFFT.cpp.i -.PHONY : TestFFT.i - -# target to preprocess a source file -TestFFT.cpp.i: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/FFT/CMakeFiles/TestFFT.dir/build.make test/FFT/CMakeFiles/TestFFT.dir/TestFFT.cpp.i -.PHONY : TestFFT.cpp.i - -TestFFT.s: TestFFT.cpp.s -.PHONY : TestFFT.s - -# target to generate assembly for a file -TestFFT.cpp.s: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/FFT/CMakeFiles/TestFFT.dir/build.make test/FFT/CMakeFiles/TestFFT.dir/TestFFT.cpp.s -.PHONY : TestFFT.cpp.s - -TestRC.o: TestRC.cpp.o -.PHONY : TestRC.o - -# target to build an object file -TestRC.cpp.o: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/FFT/CMakeFiles/TestRC.dir/build.make test/FFT/CMakeFiles/TestRC.dir/TestRC.cpp.o -.PHONY : TestRC.cpp.o - -TestRC.i: TestRC.cpp.i -.PHONY : TestRC.i - -# target to preprocess a source file -TestRC.cpp.i: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/FFT/CMakeFiles/TestRC.dir/build.make test/FFT/CMakeFiles/TestRC.dir/TestRC.cpp.i -.PHONY : TestRC.cpp.i - -TestRC.s: TestRC.cpp.s -.PHONY : TestRC.s - -# target to generate assembly for a file -TestRC.cpp.s: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/FFT/CMakeFiles/TestRC.dir/build.make test/FFT/CMakeFiles/TestRC.dir/TestRC.cpp.s -.PHONY : TestRC.cpp.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... TestFFT" - @echo "... TestRC" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" - @echo "... TestFFT.o" - @echo "... TestFFT.i" - @echo "... TestFFT.s" - @echo "... TestRC.o" - @echo "... TestRC.i" - @echo "... TestRC.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/FFT/SeaborgRes/TestRC.cpp b/ippl/test/FFT/SeaborgRes/TestRC.cpp index 08619d8f33cf2bdc377629ce86e103dfe3a0a213..4ce2342ebc86053f0f463b90b25bd0725300ad4b 100644 --- a/ippl/test/FFT/SeaborgRes/TestRC.cpp +++ b/ippl/test/FFT/SeaborgRes/TestRC.cpp @@ -137,7 +137,6 @@ int main(int argc, char *argv[]) // zeroth axis serial, zeroth axis half-size domain, permuted axis order FieldLayout<D> layoutSPPerm0h(ndiPermuted0h,serialParallel,vnodes); #endif -#ifndef IPPL_USE_SCSL_FFT // all parallel layout, first axis half-size domain, normal axis order FieldLayout<D> layoutPPStan1h(ndiStandard1h,allParallel,vnodes); #ifndef ONED @@ -145,7 +144,6 @@ int main(int argc, char *argv[]) FieldLayout<D> layoutSPStan1h(ndiStandard1h,serialParallel,vnodes); // zeroth axis serial, first axis half-size domain, permuted axis order FieldLayout<D> layoutSPPerm1h(ndiPermuted1h,serialParallel,vnodes); -#endif #endif // create test Fields for complex-to-complex FFT @@ -170,14 +168,12 @@ int main(int argc, char *argv[]) BareField<dcomplex,D> CFieldSPPerm0h(layoutSPPerm0h); #endif -#ifndef IPPL_USE_SCSL_FFT // create test Fields for sine transform and real-to-complex FFT BareField<dcomplex,D> CFieldPPStan1h(layoutPPStan1h); #ifndef ONED BareField<dcomplex,D> CFieldSPStan1h(layoutSPStan1h); BareField<dcomplex,D> CFieldSPPerm1h(layoutSPPerm1h); #endif -#endif // For calling FieldDebug functions from debugger, set up output format: diff --git a/ippl/test/FFT/TestFFT.cpp.org b/ippl/test/FFT/TestFFT.cpp.org index 024fe971b59f87d71792c3dca522362fa76d9543..15656bec173c58ce467c6a02615defcccf7231fb 100644 --- a/ippl/test/FFT/TestFFT.cpp.org +++ b/ippl/test/FFT/TestFFT.cpp.org @@ -162,7 +162,6 @@ int main(int argc, char *argv[]) for (d=1; d<D; d++) ndiPermuted0h[d] = ndiStandard0h[d-1]; #endif -#ifndef IPPL_USE_SCSL_FFT // create half-size domain for sine transform along zeroth axis // and RC transform along first axis NDIndex<D> ndiStandard1h = ndiStandard; @@ -172,7 +171,6 @@ int main(int argc, char *argv[]) NDIndex<D> ndiPermuted1h; ndiPermuted1h[0] = ndiStandard1h[D-1]; for (d=1; d<D; d++) ndiPermuted1h[d] = ndiStandard1h[d-1]; -#endif #endif // all parallel layout, standard domain, normal axis order @@ -191,7 +189,6 @@ int main(int argc, char *argv[]) // zeroth axis serial, zeroth axis half-size domain, permuted axis order FieldLayout<D> layoutSPPerm0h(ndiPermuted0h,serialParallel,vnodes); #endif -#ifndef IPPL_USE_SCSL_FFT // all parallel layout, first axis half-size domain, normal axis order FieldLayout<D> layoutPPStan1h(ndiStandard1h,allParallel,vnodes); #ifndef ONED @@ -199,7 +196,6 @@ int main(int argc, char *argv[]) FieldLayout<D> layoutSPStan1h(ndiStandard1h,serialParallel,vnodes); // zeroth axis serial, first axis half-size domain, permuted axis order FieldLayout<D> layoutSPPerm1h(ndiPermuted1h,serialParallel,vnodes); -#endif #endif // create test Fields for complex-to-complex FFT @@ -224,13 +220,11 @@ int main(int argc, char *argv[]) BareField<dcomplex,D> CFieldSPPerm0h(layoutSPPerm0h); #endif -#ifndef IPPL_USE_SCSL_FFT // create test Fields for sine transform and real-to-complex FFT BareField<dcomplex,D> CFieldPPStan1h(layoutPPStan1h); #ifndef ONED BareField<dcomplex,D> CFieldSPStan1h(layoutSPStan1h); BareField<dcomplex,D> CFieldSPPerm1h(layoutSPPerm1h); -#endif #endif // For calling FieldDebug functions from debugger, set up output format: @@ -581,8 +575,6 @@ int main(int argc, char *argv[]) //------------------------------------------------------------------------- #endif -#ifndef IPPL_USE_SCSL_FFT - // define zeroth axis to be sine transform bool sineTransformDims[D]; sineTransformDims[0] = true; @@ -874,8 +866,6 @@ int main(int argc, char *argv[]) //------------------------------------------------------------------------- #endif -#endif // IPPL_USE_SCSL_FFT - // Report if any errors have happened: testmsg << ( (correct) ? "PASSED" : "FAILED" ) << endl; diff --git a/ippl/test/Hal/Makefile b/ippl/test/Hal/Makefile deleted file mode 100644 index 935a3a3a7f9e78dcffbce639951ac5dde1d73c03..0000000000000000000000000000000000000000 --- a/ippl/test/Hal/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/Hal/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/Hal/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/Hal/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/Hal/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/Hal/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/Makefile.def b/ippl/test/Makefile.def index ce88af2f7b0a94d44f81564a4cb6ff8087a48af5..dbe4e8489c42b88c5bd0ee875226a4367b3d63fc 100644 --- a/ippl/test/Makefile.def +++ b/ippl/test/Makefile.def @@ -17,7 +17,7 @@ CINCLUDES = $(USER_CINCLUDES) $(INCLUDES) USER_F77INCLUDES = F77INCLUDES = $(USER_F77INCLUDES) $(INCLUDES) USER_CXXDEFINES = -CXXDEFINES = -DIPPL_NO_STRINGSTREAM -DPETE_BITWISE_COPY -DIPPL_HAS_TEMPLATED_COMPLEX\ +CXXDEFINES = -DIPPL_NO_STRINGSTREAM -DPETE_BITWISE_COPY \ -DIPPL_USE_STANDARD_HEADERS -DIPPL_USE_PARTIAL_SPECIALIZATION -DIPPL_STDSTL -DIPPL_LONGLONG\ -DWITH_BRICK -DnoCOMP_GNUOLD -DIPPL_STRINGSTREAM\ -Drestrict=__restrict__ -DNOCTAssert $(USER_CXXDEFINES) $(DEFINES) diff --git a/ippl/test/PwrSpec/Makefile b/ippl/test/PwrSpec/Makefile deleted file mode 100644 index f30e94c1a52a27700fbaf69f96424c39ac097df8..0000000000000000000000000000000000000000 --- a/ippl/test/PwrSpec/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/PwrSpec/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/PwrSpec/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/PwrSpec/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/PwrSpec/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/PwrSpec/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/adaTests/Makefile b/ippl/test/adaTests/Makefile deleted file mode 100644 index a9264a474de039314b314f2fbadd39ca31abb2e7..0000000000000000000000000000000000000000 --- a/ippl/test/adaTests/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/adaTests/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/adaTests/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/adaTests/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/adaTests/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/adaTests/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/hdf5/Makefile b/ippl/test/hdf5/Makefile deleted file mode 100644 index 10f1a9377d5721d3b88188d67562dc6f22c81693..0000000000000000000000000000000000000000 --- a/ippl/test/hdf5/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/hdf5/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/hdf5/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/hdf5/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/hdf5/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/hdf5/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/parallel/Makefile b/ippl/test/parallel/Makefile deleted file mode 100644 index 77e359d1aac0f6add10cf27e66c2ec39339c8acb..0000000000000000000000000000000000000000 --- a/ippl/test/parallel/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/parallel/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/parallel/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/parallel/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/parallel/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/parallel/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/particle/Makefile b/ippl/test/particle/Makefile deleted file mode 100644 index 1b4667942c7f6fd3ff6e124553ae74c3abf38d0f..0000000000000000000000000000000000000000 --- a/ippl/test/particle/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/particle/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/particle/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/particle/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/particle/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/particle/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/poissonsolvers/Makefile b/ippl/test/poissonsolvers/Makefile deleted file mode 100644 index 3855a0b007289c651f0d4889d7b2ac0c11271ce7..0000000000000000000000000000000000000000 --- a/ippl/test/poissonsolvers/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/poissonsolvers/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/poissonsolvers/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/poissonsolvers/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/poissonsolvers/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/poissonsolvers/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/simple-new/Makefile b/ippl/test/simple-new/Makefile deleted file mode 100644 index 6aa0793c2d0e56bc93b2a162b2db2cb61a81cc52..0000000000000000000000000000000000000000 --- a/ippl/test/simple-new/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/simple-new/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/simple-new/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/simple-new/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/simple-new/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/simple-new/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/simple/Makefile b/ippl/test/simple/Makefile deleted file mode 100644 index 1b096726064ba66b3aef643a2bf6e5d05a361dcc..0000000000000000000000000000000000000000 --- a/ippl/test/simple/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/simple/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/simple/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/simple/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/simple/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/simple/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/sindex/Makefile b/ippl/test/sindex/Makefile deleted file mode 100644 index 6e8f00c8e9662e2a7d0e751228be8c1807dc9334..0000000000000000000000000000000000000000 --- a/ippl/test/sindex/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/sindex/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/sindex/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/sindex/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/sindex/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/sindex/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/speed/Makefile b/ippl/test/speed/Makefile deleted file mode 100644 index 3add0de55b5c14a6c355570878d4f63074a804b4..0000000000000000000000000000000000000000 --- a/ippl/test/speed/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/speed/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/speed/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/speed/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/speed/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/speed/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/speed/make.out b/ippl/test/speed/make.out deleted file mode 100644 index bb13fa2d257b29c3d0e0c41ab00fbda0bda90b66..0000000000000000000000000000000000000000 --- a/ippl/test/speed/make.out +++ /dev/null @@ -1,3 +0,0 @@ -g++3.2 -ftemplate-depth-60 -g -I/home/adelmann/r1/src -I/usr/local/mpich/include -DPETE_BITWISE_COPY -DIPPL_HAS_TEMPLATED_COMPLEX -DIPPL_USE_MEMBER_TEMPLATES -DIPPL_USE_PARTIAL_SPECIALIZATION -DIPPL_USE_STANDARD_HEADERS -DIPPL_STDSTL -DIPPL_LONGLONG -Drestrict=__restrict__ -DNOCTAssert -DIPPL_DEBUG -DIPPL_MPI -DIPPL_GCC -DIPPL_DONT_POOL -DIPPL_USE_XDIV_RNG -DIPPL_LINUX -I. -c speed1.cpp -g++3.2 -ftemplate-depth-60 -g -I/home/adelmann/r1/src -I/usr/local/mpich/include -DPETE_BITWISE_COPY -DIPPL_HAS_TEMPLATED_COMPLEX -DIPPL_USE_MEMBER_TEMPLATES -DIPPL_USE_PARTIAL_SPECIALIZATION -DIPPL_USE_STANDARD_HEADERS -DIPPL_STDSTL -DIPPL_LONGLONG -Drestrict=__restrict__ -DNOCTAssert -DIPPL_DEBUG -DIPPL_MPI -DIPPL_GCC -DIPPL_DONT_POOL -DIPPL_USE_XDIV_RNG -DIPPL_LINUX -o speed1 speed1.o -L/usr/local/mpich/lib -L/home/adelmann/r1/lib/LINUX -static -lippl -lfft -lmpich -lm -g++3.2 -ftemplate-depth-60 -g -I/home/adelmann/r1/src -I/usr/local/mpich/include -DPETE_BITWISE_COPY -DIPPL_HAS_TEMPLATED_COMPLEX -DIPPL_USE_MEMBER_TEMPLATES -DIPPL_USE_PARTIAL_SPECIALIZATION -DIPPL_USE_STANDARD_HEADERS -DIPPL_STDSTL -DIPPL_LONGLONG -Drestrict=__restrict__ -DNOCTAssert -DIPPL_DEBUG -DIPPL_MPI -DIPPL_GCC -DIPPL_DONT_POOL -DIPPL_USE_XDIV_RNG -DIPPL_LINUX -I. -c stencil1.cpp diff --git a/ippl/test/toyfdtf/Makefile b/ippl/test/toyfdtf/Makefile deleted file mode 100644 index bdee6a85216e92facb77e2402100e7f0a27c9c69..0000000000000000000000000000000000000000 --- a/ippl/test/toyfdtf/Makefile +++ /dev/null @@ -1,239 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/toyfdtf/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/toyfdtf/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/toyfdtf/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/toyfdtf/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/toyfdtf/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Convenience name for target. -test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/rule: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/rule -.PHONY : test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/rule - -# Convenience name for target. -ipplToyFDTD: test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/rule -.PHONY : ipplToyFDTD - -# fast build rule for target. -ipplToyFDTD/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/build.make test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/build -.PHONY : ipplToyFDTD/fast - -ToyFDTD-DataSink/DataSink.o: ToyFDTD-DataSink/DataSink.cpp.o -.PHONY : ToyFDTD-DataSink/DataSink.o - -# target to build an object file -ToyFDTD-DataSink/DataSink.cpp.o: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/build.make test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/ToyFDTD-DataSink/DataSink.cpp.o -.PHONY : ToyFDTD-DataSink/DataSink.cpp.o - -ToyFDTD-DataSink/DataSink.i: ToyFDTD-DataSink/DataSink.cpp.i -.PHONY : ToyFDTD-DataSink/DataSink.i - -# target to preprocess a source file -ToyFDTD-DataSink/DataSink.cpp.i: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/build.make test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/ToyFDTD-DataSink/DataSink.cpp.i -.PHONY : ToyFDTD-DataSink/DataSink.cpp.i - -ToyFDTD-DataSink/DataSink.s: ToyFDTD-DataSink/DataSink.cpp.s -.PHONY : ToyFDTD-DataSink/DataSink.s - -# target to generate assembly for a file -ToyFDTD-DataSink/DataSink.cpp.s: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/build.make test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/ToyFDTD-DataSink/DataSink.cpp.s -.PHONY : ToyFDTD-DataSink/DataSink.cpp.s - -ToyFDTD-DataSink/ipplToyFDTD2.o: ToyFDTD-DataSink/ipplToyFDTD2.cpp.o -.PHONY : ToyFDTD-DataSink/ipplToyFDTD2.o - -# target to build an object file -ToyFDTD-DataSink/ipplToyFDTD2.cpp.o: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/build.make test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/ToyFDTD-DataSink/ipplToyFDTD2.cpp.o -.PHONY : ToyFDTD-DataSink/ipplToyFDTD2.cpp.o - -ToyFDTD-DataSink/ipplToyFDTD2.i: ToyFDTD-DataSink/ipplToyFDTD2.cpp.i -.PHONY : ToyFDTD-DataSink/ipplToyFDTD2.i - -# target to preprocess a source file -ToyFDTD-DataSink/ipplToyFDTD2.cpp.i: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/build.make test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/ToyFDTD-DataSink/ipplToyFDTD2.cpp.i -.PHONY : ToyFDTD-DataSink/ipplToyFDTD2.cpp.i - -ToyFDTD-DataSink/ipplToyFDTD2.s: ToyFDTD-DataSink/ipplToyFDTD2.cpp.s -.PHONY : ToyFDTD-DataSink/ipplToyFDTD2.s - -# target to generate assembly for a file -ToyFDTD-DataSink/ipplToyFDTD2.cpp.s: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/build.make test/toyfdtf/CMakeFiles/ipplToyFDTD.dir/ToyFDTD-DataSink/ipplToyFDTD2.cpp.s -.PHONY : ToyFDTD-DataSink/ipplToyFDTD2.cpp.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... ipplToyFDTD" - @echo "... list_install_components" - @echo "... rebuild_cache" - @echo "... ToyFDTD-DataSink/DataSink.o" - @echo "... ToyFDTD-DataSink/DataSink.i" - @echo "... ToyFDTD-DataSink/DataSink.s" - @echo "... ToyFDTD-DataSink/ipplToyFDTD2.o" - @echo "... ToyFDTD-DataSink/ipplToyFDTD2.i" - @echo "... ToyFDTD-DataSink/ipplToyFDTD2.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/ttrack/Makefile b/ippl/test/ttrack/Makefile deleted file mode 100644 index f71a2c7e2b65a0c0da3f46c2f20b14b01dfc5a4c..0000000000000000000000000000000000000000 --- a/ippl/test/ttrack/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/ttrack/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/ttrack/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/ttrack/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/ttrack/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/ttrack/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/ippl/test/ttrack/Makefile.def b/ippl/test/ttrack/Makefile.def deleted file mode 100644 index 7c573aa385d96b2ca696263d0e45166ba57d365f..0000000000000000000000000000000000000000 --- a/ippl/test/ttrack/Makefile.def +++ /dev/null @@ -1,77 +0,0 @@ -############################################################# -# Automatically generated Makefile.def -# It is generally not a good idea to modify this by hand. -############################################################# -# -# Defines that characterize the architecture. -# - -USER_INCLUDES = -I~roberto/iobuf -INCLUDES = $(USER_INCLUDES) -I$(IPPL_ROOT)/src/hdf5/H5ecloud -USER_DEFINES = -DGTHDF5 -DPARALLEL_IO -DEFINES = -DIPPL_MPI -DMPICH_SKIP_MPICXX -DIPPL_DEBUG -DIPPL_GCC -DIPPL_DONT_POOL -DIPPL_USE_XDIV_RNG -DIPPL_LINUX $(USER_DEFINES) -USER_CXXINCLUDES = -CXXINCLUDES = -I$(IPPL_ROOT)/src/expde -I$(IPPL_ROOT)/src -I$(H5HOME)/include $(USER_CXXINCLUDES) $(INCLUDES) -USER_CINCLUDES = -CINCLUDES = $(USER_CINCLUDES) $(INCLUDES) -USER_F77INCLUDES = -F77INCLUDES = $(USER_F77INCLUDES) $(INCLUDES) -USER_CXXDEFINES = -CXXDEFINES = -DIPPL_NO_STRINGSTREAM -DPETE_BITWISE_COPY -DIPPL_HAS_TEMPLATED_COMPLEX\ - -DIPPL_USE_STANDARD_HEADERS -DIPPL_USE_PARTIAL_SPECIALIZATION -DIPPL_STDSTL -DIPPL_LONGLONG\ - -DWITH_BRICK -DnoCOMP_GNUOLD -DIPPL_STRINGSTREAM\ - -Drestrict=__restrict__ -DNOCTAssert $(USER_CXXDEFINES) $(DEFINES) -USER_CDEFINES = -CDEFINES = $(USER_CDEFINES) $(DEFINES) -USER_F77DEFINES = -F77DEFINES = $(USER_F77DEFINES) $(DEFINES) -USER_CXXOPT = -CXXOPT = -g $(USER_CXXOPT) -USER_COPT = -COPT = -g $(USER_COPT) -USER_F77OPT = -F77OPT = $(USER_F77OPT) - -CXXFLAGS = -fpermissive -Wno-deprecated -ftemplate-depth-80 -funroll-loops -fstrict-aliasing $(CXXOPT) $(CXXINCLUDES) $(CXXDEFINES) - -USER_CXXFLAGSLIB = -USER_CXXFLAGSAPP = -USER_LDFLAGS = -CXXFLAGSLIB = $(CXXFLAGS) $(USER_CXXFLAGSLIB) -CXXFLAGSAPP = $(CXXFLAGS) $(USER_CXXFLAGSAPP) -CFLAGS = -Drestrict=__restrict__ $(COPT) $(CINCLUDES) $(CDEFINES) -F77FLAGS = -w $(F77OPT) $(F77INCLUDES) $(F77DEFINES) -F77FLAGSLIB = $(F77FLAGS) $(USER_F77FLAGSLIB) -F77FLAGSAPP = $(F77FLAGS) $(USER_F77FLAGSAPP) -AR = ar rc -CXX_APP_COMPILE_LINE = $(CXX) $(CXXFLAGSAPP) -c -CXX_LIB_COMPILE_LINE = $(CXX) $(CXXFLAGSLIB) -c -CC_LIB_COMPILE_LINE = $(CC) $(CXXFLAGSLIB) -c -CC_COMPILE_LINE = $(CC) $(CFLAGS) -c -F77_COMPILE_LINE = $(F77) $(F77FLAGS) -c -F77AR = ar rc -LDFLAGS = $(CXXFLAGSAPP) $(USER_LDFLAGS) - -############################################################ -# The part below is for linking -# to include the flags and dependencies for the library. -############################################################ - -LINKER = $(CXX) -v -USER_LFLAGS = -LFLAGS = -L$(IPPL_ROOT)/lib/$(IPPL_ARCH) $(USER_LFLAGS) -USER_LIBS = -lsz -lhwpc -lpapi ~roberto/iobuf/iobuf.o -LIBS = -L$(H5HOME)/lib -lhdf5 -lz -lippl -lm -lfft -lstdc++ $(USER_LIBS) - -.cpp.o: - $(CXX) $(CXXFLAGSAPP) -I. -c $< - -.F.o: - $(F77) $(F77FLAGSAPP) -I. -c $< - -.cpp: - $(CXX) $(CXXFLAGSAPP) -I. -c $< - $(LINKER) $(LDFLAGS) -o $@ $(<:.cpp=.o) $(LFLAGS) $(LIBS) - -.o: - $(LINKER) $(LDFLAGS) -o $@ $< $(LFLAGS) $(LIBS) diff --git a/ippl/test/twostream-1/Makefile b/ippl/test/twostream-1/Makefile deleted file mode 100644 index 7d6df1b138335dd0fed26ee19c0528ed1de09d50..0000000000000000000000000000000000000000 --- a/ippl/test/twostream-1/Makefile +++ /dev/null @@ -1,170 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake - -# The command to remove a file. -RM = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/l_locans/programs/IPPL/trunk - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/l_locans/programs/IPPL/trunk - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local -.PHONY : install/local/fast - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip -.PHONY : install/strip/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components -.PHONY : list_install_components/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /afs/psi.ch/sys/psi.x86_64_slp6/Programming/cmake/2.8.12.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles /home/l_locans/programs/IPPL/trunk/test/twostream-1/CMakeFiles/progress.marks - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/twostream-1/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/l_locans/programs/IPPL/trunk/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/twostream-1/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/twostream-1/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/l_locans/programs/IPPL/trunk && $(MAKE) -f CMakeFiles/Makefile2 test/twostream-1/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... install" - @echo "... install/local" - @echo "... install/strip" - @echo "... list_install_components" - @echo "... rebuild_cache" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/l_locans/programs/IPPL/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/src/Classic/autogen-gele.sh b/src/Classic/autogen-gele.sh deleted file mode 100644 index 9465bc6cf2f6dbc4cb004ab6eb4b1f788b91547d..0000000000000000000000000000000000000000 --- a/src/Classic/autogen-gele.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -mkdir -p config -aclocal -autoconf -automake -a -c -make clean -CXX=CC ./configure --host=x86_64-unknown-linux-gnu \ - --with-fftw3-includedir=/apps/fftw/fftw-3.1.2_gnu3.3_PE1.4.48/include \ - --with-fftw3-libdir=/apps/fftw/fftw-3.1.2_gnu3.3_PE1.4.48/lib \ - --with-ippl-includedir=$IPPL_ROOT/src -make -j 10 - diff --git a/src/Classic/autogen-palu.sh b/src/Classic/autogen-palu.sh deleted file mode 100644 index 7525e4c6424dae9a9eda4bbd7a910df45154f190..0000000000000000000000000000000000000000 --- a/src/Classic/autogen-palu.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -mkdir -p config -aclocal -autoheader -autoconf -automake -a -c -autoreconf -make clean -CXX=CC ./configure --host=x86_64-unknown-linux-gnu CPP="CC" \ - --with-fftw3-includedir=/apps/fftw/fftw-3.1.2_gnu3.3_PE1.5.47/include \ - --with-fftw3-libdir=/apps/fftw/fftw-3.1.2_gnu3.3_PE1.5.47/lib \ - --with-ippl-includedir=$IPPL_ROOT/src \ - --with-hdf5-includedir=$H5HOME/include --with-hdf5-libdir=$H5HOME/lib \ - --with-h5part-includedir=$H5PartHOME/src --with-h5part-libdir=$H5PartHOME/src -make -j 10 diff --git a/src/Classic/autogen-regression.sh b/src/Classic/autogen-regression.sh deleted file mode 100644 index 6750c230b8efa11c3af269e3858bcc61619712c7..0000000000000000000000000000000000000000 --- a/src/Classic/autogen-regression.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -mkdir -p config -aclocal --force -libtoolize --force --copy -automake --force --add-missing --copy -autoheader --force -autoconf --force -autoreconf - -./configure --with-ippl-includedir=/home2/ineichen/svnwork/ippl//src --with-h5part-includedir=/home2/ineichen/felsim/H5Part/src --with-h5part-libdir=/home2/ineichen/felsim/H5Part/src --with-hdf5-includedir=/opt/hdf5/hdf5-1.6.10-openmpi-1.2.6-intel-11.1/include --with-hdf5-libdir=/opt/hdf5/hdf5-1.6.10-openmpi-1.2.6-intel-11.1/lib --with-gsl-includedir=/opt/gsl/gsl-1.12/include --with-gsl-libdir=/opt/gsl/gsl-1.12/lib CC=mpicc CXX=mpicxx F77=mpif77 diff --git a/src/Classic/autogen.sh b/src/Classic/autogen.sh deleted file mode 100644 index 1459f58104f63e855294f9e645d3e0a47d694e21..0000000000000000000000000000000000000000 --- a/src/Classic/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -mkdir -p config -aclocal --force -libtoolize --force --copy -automake --force --add-missing --copy -autoheader --force -autoconf --force -autoreconf -CXX=mpicxx ./configure \ - --with-ippl-includedir=$IPPL_ROOT/src \ - --with-h5part-includedir=$H5Part/src --with-h5part-libdir=$H5Part/src \ - --with-gsl-includedir=$GSL_PREFIX/include --with-gsl-libdir=$GSL_PREFIX/lib \ - --with-hdf5-includedir=$HDF5_INCLUDE_PATH --with-hdf5-libdir=$HDF5_LIBRARY_PATH -make -j 10 diff --git a/src/Classic/configure.ac b/src/Classic/configure.ac deleted file mode 100644 index 5457de7a4e75f86ff11f4de3de451b769f84346f..0000000000000000000000000000000000000000 --- a/src/Classic/configure.ac +++ /dev/null @@ -1,129 +0,0 @@ -AC_INIT([classic],[5.1.2],[opal@lists.psi.ch]) - -AC_PROG_CC([mpicc]) -AC_PROG_CXX([mpicxx]) - -AC_CONFIG_AUX_DIR(config) -#disable f77 tests -m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) -AM_INIT_AUTOMAKE -AC_LIBTOOL_DLOPEN -AC_PROG_LIBTOOL - -AC_CONFIG_HEADER([./config.h:./config.in]) -AC_CONFIG_FILES([Makefile]) - -AC_LANG(C++) - -IPPLDEFS="-DIPPL_MPI\ - -DMPICH_SKIP_MPICXX\ - -DIPPL_DEBUG\ - -DIPPL_DONT_POOL\ - -DIPPL_USE_XDIV_RNG\ - -DIPPL_LINUX\ - -DIPPL_NO_STRINGSTREAM\ - -DPETE_BITWISE_COPY\ - -DIPPL_HAS_TEMPLATED_COMPLEX\ - -DIPPL_USE_STANDARD_HEADERS\ - -DIPPL_USE_PARTIAL_SPECIALIZATION\ - -DIPPL_STDSTL\ - -DIPPL_LONGLONG\ - -Drestrict=__restrict__ -DNOCTAssert -DPARALLEL_IO -w" - -OPALSTUFF="$OPAL_ROOT/src" - -AC_ARG_WITH(ippl-includedir, - AC_HELP_STRING( - [--with-ippl-includedir=dir], - [ippl include files in dir] - ), - [ - test X$withvalue != Xno && CPPFLAGS="$CPPFLAGS -I$withval ${IPPLDEFS} -I$OPALSTUFF" - ] -) -AC_ARG_WITH(gsl, - AC_HELP_STRING( - [--with-gsl=dir], - [gsl prefix] - ), - [ - test X$withvalue != Xno && CPPFLAGS="$CPPFLAGS -I$withval/include" - test X$withvalue != Xno && LDFLAGS="$LDFLAGS -L$withval/lib" - ] -) -AC_ARG_WITH(gsl-includedir, - AC_HELP_STRING( - [--with-gsl-includedir=dir], - [gsl include files in dir] - ), - [ - test X$withvalue != Xno && CPPFLAGS="$CPPFLAGS -I$withval" - ] -) -AC_ARG_WITH(gsl-libdir, - AC_HELP_STRING( - [--with-gsl-libdir=dir], - [gsl library libgsl.a in dir] - ), - [ - test X$withvalue != Xno && LDFLAGS="$LDFLAGS -L$withval" - HAVE_GSL_=true - ] -) -AC_ARG_WITH(h5hut, - AC_HELP_STRING( - [--with-h5hut=dir], - [H5hut prefix] - ), - [ - test X$withvalue != Xno && CPPFLAGS="$CPPFLAGS -I$withval/include" - test X$withvalue != Xno && LDFLAGS="$LDFLAGS -L$withval/lib" - ] -) -AC_ARG_WITH(h5hut-includedir, - AC_HELP_STRING( - [--with-h5hut-includedir=dir], - [H5hut include files in dir] - ), - [ - test X$withvalue != Xno && CPPFLAGS="$CPPFLAGS -I$withval" - ] -) -AC_ARG_WITH(h5hut-libdir, - AC_HELP_STRING( - [--with-h5hut-libdir=dir], - [h5hut libraries in dir] - ), - [ - test X$withvalue != Xno && LDFLAGS="$LDFLAGS -L$withval" - ] -) -AC_ARG_WITH(hdf5, - AC_HELP_STRING( - [--with-hdf5-includedir=dir], - [hdf5 prefix] - ), - [ - test X$withvalue != Xno && CPPFLAGS="$CPPFLAGS -I$withval/include" - test X$withvalue != Xno && CPPFLAGS="$CPPFLAGS -I$withval/lib" - ] -) -AC_ARG_WITH(hdf5-includedir, - AC_HELP_STRING( - [--with-hdf5-includedir=dir], - [hdf5 include files in dir] - ), - [ - test X$withvalue != Xno && CPPFLAGS="$CPPFLAGS -I$withval" - ] -) -AC_ARG_WITH(hdf5-libdir, - AC_HELP_STRING( - [--with-hdf5-libdir=dir], - [hdf5 library in dir] - ), - [ - test X$withvalue != Xno && LDFLAGS="$LDFLAGS -L$withval" - ] -) -AC_OUTPUT diff --git a/src/Copyright.readme b/src/Copyright.readme index 4261a0e74144c8150fe01a18408866e63b7ded13..99cce54171958bd744f5450d03945abe54151094 100644 --- a/src/Copyright.readme +++ b/src/Copyright.readme @@ -1,38 +1,29 @@ -// ------------------------------------------------------------------------- -// -// PSI Paul Scherrer Institut -// -// Program name: OPAL (Object Oriented Parallel Accelerator Library) -// -// Version: 1.0 -// -// Date: xx.2.2008 -// -// Authors and contact: Andreas Adelmann -// andreas.adelmann@psi.ch -// -// Address: AMAS (Accelerator Modelling and Advanced Simulations) -// PSI -// CH-5232 Villigen PSI -// SWITZERLAND -// -// Copyright PSI, Villigen 2007 - Copyright and any other appropriate legal -// protection of this computer program and associated documentation reserved -// in all countries of the world. -// -// Organizations collaborating with PSI may receive this program and -// documentation freely and without charge. -// -// PSI undertakes no obligation for the maintenance of this program, nor -// responsibility for its correctness, and accepts no liability whatsoever -// resulting from its use. -// -// Program and documentation are provided solely for the use of the -// organisation to which they are distributed. -// -// This program may not be copied or otherwise distributed without permission. -// This message must be retained on this and any other authorized copies. -// -// The material cannot be sold. PSI should be given credit in all references. -// -// ------------------------------------------------------------------------- +Copyright (c) 2008-2018 +Paul Scherrer Institut, Villigen PSI, Switzerland +All rights reserved. + +OPAL is licensed under the terms of the GNU General Public License +version 3. + +(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) Neither the name of Paul Scherrer Institut 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/tools/BandRF/Makefile.def b/tools/BandRF/Makefile.def index 978cb798d0f8ce4d845adbde1efcf42971a39f77..3193ef2c5afeead06c2f7dd11ca617c4caddb0e6 100644 --- a/tools/BandRF/Makefile.def +++ b/tools/BandRF/Makefile.def @@ -17,7 +17,7 @@ CINCLUDES = $(USER_CINCLUDES) $(INCLUDES) USER_F77INCLUDES = F77INCLUDES = $(USER_F77INCLUDES) $(INCLUDES) USER_CXXDEFINES = -CXXDEFINES = -DIPPL_NO_STRINGSTREAM -DPETE_BITWISE_COPY -DIPPL_HAS_TEMPLATED_COMPLEX\ +CXXDEFINES = -DIPPL_NO_STRINGSTREAM -DPETE_BITWISE_COPY \ -DIPPL_USE_STANDARD_HEADERS -DIPPL_USE_PARTIAL_SPECIALIZATION -DIPPL_STDSTL -DIPPL_LONGLONG\ -DWITH_BRICK -DnoCOMP_GNUOLD -DIPPL_STRINGSTREAM\ -Drestrict=__restrict__ -DNOCTAssert $(USER_CXXDEFINES) $(DEFINES) diff --git a/tools/mslang/CMakeLists.txt b/tools/mslang/CMakeLists.txt index c0dfd7a4c37d3bb05b467d6c3db01f635f1f1a5d..1f0078167c592a3ca35f7a7252b2f4c66ad15b15 100644 --- a/tools/mslang/CMakeLists.txt +++ b/tools/mslang/CMakeLists.txt @@ -6,7 +6,7 @@ PROJECT (MSLANG VERSION 0.1) #SET (MSLANG_VERSION_MINOR 1) SET (IPPL_CXX_FLAGS - "-DIPPL_LINUX -DIPPL_STRINGSTREAM -DIPPL_MPI -DMPICH_SKIP_MPICXX -DIPPL_DONT_POOL -DIPPL_USE_XDIV_RNG -DPETE_BITWISE_COPY -DIPPL_HAS_TEMPLATED_COMPLEX -DIPPL_USE_PARTIAL_SPECIALIZATION -Drestrict=__restrict__ -DNOCTAssert ${IPPL_CXX_FLAGS}" + "-DIPPL_LINUX -DIPPL_STRINGSTREAM -DIPPL_MPI -DMPICH_SKIP_MPICXX -DIPPL_DONT_POOL -DIPPL_USE_XDIV_RNG -DPETE_BITWISE_COPY -DIPPL_USE_PARTIAL_SPECIALIZATION -Drestrict=__restrict__ -DNOCTAssert ${IPPL_CXX_FLAGS}" ) SET (CMAKE_CXX_FLAGS @@ -43,4 +43,4 @@ MESSAGE( STATUS "Compiling MSLang") ADD_EXECUTABLE( mslang mslang.cpp ) TARGET_LINK_LIBRARIES( mslang ${MSLANG_LIBS} ) -INSTALL(TARGETS mslang RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") \ No newline at end of file +INSTALL(TARGETS mslang RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")