From 7e1a4123b6ec3a36059de20498522e731e12dc39 Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 24 Oct 2012 16:48:22 +0000 Subject: [PATCH] Add "mpirun -np2" to step-32 and step-33, "step42 input.prm" to step-42 git-svn-id: https://svn.dealii.org/branches/branch_cmake@27195 0785d39b-7218-0410-832d-ea1e28bc413d --- .../macros/macro_deal_ii_invoke_autopilot.cmake | 15 ++++++++------- deal.II/examples/step-32/CMakeLists.txt | 11 ++++++++++- deal.II/examples/step-33/CMakeLists.txt | 3 +++ deal.II/examples/step-42/CMakeLists.txt | 10 +++++++++- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake b/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake index 40a6cbac36..0403eab2a8 100644 --- a/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake @@ -24,13 +24,13 @@ # TARGET - a string used for the project and target name # TARGET_SRC - a list of source file to compile for target # ${TARGET} +# TARGET_RUN - (optional) the command line that should be +# invoked by "make run", will be set to default +# values if empty # CLEAN_UP_FILES - (optional) a list of files (globs) that will be # removed with "make runclean" and "make # distclean", will be set to default values if # empty -# RUN_COMMAND - (optional) the command line that should be -# invoked by "make run", will be set to default -# values if empty # MACRO(DEAL_II_INVOKE_AUTOPILOT) @@ -48,12 +48,13 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT) MESSAGE(STATUS "Autopilot invoked") # Define a custom target to easily run the program: - IF("${RUN_COMMAND}" STREQUAL "") - SET(RUN_COMMAND ${TARGET}) + IF("${TARGET_RUN}" STREQUAL "") + SET(TARGET_RUN ${TARGET}) ENDIF() ADD_CUSTOM_TARGET(run - COMMAND ${RUN_COMMAND} - COMMENT "Run ${TARGET} compiled with ${CMAKE_BUILD_TYPE} configuration in ${CMAKE_SOURCE_DIR}" + COMMAND ${TARGET_RUN} + DEPENDS ${TARGET} + COMMENT "Run ${TARGET} with ${CMAKE_BUILD_TYPE} configuration" ) # Define custom targets to easily switch the build type: diff --git a/deal.II/examples/step-32/CMakeLists.txt b/deal.II/examples/step-32/CMakeLists.txt index e5d3814d89..6bc47a03a3 100644 --- a/deal.II/examples/step-32/CMakeLists.txt +++ b/deal.II/examples/step-32/CMakeLists.txt @@ -11,6 +11,12 @@ SET(TARGET_SRC # You can specify additional files here! ) +# A custom command line to run the program +SET(TARGET_RUN mpirun -np 2 ${TARGET}) + +# Define the output that should be cleaned: +SET(CLEAN_UP_FILES *.vtu *.pvtu *.visit) + # Usually, you will not need to modify anything beyond this point... CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) @@ -28,9 +34,12 @@ FIND_PACKAGE(deal.II 8.0 REQUIRED # # Are all dependencies fullfilled? # -IF(NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS) +IF( NOT DEAL_II_WITH_MPI OR + NOT DEAL_II_WITH_P4EST OR + NOT DEAL_II_WITH_TRILINOS ) MESSAGE(FATAL_ERROR " Error! The deal.II library found at ${DEAL_II_PATH} was not configured with + DEAL_II_WITH_MPI = ON DEAL_II_WITH_P4EST = ON DEAL_II_WITH_TRILINOS = ON which is required for this tutorial step." diff --git a/deal.II/examples/step-33/CMakeLists.txt b/deal.II/examples/step-33/CMakeLists.txt index af3eea68c6..f34e13adf9 100644 --- a/deal.II/examples/step-33/CMakeLists.txt +++ b/deal.II/examples/step-33/CMakeLists.txt @@ -11,6 +11,9 @@ SET(TARGET_SRC # You can specify additional files here! ) +# A custom command line to run the program +SET(TARGET_RUN ${TARGET} input.prm) + # Usually, you will not need to modify anything beyond this point... CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) diff --git a/deal.II/examples/step-42/CMakeLists.txt b/deal.II/examples/step-42/CMakeLists.txt index ec5982ef5b..cabb1fb3bb 100644 --- a/deal.II/examples/step-42/CMakeLists.txt +++ b/deal.II/examples/step-42/CMakeLists.txt @@ -11,6 +11,12 @@ SET(TARGET_SRC # You can specify additional files here! ) +# A custom command line to run the program +SET(TARGET_RUN mpirun -np 2 ${TARGET}) + +# Define the output that should be cleaned: +SET(CLEAN_UP_FILES *.vtu *.pvtu *.visit) + # Usually, you will not need to modify anything beyond this point... CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) @@ -28,10 +34,12 @@ FIND_PACKAGE(deal.II 8.0 REQUIRED # # Are all dependencies fullfilled? # -IF( NOT DEAL_II_WITH_P4EST OR +IF( NOT DEAL_II_WITH_MPI OR + NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS ) MESSAGE(FATAL_ERROR " Error! The deal.II library found at ${DEAL_II_PATH} was not configured with + DEAL_II_WITH_MPI = ON DEAL_II_WITH_P4EST = ON DEAL_II_WITH_TRILINOS = ON which is required for this tutorial step." -- 2.39.5