Skip to content

Commit

Permalink
Fixing C sine_many
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrypek committed Mar 2, 2018
1 parent b97d763 commit 2c37376
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
32 changes: 16 additions & 16 deletions include/p3dfft.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ extern void FORT_MOD_NAME(set_timers)();

#ifndef SINGLE_PREC
extern void FORT_MOD_NAME(p3dfft_ftran_r2c)(double *A,double *B, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_ftran_r2c_many)(double *A, int dim_in, double *B, int dim_out, int nv, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_ftran_r2c_many)(double *A, int *dim_in, double *B, int *dim_out, int *nv, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_btran_c2r)(double *A,double *B, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_btran_c2r_many)(double *A, int dim_in, double *B, int dim_out, int nv, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_cheby)(double *A,double *B, double Lz);
extern void FORT_MOD_NAME(p3dfft_cheby_many)(double *A, int dim_in, double *B, int dim_out, int nv, double Lz);
extern void FORT_MOD_NAME(p3dfft_btran_c2r_many)(double *A, int *dim_in, double *B, int *dim_out, int *nv, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_cheby)(double *A,double *B, double *Lz);
extern void FORT_MOD_NAME(p3dfft_cheby_many)(double *A, int *dim_in, double *B, int *dim_out, int *nv, double *Lz);
#else
extern void FORT_MOD_NAME(p3dfft_ftran_r2c)(float *A,float *B, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_ftran_r2c_many)(float *A, int dim_in, float *B, int dim_out, int nv, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_ftran_r2c_many)(float *A, int *dim_in, float *B, int *dim_out, int *nv, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_btran_c2r)(float *A,float *B, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_btran_c2r_many)(float *A, int dim_in, float *B, int dim_out, int nv, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_cheby)(float *A,float *B, float Lz);
extern void FORT_MOD_NAME(p3dfft_cheby_many)(float *A, int dim_in, float *B, int dim_out, int nv, float Lz);
extern void FORT_MOD_NAME(p3dfft_btran_c2r_many)(float *A, int *dim_in, float *B, int *dim_out, int *nv, unsigned char *op);
extern void FORT_MOD_NAME(p3dfft_cheby)(float *A,float *B, float *Lz);
extern void FORT_MOD_NAME(p3dfft_cheby_many)(float *A, int *dim_in, float *B, int *dim_out, int *nv, float *Lz);
#endif

extern void FORT_MOD_NAME(p3dfft_clean)();
Expand Down Expand Up @@ -157,48 +157,48 @@ inline void Cp3dfft_btran_c2r(float *A,float *B, unsigned char *op)
#ifndef SINGLE_PREC
inline void Cp3dfft_cheby(double *A,double *B, double Lz)
{
FORT_MOD_NAME(p3dfft_cheby)(A,B,Lz);
FORT_MOD_NAME(p3dfft_cheby)(A,B,&Lz);
}
#else
inline void Cp3dfft_cheby(float *A,float *B, float Lz)
{
FORT_MOD_NAME(p3dfft_cheby)(A,B,Lz);
FORT_MOD_NAME(p3dfft_cheby)(A,B,&Lz);
}
#endif

#ifndef SINGLE_PREC
inline void Cp3dfft_cheby_many(double *A,int dim_in,double *B, int dim_out, int nv, double Lz)
{
FORT_MOD_NAME(p3dfft_cheby_many)(A,dim_in,B,dim_out,nv,Lz);
FORT_MOD_NAME(p3dfft_cheby_many)(A,&dim_in,B,&dim_out,&nv,&Lz);
}
#else
inline void Cp3dfft_cheby_many(float *A, int dim_in, float *B, int dim_out, int nv, float Lz)
{
FORT_MOD_NAME(p3dfft_cheby_many)(A,dim_in,B,dim_out,nv,Lz);
FORT_MOD_NAME(p3dfft_cheby_many)(A,&dim_in,B,&dim_out,&nv,&Lz);
}
#endif

#ifndef SINGLE_PREC
inline void Cp3dfft_ftran_r2c_many(double *A, int dim_in, double *B, int dim_out, int nv, unsigned char *op)
{
FORT_MOD_NAME(p3dfft_ftran_r2c_many)(A,dim_in,B,dim_out,nv,op);
FORT_MOD_NAME(p3dfft_ftran_r2c_many)(A,&dim_in,B,&dim_out,&nv,op);
}
#else
inline void Cp3dfft_ftran_r2c_many(float *A, int dim_in, float *B, int dim_out, int nv, unsigned char *op)
{
FORT_MOD_NAME(p3dfft_ftran_r2c_many)(A,dim_in,B,dim_out,nv,op);
FORT_MOD_NAME(p3dfft_ftran_r2c_many)(A,&dim_in,B,&dim_out,&nv,op);
}
#endif

