85 int stmm(
double **V,
int n,
int m,
double *T,
int lambda, Flag flag_stgy) {
88 fftw_complex *V_fft, *T_fft;
90 fftw_plan plan_f, plan_b;
99 tpltz_init(n, lambda, &nfft, &blocksize, &T_fft, T, &V_fft, &V_rfft,
100 &plan_f, &plan_b, flag_stgy);
104 fprintf(file,
"Before stmm_main call : nfft = %d, blocksize = %d\n",
106 stmm_main(V, n, m, 0, n * m, T, T_fft, lambda, V_fft, V_rfft, plan_f,
107 plan_b, blocksize, nfft, flag_stgy);
136 int stbmm(
double **V,
int nrow,
int m_cw,
int m_rw, Block *tpltzblocks,
137 int nb_blocks, int64_t idp,
int local_V_size, Flag flag_stgy) {
140 int nb_blocks_local = nb_blocks;
141 int nb_blocks_all = nb_blocks;
144 MPI_Comm comm = MPI_COMM_NULL;
146 mpi_stbmm(V, nrow, m_cw, m_rw, tpltzblocks, nb_blocks, nb_blocks, idp,
147 local_V_size, flag_stgy, comm);
189 int gstbmm(
double **V,
int nrow,
int m_cw,
int m_rw, Block *tpltzblocks,
190 int nb_blocks, int64_t idp,
int local_V_size, int64_t *id0gap,
191 int *lgap,
int ngap, Flag flag_stgy) {
192 int nb_blocks_local = nb_blocks;
193 int nb_blocks_all = nb_blocks;
196 MPI_Comm comm = MPI_COMM_NULL;
198 mpi_gstbmm(V, nrow, m_cw, m_rw, tpltzblocks, nb_blocks, nb_blocks, idp,
199 local_V_size, id0gap, lgap, ngap, flag_stgy, comm);
206 int gstbmm0(
double **V,
int nrow,
int m,
int m_rowwise, Block *tpltzblocks,
207 int nb_blocks_local,
int nb_blocks_all,
int id0p,
int local_V_size,
208 int64_t *id0gap,
int *lgap,
int ngap, Flag flag_stgy) {
213 int flag_skip_build_gappy_blocks = flag_stgy.flag_skip_build_gappy_blocks;
220 reset_gaps(V, id0p, local_V_size, m, nrow, m_rowwise, id0gap, lgap, ngap);
225 int nb_blockgappy_max;
228 Block *tpltzblocks_gappy;
236 fprintf(file,
"[%d] flag_skip_build_gappy_blocks=%d\n", rank,
237 flag_skip_build_gappy_blocks);
239 if (flag_skip_build_gappy_blocks == 1) {
249 for (Tsize = i = 0; i < nb_blocks_local; i++)
250 Tsize += tpltzblocks[i].lambda;
252 for (i = 0; i < nb_blocks_local; i++) {
253 if (tpltzblocks[i].lambda > lambdamax)
254 lambdamax = tpltzblocks[i].lambda;
258 nb_blockgappy_max = nb_blocks_local + ngap;
259 Tgappysize_max = Tsize + lambdamax * ngap;
262 tpltzblocks_gappy = (Block *) calloc(nb_blockgappy_max,
sizeof(Block));
272 int flag_param_distmin_fixed = flag_stgy.flag_param_distmin_fixed;
274 id0gap, lgap, ngap, tpltzblocks_gappy,
275 &nb_blocks_gappy, flag_param_distmin_fixed);
279 fprintf(file,
"[%d] nb_blocks_gappy=%d\n", rank, nb_blocks_gappy);
280 for (i = 0; i < nb_blocks_gappy; i++)
281 fprintf(file,
"[%d] idvgappy[%d]=%ld ; ngappy[%d]=%d\n", rank,
282 i, tpltzblocks_gappy[i].idv, i, tpltzblocks_gappy[i].n);
297 reset_gaps(V, id0p, local_V_size, m, nrow, m_rowwise, id0gap, lgap, ngap);
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)
int tpltz_cleanup(fftw_complex **T_fft, fftw_complex **V_fft, double **V_rfft, fftw_plan *plan_f, fftw_plan *plan_b)
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)
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)
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)
int reset_gaps(double **V, int id0, int local_V_size, int m, int nrow, int m_rowwise, const int64_t *id0gap, const int *lgap, int ngap)
Set the data to zeros at the gaps location.
int build_gappy_blocks(int nrow, int m, Block *tpltzblocks, int nb_blocks_local, int nb_blocks_all, const int64_t *id0gap, const int *lgap, int ngap, Block *tpltzblocks_gappy, int *nb_blocks_gappy_final, int flag_param_distmin_fixed)
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)
int gstbmm0(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)
int stmm(double **V, int n, int m, double *T, int lambda, Flag flag_stgy)
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)