@@ -10,36 +10,21 @@ that of the parallel solution.
1010
1111## Task 2
1212
13- > Ensure your test can be compiled using Make.
14-
15- To compile MPI enabled pFUnit tests via Make you must ensure you include ` -lpfunit ` in the test flags,
16-
17- ``` diff
18- --- a/episodes/6-testing-parallel-code/challenge/test/Makefile
19- +++ b/episodes/6-testing-parallel-code/challenge/test/Makefile
20- @@ -3,7 +3,7 @@ PFUNIT_INCLUDE_DIR ?= /home/vscode/pfunit/build/installed/PFUNIT-4.12/include
21- # Don't try to include if we're cleaning as this doesn't depend on pFUnit
22- ifneq ($(MAKECMDGOALS),clean)
23- include $(PFUNIT_INCLUDE_DIR)/PFUNIT.mk
24- - TEST_FLAGS = -I$(BUILD_DIR) $(PFUNIT_EXTRA_FFLAGS)
25- + TEST_FLAGS = -I$(BUILD_DIR) $(PFUNIT_EXTRA_FFLAGS) -lpfunit
26- endif
27-
28- check:
29- ```
13+ > i. Update the [ test/Makefile] ( ./test/Makefile ) to allow building MPI enabled pFUnit tests and build your new test with make.
14+
15+ To compile MPI enabled pFUnit tests via Make you must ensure you include ` -lpfunit ` in the ** TEST_FLAGS** and add your new test to
16+ the list ** tests_TESTS** .
3017
31- > Make sure your test automatically runs across different numbers of ranks via ctest.
18+ > ii. Make sure your test automatically runs across different numbers of ranks via ctest. You will need to make changes in
19+ > [ CMakeLists.txt] ( ./CMakeLists.txt ) as well as within the test itself.
3220
3321In order to run this parallel solution with different numbers of MPI ranks via ctest, you will also need to update CMakeLists.txt
34- with the following change.
35-
36- ``` diff
37- --- a/episodes/6-testing-parallel-code/challenge/test/CMakeLists.txt
38- +++ b/episodes/6-testing-parallel-code/challenge/test/CMakeLists.txt
39- @@ -62,4 +62,5 @@ add_pfunit_ctest (pfunit_exchange_boundaries_tests
40- add_pfunit_ctest (pfunit_find_steady_state_tests
41- TEST_SOURCES "${PROJECT_SOURCE_DIR}/test/test_find_steady_state.pf"
42- LINK_LIBRARIES sut # your application library
43- + MAX_PES 8
44- )
22+ to add the following.
23+
24+ ``` cmake
25+ add_pfunit_ctest (pfunit_find_steady_state_tests
26+ TEST_SOURCES "${PROJECT_SOURCE_DIR}/test/test_find_steady_state.pf"
27+ LINK_LIBRARIES sut # your application library
28+ MAX_PES 8
29+ )
4530```
0 commit comments