MIDAPACK - MIcrowave Data Analysis PACKage  1.1b
Parallel software tools for high performance CMB DA analysis
 All Data Structures Files Functions Variables Typedefs Groups Pages
toeplitz.h File Reference

Header file with main definitions and declarations for the Toeplitz algebra module. More...

Go to the source code of this file.

Data Structures

struct  Block
struct  Flag
struct  Gap
struct  Tpltz

Typedefs

typedef struct Block Block
typedef struct Flag Flag
typedef struct Gap Gap
typedef struct Tpltz Tpltz

Functions

int stbmmProd (Tpltz Nm1, double *V)
 Performs the product of a Toeplitz matrix by a general matrix either sequentially or using MPI. The complexity is hidden in the input structure, which needs to be defined by a user.
int tpltz_init (int n, int lambda, int *nfft, int *blocksize, fftw_complex **T_fft, double *T, fftw_complex **V_fft, double **V_rfft, fftw_plan *plan_f, fftw_plan *plan_b, Flag flag_stgy)
 Sets a block size and initializes all fftw arrays and plans needed for the computation.
int tpltz_cleanup (fftw_complex **T_fft, fftw_complex **V_fft, double **V_rfft, fftw_plan *plan_f, fftw_plan *plan_b)
 Cleans fftw workspace used in the Toeplitz matrix matrix product's computation.
int stmm_core (double **V, int n, int m, double *T, fftw_complex *T_fft, int blocksize, int lambda, fftw_complex *V_fft, double *V_rfft, int nfft, fftw_plan plan_f, fftw_plan plan_b, int flag_offset, int flag_nofft)
 Performs the stand alone product of a Toeplitz matrix by a matrix using the sliding window algorithm. (an INTERNAL routine)
int stmm_main (double **V, int n, int m, int id0, int l, double *T, fftw_complex *T_fft, int lambda, fftw_complex *V_fft, double *V_rfft, fftw_plan plan_f, fftw_plan plan_b, int blocksize, int nfft, Flag flag_stgy)
 Performs the product of a Toeplitz matrix by a general matrix using the sliding window algorithm with optimize reshaping. (an INTERNAL routine)
int stmm (double **V, int n, int m, double *T, int lambda, Flag flag_stgy)
 Perform the product of a Toeplitz matrix by a general matrix using the sliding window algorithm.
int stbmm (double **V, int nrow, int m_cw, int m_rw, Block *tpltzblocks, int nb_blocks, int64_t idp, int local_V_size, Flag flag_stgy)
 Performs the multiplication of a symmetric, Toeplitz block-diagonal matrix, T, by an arbitrary matrix, V, distributed over processes in the generalized column-wise way.
int gstbmm (double **V, int nrow, int m_cw, int m_rw, Block *tpltzblocks, int nb_blocks, int64_t idp, int local_V_size, int64_t *id0gap, int *lgap, int ngap, Flag flag_stgy)
 Performs the multiplication of a symmetric, Toeplitz block-diagonal matrix with gaps, T, by an arbitrary matrix, V, distributed over processes.
int reset_gaps (double **V, int id0, int local_V_size, int m, int nrow, int m_rowwise, int64_t *id0gap, int *lgap, int ngap)
 Set the data to zeros at the gaps location.
int mpi_stmm (double **V, int n, int m, int id0, int l, double *T, int lambda, Flag flag_stgy, MPI_Comm comm)
 Performs the product of a Toeplitz matrix by a general matrix using MPI. We assume that the matrix has already been scattered. (a USER routine)
int mpi_stbmm (double **V, int64_t nrow, int m, int m_rowwise, Block *tpltzblocks, int nb_blocks_local, int nb_blocks_all, int64_t idp, int local_V_size, Flag flag_stgy, MPI_Comm comm)
 Performs the multiplication of a symmetric, Toeplitz block-diagonal matrix, T, by an arbitrary matrix, V, distributed over processes in the generalized column-wise way.
int mpi_gstbmm (double **V, int nrow, int m, int m_rowwise, Block *tpltzblocks, int nb_blocks_local, int nb_blocks_all, int id0p, int local_V_size, int64_t *id0gap, int *lgap, int ngap, Flag flag_stgy, MPI_Comm comm)
 Performs the multiplication of a symmetric, Toeplitz block-diagonal matrix, T, by an arbitrary matrix, V, distributed over processes in the generalized column-wise way. This matrix V contains defined gaps which represents the useless data for the comutation. The gaps indexes are defined in the global time space as the generized toeplitz matrix, meaning the row dimension. Each of his diagonal blocks is a symmetric, band-diagonal Toeplitz matrix, which can be different for each block.
int flag_stgy_init_auto (Flag *flag_stgy)
 Set the flag to automatic paramaters.
int flag_stgy_init_zeros (Flag *flag_stgy)
 Set the flag parameters to zeros. This is almost the same as automatic.
int flag_stgy_init_defined (Flag *flag_stgy)
 Set the parameters flag to the defined ones.
int print_flag_stgy_init (Flag flag_stgy)
 Print the flag parameters values.
int define_blocksize (int n, int lambda, int bs_flag, int fixed_bs)
 Defines an optimal size of the block used in the sliding windows algorithm.
int define_nfft (int n_thread, int flag_nfft, int fixed_nfft)
 Defines the number of simultaneous ffts for the Toeplitz matrix product computation.
int fftw_init_omp_threads ()
int rhs_init_fftw (int *nfft, int fft_size, fftw_complex **V_fft, double **V_rfft, fftw_plan *plan_f, fftw_plan *plan_b, int fftw_flag)
 Initializes fftw array and plan for the right hand side, general matrix V.
