In January 2021 we will introduce a 10 GB quota for project repositories. Higher limits for individual projects will be available on request. Please see https://doku.lrz.de/display/PUBLIC/GitLab for more information.

Commit 316a1fd6 authored by Jean-Matthieu Gallard's avatar Jean-Matthieu Gallard

KernelGen - predictor recompute vect working for mixed euler test case

parent b0adee6c
......@@ -351,19 +351,9 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
}
{% endif %}{# useSourceOrNCP #}
// add coeff w[t]*w[z]*w[y]*w[x]*dt to rhs
// const double wtdt = dt*weights1[t];
// for (int zyx=0; zyx < {{nDof**nDim}}; zyx++) {
// #pragma omp simd aligned(rhs,weights3:ALIGNMENT)
// for (int n = 0; n < {{nVarPad}}; n++) {
// rhs[{{idxRhs(t,0,0,zyx,n)}}] *= wtdt;
// }
// }
} // end time dof
// 3. Multiply with (K1)^(-1) to get the discrete time integral of the
// discrete Picard iteration
// 3. Multiply with (K1)^(-1) to get the discrete time integral of the discrete Picard iteration. Rhs missing weight and dt included in coeff matrix
double sq_res = 0.0;
for (int zyx = 0; zyx < {{nDof**nDim}}; zyx++) {
{{ m.matmul('lqi', 'rhs', 'iK1_T_wt_dt', 'new_lQi_slice',idxRhs(0,0,0,zyx,0), '0', '0') | indent(6) }}{##}
......@@ -532,17 +522,20 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
//**************************
#ifdef __INTEL_COMPILER
__assume_aligned(lPi, ALIGNMENT);
__assume_aligned(lQhi, ALIGNMENT);
__assume_aligned(lFhi, ALIGNMENT);
__assume_aligned(lQhbnd, ALIGNMENT);
__assume_aligned(lFhbnd, ALIGNMENT);
__assume_aligned(FRCoeff, ALIGNMENT);
__assume_aligned(FLCoeff, ALIGNMENT);
{% if useViscousFlux %}
__assume_aligned(gradQ, ALIGNMENT);
__assume_aligned(lGradQhbnd, ALIGNMENT);
{% endif %}
{% if useFlux %}
__assume_aligned(lFhi, ALIGNMENT);
{% endif %}
__assume_aligned(FRCoeff, ALIGNMENT);
__assume_aligned(FLCoeff, ALIGNMENT);
#endif
std::memset(lQhbnd, 0, {{2*nDim*nDataPad*nDof*nDof3D}} * sizeof(double));
......@@ -741,12 +734,13 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
//*****************************
#ifdef __INTEL_COMPILER
__assume_aligned(lduh, ALIGNMENT); //lduh should be aligned, see Solver.h
__assume_aligned(weights3, ALIGNMENT);
{% if useFlux %}
__assume_aligned(iweights1, ALIGNMENT);
__assume_aligned(lFhi, ALIGNMENT);
__assume_aligned(Kxi_T, ALIGNMENT);
__assume_aligned(weights2, ALIGNMENT);
{% endif %}{# useFlux #}
__assume_aligned(lduh, ALIGNMENT); //lduh should be aligned, see Solver.h
{% if useSourceOrNCP %}
__assume_aligned(weights3, ALIGNMENT);
__assume_aligned(lShi, ALIGNMENT);
......@@ -795,7 +789,7 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
{% if useSourceOrNCP %}
// source
#pragma omp simd aligned(lduh,lShi:ALIGNMENT)
for (int it = 0; it < {{(nDof**nDim)*nVarPad)}}; it++) {
for (int it = 0; it < {{(nDof**nDim)*nVarPad}}; it++) {
lduh[it] += lShi[it];
}
{% endif %}
......
......@@ -124,7 +124,7 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
for (int i = 0; i < {{nDof}}; i++) {
#pragma omp simd aligned(rhsCoeff,Kxi,iweights1:ALIGNMENT)
for (int j = 0; j < {{nDofPad}}; j++) {
rhsCoeff[i*{{nDofPad}}+j] = -inverseDx * Kxi_T[i*{{nDofPad}}+j] * iweights1[j];
rhsCoeff_T[i*{{nDofPad}}+j] = -inverseDx * Kxi_T[i*{{nDofPad}}+j] * iweights1[j];
}
}
{% if useLibxsmm %}
......@@ -152,9 +152,9 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
//TODO JMG Inital guess template
{% if not useCERKGuess or True %}{# fallback trivial guess #}
// 1. Trivial initial guess
std::memset(lQi, 0, sizeof(double)*{{nVarPad*(nDof**nDim)*nDof}});
std::memset(lQi, 0, sizeof(double)*{{nDofPad*nVar*nDof*nDof3D*nDof}});
{% if nPar > 0 %}
std::memset(lPi, 0, sizeof(double)*{{nParPad*(nDof**nDim)}});
std::memset(lPi, 0, sizeof(double)*{{nDofPad*nPar*nDof*nDof3D*nDof}});
{% endif %}
for (int zy = 0; zy < {{nDof3D*nDof}}; zy++) {
......@@ -321,7 +321,7 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
{% if not useFusedSource and useSource %}
double tmp_source_output[{{nVar*nDofPad}}] __attribute__((aligned(ALIGNMENT))) = {0.}; //initialize for padding
{% endif %}
for(int zy = 0; zy < {{nDof3D*nDim}}; zy++) {
for(int zy = 0; zy < {{nDof3D*nDof}}; zy++) {
{% if useNCP or useFusedSource %}
double* gradQ_PDE[{{nDim}}] = { gradQ+{{idxGradQ(0,0,zy,0,0)}}, gradQ+{{idxGradQ(1,0,zy,0,0)}}{{', gradQ+'~idxGradQ(2,0,zy,0,0) if nDim == 3}} };
{% endif %}{# useNCP #}
......@@ -367,8 +367,7 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
} // end time dof
// 3. Multiply with (K1)^(-1) to get the discrete time integral of the
// discrete Picard iteration
// 3. Multiply with (K1)^(-1) to get the discrete time integral of the discrete Picard iteration. Rhs missing weight and dt included in coeff matrix
double sq_res = 0.0;
for (int zy = 0; zy < {{nDof3D*nDof}}; zy++) {
{{ m.matmul('lqi', 'rhs', 'iK1_T_wt_dt', 'new_lQi_slice',idxRhs(0,0,zy,0,0), '0', '0') | indent(6) }}{##}
......@@ -444,7 +443,7 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
{% if not useFusedSource and useSource %}
double tmp_source_output[{{nVar*nDofPad}}] __attribute__((aligned(ALIGNMENT))) = {0.}; //initialize for padding
{% endif %}
for(int zy = 0; zy < {{nDof3D*nDim}}; zy++) {
for(int zy = 0; zy < {{nDof3D*nDof}}; zy++) {
{% if useNCP or useFusedSource %}
double* gradQ_PDE[{{nDim}}] = { gradQ+{{idxGradQ(0,0,zy,0,0)}}, gradQ+{{idxGradQ(1,0,zy,0,0)}}{{', gradQ+'~idxGradQ(2,0,zy,0,0) if nDim == 3}} };
{% endif %}{# useNCP #}
......@@ -532,17 +531,20 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
//**************************
#ifdef __INTEL_COMPILER
__assume_aligned(lPi, ALIGNMENT);
__assume_aligned(lQhi, ALIGNMENT);
__assume_aligned(lFhi, ALIGNMENT);
__assume_aligned(lQhbnd, ALIGNMENT);
__assume_aligned(lFhbnd, ALIGNMENT);
__assume_aligned(FRCoeff, ALIGNMENT);
__assume_aligned(FLCoeff, ALIGNMENT);
{% if useViscousFlux %}
__assume_aligned(gradQ, ALIGNMENT);
__assume_aligned(lGradQhbnd, ALIGNMENT);
{% endif %}
{% if useFlux %}
__assume_aligned(lFhi, ALIGNMENT);
{% endif %}
__assume_aligned(FRCoeff, ALIGNMENT);
__assume_aligned(FLCoeff, ALIGNMENT);
#endif
std::memset(lQhbnd, 0, {{2*nDim*nDataPad*nDof*nDof3D}} * sizeof(double));
......@@ -742,15 +744,19 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
//****** Volume Integral ******
//*****************************
// Using lQi as tmp transposed lduh, use idxLQhi as index
#ifdef __INTEL_COMPILER
__assume_aligned(lQi, ALIGNMENT);
__assume_aligned(lduh, ALIGNMENT); //lduh should be aligned, see Solver.h
__assume_aligned(weights1, ALIGNMENT);
__assume_aligned(weights2, ALIGNMENT);
{% if useFlux %}
__assume_aligned(iweights1, ALIGNMENT);
__assume_aligned(lFhi, ALIGNMENT);
__assume_aligned(Kxi_T, ALIGNMENT);
__assume_aligned(weights2, ALIGNMENT);
__assume_aligned(Kxi, ALIGNMENT);
{% endif %}{# useFlux #}
__assume_aligned(lduh, ALIGNMENT); //lduh should be aligned, see Solver.h
{% if useSourceOrNCP %}
__assume_aligned(weights3, ALIGNMENT);
__assume_aligned(lShi, ALIGNMENT);
{% endif %}
#endif
......@@ -798,7 +804,7 @@ int {{codeNamespace}}::fusedSpaceTimePredictorVolumeIntegral(
{% if nDim == 3 %}
//z, fuse ynx
{{ m.matmul('lduh_z', 'lFhi', 'coeffVolume', 'lQi', idxLFhi(2,0,0,yx,0), '0', idxLQhi(0,0,yx,0)) | indent(2) }}{##}
{{ m.matmul('lduh_z', 'lFhi', 'coeffVolume', 'lQi', idxLFhi(2,0,0,0,0), '0', idxLQhi(0,0,0,0)) | indent(2) }}{##}
{% endif %}
{% endif %}{# useFlux #}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment