Skip to content

Commit

Permalink
Add 2D subdomain test.
Browse files Browse the repository at this point in the history
  • Loading branch information
chuck.yount committed Mar 29, 2019
1 parent 24ea446 commit 3e2350e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ endif
# Add options for PMEM.
ifeq ($(pmem),1)
YK_CXXFLAGS += -I/opt/intel/memkind/include
YK_LIBS += -L/opt/intel/memkind/lib -lmemkind
YK_LIBS += -L/opt/intel/memkind/lib -lmemkind
MACROS += USE_PMEM
endif

Expand Down Expand Up @@ -844,6 +844,7 @@ stencil-tests:
$(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_misc_2d fold=x=2,y=2 EXTRA_YC_FLAGS=-interleave-misc
$(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_step_cond_1d fold=x=4
$(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_subdomain_1d fold=x=4
$(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_subdomain_2d fold=x=2,y=2
$(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_subdomain_3d fold=x=2,y=2
$(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_scratch_1d fold=x=4
$(MAKE) clean; $(MAKE) $(STENCIL_TEST_ARGS) stencil=test_scratch_3d fold=x=2,z=2
Expand Down
28 changes: 28 additions & 0 deletions src/stencils/SimpleTestStencils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,34 @@ class TestSubdomainStencil1 : public TestBase {

REGISTER_STENCIL(TestSubdomainStencil1);

class TestSubdomainStencil2 : public TestBase {

protected:

// Vars.
MAKE_GRID(A, t, x, y); // time-varying grid.

public:

TestSubdomainStencil2(StencilList& stencils, int radius=2) :
TestBase("test_subdomain_2d", stencils, radius) { }

// Define equation to apply to all points in 'A' grid.
virtual void define() {

// Sub-domain is rectangle interior.
Condition sd0 =
(x >= first_index(x) + 5) && (x <= last_index(x) - 3) &&
(y >= first_index(y) + 4) && (y <= last_index(y) - 6);

// Set A w/different stencils depending on condition.
A(t+1, x, y) EQUALS def_2d(A, t, x, 0, 2, y, 1, 0) IF sd0;
A(t+1, x, y) EQUALS def_2d(A, t, x, 1, 0, y, 0, 2) IF !sd0;
}
};

REGISTER_STENCIL(TestSubdomainStencil2);

class TestSubdomainStencil3 : public TestBase {

protected:
Expand Down

0 comments on commit 3e2350e

Please sign in to comment.