int circ_init_fftw (double *T, int fft_size, int lambda, fftw_complex **T_fft)
 Initializes fftw array and plan for the circulant matrix T_circ obtained from T.
int scmm_direct (int fft_size, int nfft, fftw_complex *C_fft, int ncol, double *V_rfft, double **CV, fftw_complex *V_fft, fftw_plan plan_f_V, fftw_plan plan_b_CV)
 Performs the product of a circulant matrix C_fft by a matrix V_rfft using fftw plans.
int scmm_basic (double **V, int blocksize, int m, fftw_complex *C_fft, double **CV, fftw_complex *V_fft, double *V_rfft, int nfft, fftw_plan plan_f_V, fftw_plan plan_b_CV)
 Performs the product of a circulant matrix by a matrix using FFT's (an INTERNAL routine)
int stmm_simple_basic (double **V, int n, int m, double *T, int lambda, double **TV)
 Perform the product of a Toeplitz matrix by a matrix without using FFT's.
int build_gappy_blocks (int nrow, int m, Block *tpltzblocks, int nb_blocks_local, int nb_blocks_all, int64_t *id0gap, int *lgap, int ngap, Block *tpltzblocks_gappy, int *nb_blocks_gappy_final, int flag_param_distmin_fixed)
 Build the gappy Toeplitz block structure to optimise the product computation at gaps location.
int print_error_message (int error_number, char const *file, int line)
 Prints error message corresponding to an error number.
int copy_block (int ninrow, int nincol, double *Vin, int noutrow, int noutcol, double *Vout, int inrow, int incol, int nblockrow, int nblockcol, int outrow, int outcol, double norm, int set_zero_flag)
 Copies (and potentially reshapes) a selected block of the input matrix to a specified position of the output matrix.
int vect2nfftblock (double *V1, int v1_size, double *V2, int fft_size, int nfft, int lambda)
int nfftblock2vect (double *V2, int fft_size, int nfft, int lambda, double *V1, int v1_size)
int get_overlapping_blocks_params (int nbloc, Block *tpltzblocks, int local_V_size, int64_t nrow, int64_t idp, int64_t *idpnew, int *local_V_size_new, int *nnew, int *ifirstBlock, int *ilastBlock)

Variables

int VERBOSE
 Verbose mode.
int PRINT_RANK

Detailed Description

Header file with main definitions and declarations for the Toeplitz algebra module.

version 1.2b, November 2012

Author:
Frederic Dauvergne

Project: Midapack library, ANR MIDAS'09 - Toeplitz Algebra module Purpose: Provide Toeplitz algebra tools suitable for Cosmic Microwave Background (CMB) data analysis.

Note:
Copyright (c) 2010-2012 APC CNRS Université Paris Diderot
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software Foundation;
either version 3 of the License, or (at your option) any later version. This program is
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this
program; if not, see http://www.gnu.org/licenses/lgpl.html
For more information about ANR MIDAS'09 project see :
http://www.apc.univ-paris7.fr/APC_CS/Recherche/Adamis/MIDAS09/index.html
ACKNOWLEDGMENT: This work has been supported in part by the French National Research
Agency (ANR) through COSINUS program (project MIDAS no. ANR-09-COSI-009).

Log: toeplitz*.c

Revision 1.0b 2012/05/07 Frederic Dauvergne (APC) Official release 1.0beta. The first installement of the library is the Toeplitz algebra module.

Revision 1.1b 2012/07/- Frederic Dauvergne (APC)

  • mpi_stbmm allows now rowi-wise order per process datas and no-blocking communications.
  • OMP improvment for optimal cpu time.
  • bug fixed for OMP in the stmm_basic routine.
  • distcorrmin is used to communicate only lambda-1 datas when it is needed.
  • new reshaping routines using transformation functions in stmm. Thus, only one copy at most is needed.
  • tpltz_init improvement using define_nfft and define_blocksize routines.
  • add Block struture to define each Toeplitz block.
  • add Flag structure and preprocessing parameters to define the computational strategy. All the flag parameters are then available directly from the API.

Revision 1.2b 2012/11/30 Frederic Dauvergne (APC)

  • extend the mpi product routine to rowwise order data distribution. This is now allowing tree kinds of distribution.
  • add int64 for some variables to extend the global volume of data you can use.
  • Openmp improvments.
  • Add toeplitz_wizard.c, which contains a set of easy to use routines with defined structures.

Definition in file toeplitz.h.


Typedef Documentation

typedef struct Block Block
typedef struct Flag Flag
typedef struct Gap Gap
typedef struct Tpltz Tpltz

Function Documentation

int fftw_init_omp_threads ( )
int vect2nfftblock ( double *  V1,
int  v1_size,
double *  V2,
int  fft_size,
int  nfft,
int  lambda 
)
int nfftblock2vect ( double *  V2,
int  fft_size,
int  nfft,
int  lambda,
double *  V1,
int  v1_size 
)
int get_overlapping_blocks_params ( int  nbloc,
Block tpltzblocks,
int  local_V_size,
int64_t  nrow,
int64_t  idp,
int64_t *  idpnew,
int *  local_V_size_new,
int *  nnew,
int *  ifirstBlock,
int *  ilastBlock 
)

Variable Documentation

int VERBOSE

Verbose mode.

Prints some informative messages during the computation.

Definition at line 78 of file toeplitz.c.

int PRINT_RANK

Definition at line 82 of file toeplitz.c.