#ifndef SINGLE_PREC
inline void Cp3dfft_btran_c2r_many(double *A, int dim_in, double *B, int dim_out, int nv, unsigned char *op)
{
FORT_MOD_NAME(p3dfft_btran_c2r_many)(A,dim_in,B,dim_out,nv,op);
FORT_MOD_NAME(p3dfft_btran_c2r_many)(A,&dim_in,B,&dim_out,&nv,op);
}
#else
inline void Cp3dfft_btran_c2r_many(float *A, int dim_in, float *B, int dim_out, int nv, unsigned char *op)
{
FORT_MOD_NAME(p3dfft_btran_c2r_many)(A,dim_in,B,dim_out,nv,op);
FORT_MOD_NAME(p3dfft_btran_c2r_many)(A,&dim_in,B,&dim_out,&nv,op);
}
#endif

Expand Down
10 changes: 5 additions & 5 deletions sample/C/driver_sine_inplace_many.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ int main(int argc,char **argv)
p = A;
for(j=0; j < nv; j++) {
for(z=0;z < isize[2];z++)
sinz[nz*j + z] = sin(j*(z+istart[2]-1)*twopi/nz);
sinz[nz*j + z] = sin((j+1)*(z+istart[2]-1)*twopi/nz);
for(y=0;y < isize[1];y++)
siny[ny*j + y] = sin(j*(y+istart[1]-1)*twopi/ny);
siny[ny*j + y] = sin((j+1)*(y+istart[1]-1)*twopi/ny);
for(x=0;x < isize[0];x++)
sinx[nx*j + x] = sin(j*(x+istart[0]-1)*twopi/nx);
sinx[nx*j + x] = sin((j+1)*(x+istart[0]-1)*twopi/nx);

for(z=0;z < isize[2];z++)
for(y=0;y < isize[1];y++) {
Expand All @@ -218,7 +218,7 @@ int main(int argc,char **argv)
MPI_Barrier(MPI_COMM_WORLD);
rtime1 = rtime1 - MPI_Wtime();
/* Forward transform in-place */
Cp3dfft_ftran_r2c_many(A,nm,A,nm/2,nv,op_f);
Cp3dfft_ftran_r2c_many(A,isize[0]*isize[1]*isize[2],A,fsize[0]*fsize[1]*fsize[2],nv,op_f);
rtime1 = rtime1 + MPI_Wtime();

for (j=0; j < nv; j++) {
Expand All @@ -233,7 +233,7 @@ int main(int argc,char **argv)
MPI_Barrier(MPI_COMM_WORLD);
rtime1 = rtime1 - MPI_Wtime();
/* Backward transform in-place */
Cp3dfft_btran_c2r_many(A,nm/2,A,nm,nv,op_b);
Cp3dfft_btran_c2r_many(A,fsize[0]*fsize[1]*fsize[2],A,isize[0]*isize[1]*isize[2],nv,op_b);
rtime1 = rtime1 + MPI_Wtime();

}
Expand Down
10 changes: 5 additions & 5 deletions sample/C/driver_sine_many.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ int main(int argc,char **argv)
p = A;
for(j=0; j < nv; j++) {
for(z=0;z < isize[2];z++)
sinz[nz*j + z] = sin(j*(z+istart[2]-1)*twopi/nz);
sinz[nz*j + z] = sin((j+1)*(z+istart[2]-1)*twopi/nz);
for(y=0;y < isize[1];y++)
siny[ny*j + y] = sin(j*(y+istart[1]-1)*twopi/ny);
siny[ny*j + y] = sin((j+1)*(y+istart[1]-1)*twopi/ny);
for(x=0;x < isize[0];x++)
sinx[nx*j + x] = sin(j*(x+istart[0]-1)*twopi/nx);
sinx[nx*j + x] = sin((j+1)*(x+istart[0]-1)*twopi/nx);

for(z=0;z < isize[2];z++)
for(y=0;y < isize[1];y++) {
Expand All @@ -201,7 +201,7 @@ int main(int argc,char **argv)
MPI_Barrier(MPI_COMM_WORLD);
rtime1 = rtime1 - MPI_Wtime();
/* compute forward Fourier transform on A, store results in B */
Cp3dfft_ftran_r2c_many(A,isize[0]*isize[1]*isize[2],B,fsize[0]*fsize[1]*fsize[2]*2,nv,op_f);
Cp3dfft_ftran_r2c_many(A,isize[0]*isize[1]*isize[2],B,fsize[0]*fsize[1]*fsize[2],nv,op_f);
rtime1 = rtime1 + MPI_Wtime();

for(j=0; j < nv; j++) {
Expand All @@ -216,7 +216,7 @@ int main(int argc,char **argv)
/* Compute backward transform on B, store results in C */
MPI_Barrier(MPI_COMM_WORLD);
rtime1 = rtime1 - MPI_Wtime();
Cp3dfft_btran_c2r_many(B,fsize[0]*fsize[1]*fsize[2]*2,C,isize[0]*isize[1]*isize[2],nv,op_b);
Cp3dfft_btran_c2r_many(B,fsize[0]*fsize[1]*fsize[2],C,isize[0]*isize[1]*isize[2],nv,op_b);
rtime1 = rtime1 + MPI_Wtime();

}
Expand Down

0 comments on commit 2c37376

Please sign in to comment.