PNX(plan) PNX(init_3d_f03)(const INT * N, INT local_M, MPI_Fint f_comm_cart) { MPI_Comm comm_cart; comm_cart = MPI_Comm_f2c(f_comm_cart); PNX(plan) ret = PNX(init_3d)(N, local_M, comm_cart); return ret; }
PNX(plan) PNX(init_adv_f03)(int d, const INT * N, INT local_M, unsigned pnfft_flags, unsigned fftw_flags, MPI_Fint f_comm_cart) { MPI_Comm comm_cart; comm_cart = MPI_Comm_f2c(f_comm_cart); PNX(plan) ret = PNX(init_adv)(d, N, local_M, pnfft_flags, fftw_flags, comm_cart); return ret; }
PNX(plan) PNX(init_guru_f03)(int d, const INT * N, const INT * Nos, const R * x_max, INT local_M, int m, unsigned pnfft_flags, unsigned fftw_flags, MPI_Fint f_comm_cart) { MPI_Comm comm_cart; comm_cart = MPI_Comm_f2c(f_comm_cart); PNX(plan) ret = PNX(init_guru)(d, N, Nos, x_max, local_M, m, pnfft_flags, fftw_flags, comm_cart); return ret; }
static PNX(plan) PNX(init_guru_internal)( int d, const INT *N, const INT *n, const R *x_max, INT local_M, int m, unsigned trafo_flag, unsigned pnfft_flags, unsigned pfft_flags, MPI_Comm comm_cart ) { INT no[3]; PNX(plan) ths; unsigned pfft_opt_flags = extract_pfft_opt_flags(pfft_flags); if(d != 3){ PX(fprintf)(comm_cart, stderr, "!!! Error in PNFFT: d != 3 not yet implemented !!!\n"); return NULL; } fft_output_size(n, x_max, m, no); #if PNFFT_DEBUG_USE_KAISER_BESSEL | PNFFT_DEBUG_USE_GAUSSIAN | PNFFT_DEBUG_USE_BSPLINE | PNFFT_DEBUG_USE_SINC_POWER int rank=0; MPI_Comm_rank(comm_cart, &rank); #endif #if PNFFT_DEBUG_USE_KAISER_BESSEL if(!rank) fprintf(stderr, "!!! Debugging: Force PNFFT_WINDOW_KAISER_BESSEL !!!\n"); pnfft_flags &= ~(PNFFT_WINDOW_GAUSSIAN | PNFFT_WINDOW_BSPLINE | PNFFT_WINDOW_SINC_POWER); #elif PNFFT_DEBUG_USE_GAUSSIAN if(!rank) fprintf(stderr, "!!! Debugging: Force PNFFT_WINDOW_GAUSSIAN !!!\n"); pnfft_flags &= ~(PNFFT_WINDOW_GAUSSIAN | PNFFT_WINDOW_BSPLINE | PNFFT_WINDOW_SINC_POWER); pnfft_flags |= PNFFT_WINDOW_GAUSSIAN; #elif PNFFT_DEBUG_USE_BSPLINE if(!rank) fprintf(stderr, "!!! Debugging: Force PNFFT_WINDOW_BSPLINE !!!\n"); pnfft_flags &= ~(PNFFT_WINDOW_GAUSSIAN | PNFFT_WINDOW_BSPLINE | PNFFT_WINDOW_SINC_POWER); pnfft_flags |= PNFFT_WINDOW_BSPLINE; #elif PNFFT_DEBUG_USE_SINC_POWER if(!rank) fprintf(stderr, "!!! Debugging: Force PNFFT_WINDOW_SINC_POWER !!!\n"); pnfft_flags &= ~(PNFFT_WINDOW_GAUSSIAN | PNFFT_WINDOW_BSPLINE | PNFFT_WINDOW_SINC_POWER); pnfft_flags |= PNFFT_WINDOW_SINC_POWER; #endif ths = PNX(init_internal)(d, N, n, no, local_M, m, trafo_flag, pnfft_flags, pfft_opt_flags, comm_cart); /* Quick fix to save x_max in PNFFT plan */ for(int t=0; t<d; t++) ths->x_max[t] = x_max[t]; return ths; }
void PNX(vpr_complex_f03)(C * data, INT N, const char * name, MPI_Fint f_comm) { MPI_Comm comm; comm = MPI_Comm_f2c(f_comm); PNX(vpr_complex)(data, N, name, comm); }
void PNX(vpr_real_f03)(R * data, INT N, const char * name, MPI_Fint f_comm) { MPI_Comm comm; comm = MPI_Comm_f2c(f_comm); PNX(vpr_real)(data, N, name, comm); }
void PNX(local_size_guru_f03)(int d, const INT * N, const INT * Nos, const R * x_max, int m, MPI_Fint f_comm_cart, unsigned pnfft_flags, INT * local_N, INT * local_N_start, R * lower_border, R * upper_border) { MPI_Comm comm_cart; comm_cart = MPI_Comm_f2c(f_comm_cart); PNX(local_size_guru)(d, N, Nos, x_max, m, comm_cart, pnfft_flags, local_N, local_N_start, lower_border, upper_border); }
void PNX(local_size_adv_f03)(int d, const INT * N, MPI_Fint f_comm_cart, unsigned pnfft_flags, INT * local_N, INT * local_N_start, R * lower_border, R * upper_border) { MPI_Comm comm_cart; comm_cart = MPI_Comm_f2c(f_comm_cart); PNX(local_size_adv)(d, N, comm_cart, pnfft_flags, local_N, local_N_start, lower_border, upper_border); }
void PNX(apr_complex_3d_f03)(C * data, INT * local_N, INT * local_N_start, unsigned pnfft_flags, const char * name, MPI_Fint f_comm) { MPI_Comm comm; comm = MPI_Comm_f2c(f_comm); PNX(apr_complex_3d)(data, local_N, local_N_start, pnfft_flags, name, comm); }
double * PNX(timer_reduce_max_f03)(MPI_Fint f_comm, double * timer) { MPI_Comm comm; comm = MPI_Comm_f2c(f_comm); double * ret = PNX(timer_reduce_max)(comm, timer); return ret; }
PNX(plan) PNX(init_guru_c2r)( int d, const INT *N, const INT *n, const R *x_max, INT local_M, int m, unsigned pnfft_flags, unsigned pfft_flags, MPI_Comm comm_cart ) { return PNX(init_guru_internal)(d, N, n, x_max, local_M, m, PNFFTI_TRAFO_C2R, pnfft_flags, pfft_flags, comm_cart); }
int PNX(create_procmesh_f03)(int rnk, MPI_Fint f_comm, const int * np, MPI_Fint * f_comm_cart) { MPI_Comm comm, comm_cart; comm = MPI_Comm_f2c(f_comm); int ret = PNX(create_procmesh)(rnk, comm, np, &comm_cart); *f_comm_cart = MPI_Comm_c2f(comm_cart); return ret; }
int PNX(create_procmesh_2d_f03)(MPI_Fint f_comm, int np0, int np1, MPI_Fint * f_comm_cart_2d) { MPI_Comm comm, comm_cart_2d; comm = MPI_Comm_f2c(f_comm); int ret = PNX(create_procmesh_2d)(comm, np0, np1, &comm_cart_2d); *f_comm_cart_2d = MPI_Comm_c2f(comm_cart_2d); return ret; }
void PNX(local_size_3d)( const INT *N, MPI_Comm comm_cart, unsigned pnfft_flags, INT *local_N, INT *local_N_start, R *lower_border, R *upper_border ) { const int d=3; PNX(local_size_adv)( d, N, comm_cart, pnfft_flags, local_N, local_N_start, lower_border, upper_border); }
static void local_size_guru_internal( int d, const INT *N, const INT *n, const R *x_max, int m, MPI_Comm comm_cart, unsigned trafo_flag, unsigned pnfft_flags, INT *local_N, INT *local_N_start, R *lower_border, R *upper_border ) { INT no[3], local_no[3], local_no_start[3]; if(d != 3){ PX(fprintf)(comm_cart, stderr, "!!! Error in PNFFT: d != 3 not yet implemented !!!\n"); return; } fft_output_size(n, x_max, m, no); PNX(local_size_internal)(N, n, no, comm_cart, trafo_flag, pnfft_flags, local_N, local_N_start, local_no, local_no_start); PNX(node_borders)(n, local_no, local_no_start, x_max, lower_border, upper_border); }
PNX(plan) PNX(init_3d)( const INT *N, INT local_M, MPI_Comm comm_cart ) { const int d=3; unsigned pnfft_flags, pfft_flags; pnfft_flags = PNFFT_MALLOC_X | PNFFT_MALLOC_F_HAT | PNFFT_MALLOC_F; pfft_flags = PFFT_MEASURE| PFFT_DESTROY_INPUT; return PNX(init_adv)( d, N, local_M, pnfft_flags, pfft_flags, comm_cart); }
) { const int d=3; unsigned pnfft_flags, pfft_flags; pnfft_flags = PNFFT_MALLOC_X | PNFFT_MALLOC_F_HAT | PNFFT_MALLOC_F; pfft_flags = PFFT_MEASURE| PFFT_DESTROY_INPUT; return PNX(init_adv)( d, N, local_M, pnfft_flags, pfft_flags, comm_cart); } void PNX(init_nodes)( PNX(plan) ths, INT local_M, unsigned pnfft_flags, unsigned pnfft_finalize_flags ) { /* free mem and adjust pnfft_flags, compute_flags */ PNX(free_x)(ths, pnfft_finalize_flags); PNX(free_f)(ths, pnfft_finalize_flags); PNX(free_grad_f)(ths, pnfft_finalize_flags); /* allocate mem and adjust pnfft_flags, compute_flags */ ths->local_M = local_M; PNX(malloc_x)(ths, pnfft_flags); PNX(malloc_f)(ths, pnfft_flags); PNX(malloc_grad_f)(ths, pnfft_flags); }
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PNFFT. If not, see <http://www.gnu.org/licenses/>. * */ #include <complex.h> #include "pnfft.h" #include "ipnfft.h" void PNX(spread_f_c2c)( PNX(plan) ths, INT ind, C f, R *pre_psi, INT m0, INT *grid_size, int cutoff, int interlaced, C *grid ) { R* plan_pre_psi = (interlaced) ? ths->pre_psi_il : ths->pre_psi; if(ths->pnfft_flags & PNFFT_PRE_FULL_PSI) PNX(spread_f_c2c_pre_full_psi)( f, plan_pre_psi + ind*PNFFT_POW3(cutoff), m0, grid_size, cutoff, grid); else if(ths->pnfft_flags & PNFFT_PRE_PSI) PNX(spread_f_c2c_pre_psi)( f, plan_pre_psi + ind*3*cutoff, m0, grid_size, cutoff, grid); else
void PNX(debug_sum_print)( R *data, INT max, int is_complex, const char *msg ) { PNX(debug_sum_print_strides)(data, max, 1, is_complex, msg); }