From 09a5ffcf1f2893e0acd8c0d1f7265f8c474c8727 Mon Sep 17 00:00:00 2001 From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de> Date: Thu, 13 Apr 2017 14:32:17 +0200 Subject: [PATCH] Add application for KNL --- applications/CMakeLists.txt | 1 + applications/knl/CMakeLists.txt | 2 + applications/knl/poisson_dg/CMakeLists.txt | 5 ++ .../knl/poisson_dg/knl_poisson_dg.mini | 50 +++++++++++++++++++ applications/knl/poisson_dg/poisson_dg.ufl | 32 ++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 applications/knl/CMakeLists.txt create mode 100644 applications/knl/poisson_dg/CMakeLists.txt create mode 100644 applications/knl/poisson_dg/knl_poisson_dg.mini create mode 100644 applications/knl/poisson_dg/poisson_dg.ufl diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt index 5a75b84e..f472b3d2 100644 --- a/applications/CMakeLists.txt +++ b/applications/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory(poisson_dg) add_subdirectory(poisson_dg_tensor) +add_subdirectory(knl) diff --git a/applications/knl/CMakeLists.txt b/applications/knl/CMakeLists.txt new file mode 100644 index 00000000..f935128e --- /dev/null +++ b/applications/knl/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(poisson_dg) + diff --git a/applications/knl/poisson_dg/CMakeLists.txt b/applications/knl/poisson_dg/CMakeLists.txt new file mode 100644 index 00000000..3fb870b9 --- /dev/null +++ b/applications/knl/poisson_dg/CMakeLists.txt @@ -0,0 +1,5 @@ +dune_add_formcompiler_system_test(UFLFILE poisson_dg.ufl + BASENAME app_knl_poisson + INIFILE knl_poisson_dg.mini + NO_TESTS + ) diff --git a/applications/knl/poisson_dg/knl_poisson_dg.mini b/applications/knl/poisson_dg/knl_poisson_dg.mini new file mode 100644 index 00000000..876dc1ca --- /dev/null +++ b/applications/knl/poisson_dg/knl_poisson_dg.mini @@ -0,0 +1,50 @@ +__name = app_knl_poisson_dg_{__exec_suffix} +__exec_suffix = deg{formcompiler.ufl_variants.degree}_{opcount_suffix}_level{formcompiler.instrumentation_level} + +opcount_suffix = opcount, nonopcount | expand opcount +{opcount_suffix} == opcount and {formcompiler.instrumentation_level} != 4 | exclude + +# Calculate the size of the grid to equlibritate it to 100 MB/rank +# Input parameters +dim = 3 +mbperrank = 100 +ranks = 16 +floatingbytes = 8 + +# Metaini Calculations +memperrank = {mbperrank} * 1048576 | eval +dofsperdir = {formcompiler.ufl_variants.degree} + 1 | eval +celldofs = {dofsperdir} ** {dim} | eval +cellsperrank = {memperrank} / ({floatingbytes} * {celldofs}) | eval +cellsperdir = {cellsperrank} ** (1/{dim}) | eval | toint +firstdircells = {ranks} * {cellsperdir} | eval +dimminusone = {dim} - 1 | eval +ones = 1 | repeat {dimminusone} +otherdircells = {cellsperdir} | repeat {dimminusone} + +# Set up the timing identifier +identifier = knl_poisson_dg_deg{formcompiler.ufl_variants.degree} + +# Setup the grid! +extension = 1.0 | repeat {dim} +cells = {firstdircells} {otherdircells} +partitioning = {ranks} {ones} + +[wrapper.vtkcompare] +name = {__name} +extension = vtu + +[formcompiler] +fastdg = 1 +sumfact = 1 +vectorize_quad = 1 +vectorize_diagonal = 1 +instrumentation_level = 2, 3, 4 | expand +opcounter = 1, 0 | expand opcount +time_opcounter = 0, 1 | expand opcount +quadrature_order = {formcompiler.ufl_variants.degree} * 2 | eval +architecture = knl + +[formcompiler.ufl_variants] +cell = hexahedron +degree = 1, 3, 5, 7, 9 | expand diff --git a/applications/knl/poisson_dg/poisson_dg.ufl b/applications/knl/poisson_dg/poisson_dg.ufl new file mode 100644 index 00000000..2c0f2c34 --- /dev/null +++ b/applications/knl/poisson_dg/poisson_dg.ufl @@ -0,0 +1,32 @@ +dim = 3 +x = SpatialCoordinate(cell) +f = -6. +g = x[0]*x[0] + x[1]*x[1] + x[2]*x[2] + +V = FiniteElement("DG", cell, degree) + +u = TrialFunction(V) +v = TestFunction(V) + +n = FacetNormal(cell)('+') + +alpha = 1.0 +h_ext = CellVolume(cell) / FacetArea(cell) +cse_gamma_ext = (alpha * degree * (degree + dim - 1)) / h_ext +h_int = Min(CellVolume(cell)('+'), CellVolume(cell)('-')) / FacetArea(cell) +cse_gamma_int = (alpha * degree * (degree + dim - 1)) / h_int + +theta = -1.0 + +r = inner(grad(u), grad(v))*dx \ + + inner(n, avg(grad(u)))*jump(v)*dS \ + + cse_gamma_int*jump(u)*jump(v)*dS \ + - theta*jump(u)*inner(avg(grad(v)), n)*dS \ + - inner(n, grad(u))*v*ds \ + + cse_gamma_ext*u*v*ds \ + + theta*u*inner(grad(v), n)*ds \ + - f*v*dx \ + - theta*g*inner(grad(v), n)*ds \ + - cse_gamma_ext*g*v*ds + +forms = [r] -- GitLab