Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No warnings now #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ $(CPU_OBJECTS): src/%.o: src/%.c
$(GPU_OBJECTS): src/%.o: src/%.cu
$(NVCC) -c $(INCLUDES) $(SIZE) $< -o $@

tools: biggerbox.o
tools: biggerbox.o filterbox.o
$(CC) $(PATHS) $(LIBS) tools/biggerbox.o -o biggerbox.bin
$(CC) $(PATHS) $(LIBS) tools/filterbox.o -o filterbox.bin

biggerbox.o:
$(CC) $(INCLUDES) $(SIZE) -c tools/biggerbox.c -o tools/biggerbox.o

filterbox.o:
$(CC) $(INCLUDES) $(SIZE) -c tools/filterbox.c -o tools/filterbox.o

clean:
rm src/*.o hitMPI
6 changes: 3 additions & 3 deletions src/F.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ float Fdt( vectorField u, vectorField r,float* Delta,float Cf)
float dtf=0.0f;
float dtv=0.0f;

float N3= (float) N*(float)N*(float)N;
float N3= float(NX)*float(NY)*float(NZ);

START_RANGE("calc_u_w",1)
calc_U_W(u,r);
Expand Down Expand Up @@ -108,8 +108,8 @@ START_RANGE("REDUCE",4)
END_RANGE
float c=(fabs(umax[0]/N3)+fabs(umax[1]/N3)+fabs(umax[2]/N3));

dtc=cfl/((N/3.0f)*c);
dtv=cfl*REYNOLDS/((N/3.0f)*(N/3.0f));
dtc=cfl/((NX/3.0f)*c);
dtv=cfl*REYNOLDS/((NX/3.0f)*(NX/3.0f));
dtf=cfl/Cf;

if(RANK == 0 /*&& counter%10==0*/){
Expand Down
2 changes: 1 addition & 1 deletion src/RK3.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static float calcDt(vectorField uw,float Cf){
float dtf=0.0f;
float dtv=0.0f;

float N3= (float) N*N*N;
float N3= float(NX)*float(NY)*float(NZ);
#if 0
float* uwx = (float*)malloc(2*NXSIZE*NY*NZ*sizeof(float));
float* uwy = (float*)malloc(2*NXSIZE*NY*NZ*sizeof(float));
Expand Down
4 changes: 2 additions & 2 deletions src/calcT.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ float calc_T(vectorField u,vectorField A,vectorField B,float2* aux,float alpha)

float udTau=udTau_1+udTau_2+udTau_3;

float T=(udTau-uuS)/((float)N*N*N);
float T=(udTau-uuS)/(float(NX)*float(NY)*float(NZ));

if(RANK==0){
printf("\nudTau=(%e,%e,%e)",udTau_1,udTau_2,udTau_3);
Expand All @@ -252,7 +252,7 @@ float calc_tauS(vectorField u,vectorField A,vectorField B,float2* aux,float alph

tauS_2=sumElements(aux);

float tauS=(tauS_1+2.0f*tauS_2)/((float)N*N*N);
float tauS=(tauS_1+2.0f*tauS_2)/(float(NX)*float(NY)*float(NZ));

return tauS;

Expand Down
52 changes: 6 additions & 46 deletions src/calcT_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static __global__ void normalize_kernel(float2* ux,float2* uy,float2* uz,int IGL

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;
float N3= float(NX)*float(NY)*float(NZ);

// Read {u1,u2,u3}

Expand Down Expand Up @@ -62,7 +62,7 @@ static __global__ void calcUU_kernel(float2* uxx,float2* uyy,float2* uzz,int IGL

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;
float N3=float(NX)*float(NY)*float(NZ);

// Read {u1,u2,u3}

Expand Down Expand Up @@ -111,7 +111,7 @@ static __global__ void calcUV_kernel(float2* uxx,float2* uyy,float2* uzz,int IGL

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;
float N3=float(NX)*float(NY)*float(NZ);

// Read {u1,u2,u3}

Expand Down Expand Up @@ -159,7 +159,7 @@ static __global__ void calcSii_kernel(float2* ux,float2* uy,float2* uz,int IGLOB

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;
float N3=float(NX)*float(NY)*float(NZ);


// Read {u1,u2,u3}
Expand Down Expand Up @@ -223,7 +223,7 @@ static __global__ void calcSij_kernel(float2* ux,float2* uy,float2* uz,int IGLOB

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;
float N3=float(NX)*float(NY)*float(NZ);


// Read {u1,u2,u3}
Expand Down Expand Up @@ -285,7 +285,7 @@ static __global__ void calc_dTau_kernel(float2* ux,float2* uy,float2* uz,int mod

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;
float N3=float(NX)*float(NY)*float(NZ);


// Read {u1,u2,u3}
Expand Down Expand Up @@ -373,8 +373,6 @@ static __global__ void gaussFilter_kernel(float2* uxx,float2* uyy,float2* uzz,fl

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;


// Read {u1,u2,u3}
float k1;
Expand Down Expand Up @@ -435,9 +433,6 @@ static __global__ void gaussFilter_High_kernel(float2* uxx,float2* uyy,float2* u

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;


// Read {u1,u2,u3}
float k1;
float k2;
Expand Down Expand Up @@ -497,24 +492,6 @@ static __global__ void calcL_kernel(float2* A1,float2* A2,float2* A3,float2* B1,
{

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;


// Read {u1,u2,u3}
float k1;
float k2;
float k3;

// X indices
k1=(i+IGLOBAL)<NX/2 ? (float)(i+IGLOBAL) : (float)(i+IGLOBAL)-(float)NX ;

// Y indice
k2=j<NY/2 ? (float)j : (float)j-(float)NY ;

// Z indices
k3=(float)k;


float2 L11=B1[h];
float2 L12=B2[h];
Expand Down Expand Up @@ -562,23 +539,6 @@ static __global__ void calc_tauS_kernel(float2* OUT,float2* Ax,float2* Ay,float2

int h=i*NY*NZ+j*NZ+k;

float N3=(float)N*N*N;


// Read {u1,u2,u3}
float k1;
float k2;
float k3;

// X indices
k1=(i+IGLOBAL)<NX/2 ? (float)(i+IGLOBAL) : (float)(i+IGLOBAL)-(float)NX ;

// Y indice
k2=j<NY/2 ? (float)j : (float)j-(float)NY ;

// Z indices
k3=(float)k;

float2 L1=Ax[h];
float2 L2=Ay[h];
float2 L3=Az[h];
Expand Down
2 changes: 1 addition & 1 deletion src/calc_conv_rotor.cu
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static __global__ void convolution_rotor(float2* wx,float2* wy,float2* wz,float2
int k=j%NZ;
j=(j-k)/NZ;

float N3=(float) N*N*N;
float N3=float(NX)*float(NY)*float(NZ);

float2 m1;
float2 m2;
Expand Down
22 changes: 3 additions & 19 deletions src/calc_conv_rotor_new.cu
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ static __global__ void convolution_rotor_3(float2* wx,float2* wy,float2* wz,floa

int h = blockIdx.x * blockDim.x + threadIdx.x;

float N3=(float) N* (float) N* (float)N;
float N3= float(NX)*float(NY)*float(NZ);

float2 m3;

Expand Down Expand Up @@ -55,7 +55,7 @@ static __global__ void convolution_rotor_12(float2* wx,float2* wy,float2* wz,flo


int h = blockIdx.x * blockDim.x + threadIdx.x;
float N3=(float) N* (float) N* (float)N;
float N3= float(NX)*float(NY)*float(NZ);

float2 m1;
float2 m2;
Expand Down Expand Up @@ -90,23 +90,7 @@ static __global__ void convolution_rotor_12(float2* wx,float2* wy,float2* wz,flo
w1.y=w1.y/N3;
w2.y=w2.y/N3;
w3.y=w3.y/N3;
/*
u1.x=u1.x*oN3;
u2.x=u2.x*oN3;
u3.x=u3.x*oN3;

u1.y=u1.y*oN3;
u2.y=u2.y*oN3;
u3.y=u3.y*oN3;

w1.x=w1.x*oN3;
w2.x=w2.x*oN3;
w3.x=w3.x*oN3;

w1.y=w1.y*oN3;
w2.y=w2.y*oN3;
w3.y=w3.y*oN3;
*/

// Calculate the first and second component of the convolution rotor

m1.x=u2.x*w3.x-u3.x*w2.x;
Expand Down
4 changes: 2 additions & 2 deletions src/forcingCoefficient.cu
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static __global__ void calcEnergyShellKernel2(float2* ux,float2* uy,float2* uz,f
float k2=j<NY/2 ? (float)j : (float)j-(float)NY ;
float k3=(float)k;
float kk=k1*k1+k2*k2+k3*k3;
float N3=(float)N*(float)N*(float)N;
float N3=float(NX)*float(NY)*float(NZ);
int h = i*NY*NZ+j*NZ+k;

float2 u1,u2,u3;
Expand Down Expand Up @@ -357,7 +357,7 @@ static __global__ void calcEnergyShellKernel(float2* ux,float2* uy,float2* uz,fl
float k1,k2,k3;
float kk;

float N3=(float)N*(float)N*(float)N;
float N3=float(NX)*float(NY)*float(NZ);


int h=i*NY*NZ+j*NZ+k;
Expand Down
33 changes: 13 additions & 20 deletions src/imposeSymetry.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,21 @@ static __global__ void normalize_kernel(float2* t1,float2* t2,float2* t3,int IGL
{


int h = blockIdx.x * blockDim.x + threadIdx.x;
int h = blockIdx.x * blockDim.x + threadIdx.x;

//if(i<NXSIZE && j<NY && k<NZ )
if( h < (NXSIZE*NY*NZ) )
{


float N3=(float)N*(float)N*(float)N;
//if(i<NXSIZE && j<NY && k<NZ )
if( h < (NXSIZE*NY*NZ) )
{
float N3=float(NX)*float(NY)*float(NZ);

t1[h].x/=N3;
t2[h].x/=N3;
t3[h].x/=N3;

t1[h].y/=N3;
t2[h].y/=N3;
t3[h].y/=N3;




}

t1[h].x/=N3;
t2[h].x/=N3;
t3[h].x/=N3;

t1[h].y/=N3;
t2[h].y/=N3;
t3[h].y/=N3;
}
}


Expand Down
9 changes: 2 additions & 7 deletions src/statisticsKernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@

static __global__ void calcEkernel(float2* ux,float2* uy,float2* uz,float2* t,int IGLOBAL,int NXSIZE)
{


int ind = blockIdx.x * blockDim.x + threadIdx.x;


int k = ind%NZ;
int i = ind/(NZ*NY);
int j = ind/NZ-i*NY;


float N3=(float)N*(float)N*(float)N;
float N3 = float(NX)*float(NY)*float(NZ);

int h=i*NY*NZ+j*NZ+k;

Expand Down Expand Up @@ -73,7 +68,7 @@ static __global__ void calcDkernel(float2* ux,float2* uy,float2* uz,float2* t,fl
int i = ind/(NZ*NY);
int j = ind/NZ-i*NY;

float N3=(float)N*(float)N*(float)N;
float N3=float(NX)*float(NY)*float(NZ);

int h=i*NY*NZ+j*NZ+k;

Expand Down
Loading