Commit 45f02c9c authored by GILLES Sebastien's avatar GILLES Sebastien

#1181 - #1477 Refresh the ways output directory is dealt with. Now for a...

#1181 - #1477 Refresh the ways output directory is dealt with. Now for a 'model' program the defautl behaviour is to ask the user what to do; a flag --overwrite_directory may be added on command line to bypass this.
parent 13e3adc9
......@@ -584,6 +584,7 @@
BE3D12C21D9B1FFB00F900F5 /* SnesConvergenceReason.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE3D12BC1D9B1FFB00F900F5 /* SnesConvergenceReason.cpp */; };
BE3D12C31D9B1FFB00F900F5 /* SnesConvergenceReason.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE3D12BD1D9B1FFB00F900F5 /* SnesConvergenceReason.hpp */; };
BE3D12C41D9B1FFB00F900F5 /* SnesConvergenceReason.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE3D12BE1D9B1FFB00F900F5 /* SnesConvergenceReason.hxx */; };
BE3D3AB822F183DA00E7794E /* Enum.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE3D3AB522F183DA00E7794E /* Enum.hpp */; };
BE3DA2021F2B817E0005679B /* OutputDeformedMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE93B31C1F0536DA004F84CF /* OutputDeformedMesh.cpp */; };
BE3E66451ACEB61100A3F7E2 /* Partition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE3E66421ACEB61100A3F7E2 /* Partition.cpp */; };
BE3E66461ACEB61100A3F7E2 /* Partition.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE3E66431ACEB61100A3F7E2 /* Partition.hpp */; };
......@@ -3486,6 +3487,7 @@
BE3D12BC1D9B1FFB00F900F5 /* SnesConvergenceReason.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SnesConvergenceReason.cpp; sourceTree = "<group>"; };
BE3D12BD1D9B1FFB00F900F5 /* SnesConvergenceReason.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = SnesConvergenceReason.hpp; sourceTree = "<group>"; };
BE3D12BE1D9B1FFB00F900F5 /* SnesConvergenceReason.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = SnesConvergenceReason.hxx; sourceTree = "<group>"; };
BE3D3AB522F183DA00E7794E /* Enum.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Enum.hpp; sourceTree = "<group>"; };
BE3D8F0E1F6542CB0009DB44 /* demo_input_parameter_test_functions_1D.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = demo_input_parameter_test_functions_1D.lua; sourceTree = "<group>"; };
BE3D8F0F1F6542CB0009DB44 /* demo_input_parameter_test_functions_2D.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = demo_input_parameter_test_functions_2D.lua; sourceTree = "<group>"; };
BE3D8F101F6542CB0009DB44 /* demo_input_parameter_test_functions_3D.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = demo_input_parameter_test_functions_3D.lua; sourceTree = "<group>"; };
......@@ -8335,6 +8337,7 @@
BE68B9D11FF385FA009C43BA /* MoReFEMData */ = {
isa = PBXGroup;
children = (
BE3D3AB522F183DA00E7794E /* Enum.hpp */,
BE68B9D51FF385FA009C43BA /* MoReFEMData.hpp */,
BE68B9D61FF385FA009C43BA /* MoReFEMData.hxx */,
BE7E554B22EF4FBC00BEA053 /* Advanced */,
......@@ -10909,6 +10912,7 @@
BE4D0D1821A2E4F900E0D4E7 /* FitzHughNagumo.hpp in Headers */,
BE4D0D4421A2E4F900E0D4E7 /* Heart.hxx in Headers */,
BE4D0D8321A2E4F900E0D4E7 /* InterpolationFile.hpp in Headers */,
BE3D3AB822F183DA00E7794E /* Enum.hpp in Headers */,
BE4D0D5821A2E4F900E0D4E7 /* Solid.hpp in Headers */,
BE4D0D2621A2E4F900E0D4E7 /* FEltSpace.hpp in Headers */,
BE8B675A1CC0F32400312399 /* NumberingSubsetManager.hpp in Headers */,
......@@ -66,6 +66,10 @@
argument = "-i ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/ModelInstances/Elasticity/demo_2d.lua"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--overwrite_directory"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-i ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/ModelInstances/Elasticity/demo_3d.lua"
isEnabled = "YES">
......
//! \file
//
//
// Enum.hpp
// MoReFEM
//
// Created by sebastien on 31/07/2019.
//Copyright © 2019 Inria. All rights reserved.
//
#ifndef MOREFEM_x_CORE_x_MO_RE_F_E_M_DATA_x_ENUM_HPP_
# define MOREFEM_x_CORE_x_MO_RE_F_E_M_DATA_x_ENUM_HPP_
namespace MoReFEM
{
//! Whether a model, a test or a post-processing program is run.
enum class program_type { model, test, post_processing };
} // namespace MoReFEM
#endif // MOREFEM_x_CORE_x_MO_RE_F_E_M_DATA_x_ENUM_HPP_
......@@ -115,30 +115,42 @@ namespace MoReFEM::Internal::MoReFEMDataNS
}
void AskResultDirectoryRemoval(const std::string& directory)
void AskResultDirectoryRemoval(const std::string& directory, overwrite_directory do_overwrite_directory)
{
if (FilesystemNS::Folder::DoExist(directory))
{
std::string answer;
while (answer != "y" || answer != "n")
switch (do_overwrite_directory)
{
do
case overwrite_directory::no:
{
std::cin.clear(); // clear the states of std::cin, putting it back to `goodbit`.
std::cin.ignore(10000, '\n'); // clean-up what might remain in std::cin before using it again.
std::cout << "Directory '" << directory << "' already exists. Do you want to remove it? "
"[y/n]" << std::endl;
std::cin >> answer;
} while (!std::cin);
}
if (answer == "n")
{
std::cout << "The program will therefore exit here." << std::endl;
exit(EXIT_SUCCESS);
std::string answer;
while (answer != "y" && answer != "n")
{
do
{
if (!std::cin)
{
std::cin.clear(); // clear the states of std::cin, putting it back to `goodbit`.
std::cin.ignore(10000, '\n'); // clean-up what might remain in std::cin before using it again.
}
std::cout << "Directory '" << directory << "' already exists. Do you want to remove it? "
"[y/n]" << std::endl;
std::cin >> answer;
} while (!std::cin);
}
if (answer == "n")
{
std::cout << "The program will therefore exit here." << std::endl;
exit(EXIT_SUCCESS);
}
break;
}
case overwrite_directory::yes:
break;
}
FilesystemNS::Folder::Remove(directory, __FILE__, __LINE__);
......
......@@ -22,6 +22,8 @@
# include "ThirdParty/Wrappers/Tclap/StringPair.hpp"
# include "ThirdParty/IncludeWithoutWarning/Tclap/Tclap.hpp"
# include "Core/MoReFEMData/Enum.hpp"
namespace MoReFEM
{
......@@ -54,21 +56,33 @@ namespace MoReFEM::Internal::MoReFEMDataNS
{
//! In the 'model' program type, default behaviour is to ask the user whether he wants to erase the output
//! directory if it already exists. This enum class acknowledges another choice might be made
//! (if --overwrite_directory is given on command line).
enum class overwrite_directory { yes, no };
/*!
* \brief Parse the command line and extract its informations.
*
* \tparam AdditionalCommandLineArgumentsPolicyT Policy if you need additional arguments on the command line.
* To see a concrete example of this possibility, have a look at Test/Core/MoReFEMData/test_command_line_options.cpp
* which demonstrate the possibility. If none, use std::false_type.
* \tparam ProgramTypeT Type of the program. If 'model', an additional flag --overwrite_directory is enabled on
* command line.
*
* \param[in] argc Number of argument in the command line (including the program name).
* \param[in] argv List of arguments read.
* \param[in] additional If AdditionalCommandLineArgumentsPolicyT is not nullptr, give it the this pointer of
* MoReFEMData
* \param[out] do_overwrite_directory Whether the flag --overwrite_directory was found on the command line or not.
* This flag may be given only with ProgramTypeT == program_type::model.
*
* \return Path of the input data file.
*/
template<class AdditionalCommandLineArgumentsPolicyT>
template<program_type ProgramTypeT, class AdditionalCommandLineArgumentsPolicyT>
std::string ParseCommandLine(int argc, char** argv,
overwrite_directory& do_overwrite_directory,
AdditionalCommandLineArgumentsPolicyT* additional = nullptr);
......@@ -110,8 +124,9 @@ namespace MoReFEM::Internal::MoReFEMDataNS
* \brief If \a directory already exists, ask the user whereas he wants to remove it or stop the program.
*
* \param[in] directory Directory which existence is checked.
* \param[in] do_overwrite_directory If 'yes', the former directory is removed silently.
*/
void AskResultDirectoryRemoval(const std::string& directory);
void AskResultDirectoryRemoval(const std::string& directory, overwrite_directory do_overwrite_directory);
} // namespace MoReFEM::Internal::MoReFEMDataNS
......
......@@ -16,8 +16,9 @@ namespace MoReFEM::Internal::MoReFEMDataNS
{
template<class AdditionalCommandLineArgumentsPolicyT>
template<program_type ProgramTypeT, class AdditionalCommandLineArgumentsPolicyT>
std::string ParseCommandLine(int argc, char** argv,
overwrite_directory& do_overwrite_directory,
AdditionalCommandLineArgumentsPolicyT* additional)
{
std::string ret;
......@@ -42,6 +43,20 @@ namespace MoReFEM::Internal::MoReFEMDataNS
"string=string",
cmd);
std::unique_ptr<TCLAP::SwitchArg> overwrite_directory_arg = nullptr;
if constexpr (ProgramTypeT == program_type::model)
{
overwrite_directory_arg =
std::make_unique<TCLAP::SwitchArg>("",
"overwrite_directory",
"If this flag is set, the output directory will be removed "
"silently "
"if it already exists.",
cmd,
false);
}
if constexpr (!std::is_same<AdditionalCommandLineArgumentsPolicyT, std::false_type>())
{
assert(!(!additional));
......@@ -50,6 +65,14 @@ namespace MoReFEM::Internal::MoReFEMDataNS
cmd.parse(argc, argv);
if constexpr (ProgramTypeT == program_type::model)
{
assert(!(!overwrite_directory_arg));
do_overwrite_directory = overwrite_directory_arg->getValue()
? overwrite_directory::yes
: overwrite_directory::no;
}
decltype(auto) env_var_list = env_arg.getValue();
auto& environment = Utilities::Environment::CreateOrGetInstance(__FILE__, __LINE__);
......
......@@ -28,6 +28,7 @@
# include "Core/InputData/Instances/Result.hpp"
# include "Core/InitTimeKeepLog.hpp"
# include "Core/InputData/Instances/Parallelism/Parallelism.hpp"
# include "Core/MoReFEMData/Enum.hpp"
# include "Core/MoReFEMData/Internal/Parallelism.hpp"
# include "Core/MoReFEMData/Internal/Helper.hpp"
......@@ -41,9 +42,6 @@ namespace MoReFEM
//! Whether a model, a test or a post-processing program is run.
enum class program_type { model, test, post_processing };
/*!
* \brief Init MoReFEM: initialize mpi and read the input data file.
......
......@@ -36,8 +36,13 @@ namespace MoReFEM
? nullptr
: this;
Internal::MoReFEMDataNS::overwrite_directory do_overwrite_directory;
std::string input_data_file =
Internal::MoReFEMDataNS::ParseCommandLine<AdditionalCommandLineArgumentsPolicyT>(argc, argv, ptr);
Internal::MoReFEMDataNS::ParseCommandLine
<ProgramTypeT, AdditionalCommandLineArgumentsPolicyT>(argc, argv,
do_overwrite_directory,
ptr);
decltype(auto) mpi = GetMpi();
......@@ -64,16 +69,25 @@ namespace MoReFEM
result_directory_ = ipl::Extract<Result::OutputDirectory>::Folder(*input_data_);
if constexpr(ProgramTypeT == program_type::model)
Internal::MoReFEMDataNS::AskResultDirectoryRemoval(result_directory_);
else if constexpr(ProgramTypeT == program_type::test)
// We first deal with the data that are written only in the 'main' folder.
if (mpi.IsRootProcessor())
{
if (FilesystemNS::Folder::DoExist(result_directory_))
FilesystemNS::Folder::Remove(result_directory_, __FILE__, __LINE__);
if constexpr(ProgramTypeT == program_type::model)
{
Internal::MoReFEMDataNS::AskResultDirectoryRemoval(result_directory_, do_overwrite_directory);
}
else if constexpr(ProgramTypeT == program_type::test)
{
if (FilesystemNS::Folder::DoExist(result_directory_))
FilesystemNS::Folder::Remove(result_directory_, __FILE__, __LINE__);
}
}
result_directory_with_rank_ = result_directory_ + "/Rank_" + std::to_string(mpi.template GetRank<int>());
mpi.Barrier();
// And then with the directories specific to ranks. Here we remove whatever the case.
// (if the same filesystem is used the rank folder is anyway not existing).
if (!FilesystemNS::Folder::DoExist(result_directory_with_rank_))
FilesystemNS::Folder::Create(result_directory_with_rank_, __FILE__, __LINE__);
......
......@@ -39,6 +39,7 @@ morefem_install(MoReFEM4Elasticity MoReFEM4Elasticity_lib MoReFEM4ElasticityEnsi
add_test(ElasticityModel3D
MoReFEM4Elasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Elasticity/demo_3d.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq/Ascii)
......@@ -49,6 +50,7 @@ add_test(ElasticityModel3D-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Elasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Elasticity/demo_3d.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4/Ascii)
......@@ -57,6 +59,7 @@ set_tests_properties(ElasticityModel3D-mpi PROPERTIES TIMEOUT 20)
add_test(ElasticityModel2D
MoReFEM4Elasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Elasticity/demo_2d.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq/Ascii)
......@@ -67,6 +70,7 @@ add_test(ElasticityModel2D-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Elasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Elasticity/demo_2d.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4/Ascii)
......@@ -107,6 +111,7 @@ set_tests_properties(ElasticityModel2DEnsightOutput-mpi PROPERTIES TIMEOUT 10)
add_test(ElasticityModel3D-bin
MoReFEM4Elasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Elasticity/demo_3d_binary.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq/Binary)
......@@ -117,6 +122,7 @@ add_test(ElasticityModel3D-mpi-bin
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Elasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Elasticity/demo_3d_binary.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4/Binary)
......@@ -125,6 +131,7 @@ set_tests_properties(ElasticityModel3D-mpi-bin PROPERTIES TIMEOUT 20)
add_test(ElasticityModel2D-bin
MoReFEM4Elasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Elasticity/demo_2d_binary.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq/Binary)
......@@ -135,6 +142,7 @@ add_test(ElasticityModel2D-mpi-bin
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Elasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Elasticity/demo_2d_binary.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4/Binary)
......
......@@ -40,6 +40,7 @@ target_link_libraries(MoReFEM4HeatCheckResults
add_test(HeatModel2D
MoReFEM4Heat
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Heat/demo_input_heat.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq)
......@@ -58,6 +59,7 @@ add_test(HeatModel2D-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Heat
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Heat/demo_input_heat.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4)
......@@ -74,6 +76,7 @@ set_tests_properties(HeatModel2DEnsightOutput-mpi PROPERTIES TIMEOUT 10)
add_test(HeatModel1D
MoReFEM4Heat
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Heat/demo_input_heat_1d.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq)
......@@ -92,6 +95,7 @@ add_test(HeatModel1D-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Heat
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Heat/demo_input_heat_1d.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4)
......
......@@ -39,6 +39,7 @@ target_link_libraries(MoReFEM4HyperelasticityCheckResults
add_test(Hyperelasticity
MoReFEM4Hyperelasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Hyperelasticity/demo_input_hyperelasticity.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq)
......@@ -49,6 +50,7 @@ add_test(Hyperelasticity-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Hyperelasticity
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Hyperelasticity/demo_input_hyperelasticity.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4)
......
......@@ -36,6 +36,7 @@ morefem_install(MoReFEM4LaplacianEnsightOutput MoReFEM4LaplacianUpdateLuaFile)
add_test(Laplacian
MoReFEM4Laplacian
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Laplacian/demo_input_laplacian.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq)
......@@ -44,6 +45,7 @@ add_test(Laplacian-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Laplacian
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Laplacian/demo_input_laplacian.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4)
......
......@@ -39,6 +39,7 @@ morefem_install(MoReFEM4RivlinCubeEnsightOutput MoReFEM4RivlinCubeUpdateLuaFile)
add_test(RivlinCubeHexa
MoReFEM4RivlinCube
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/RivlinCube/demo_input_rivlin_cube_hexahedra.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq)
......@@ -49,6 +50,7 @@ add_test(RivlinCubeHexa-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4RivlinCube
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/RivlinCube/demo_input_rivlin_cube_hexahedra.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4)
......@@ -57,6 +59,7 @@ set_tests_properties(RivlinCubeHexa-mpi PROPERTIES TIMEOUT 10)
add_test(RivlinCubeTetra
MoReFEM4RivlinCube
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/RivlinCube/demo_input_rivlin_cube_tetrahedra.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq)
......@@ -67,6 +70,7 @@ add_test(RivlinCubeTetra-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4RivlinCube
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/RivlinCube/demo_input_rivlin_cube_tetrahedra.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4)
......
......@@ -33,6 +33,7 @@ morefem_install(MoReFEM4Stokes MoReFEM4Stokes_lib MoReFEM4StokesEnsightOutput Mo
add_test(Stokes
MoReFEM4Stokes
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Stokes/demo.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Seq)
......@@ -42,6 +43,7 @@ add_test(Stokes-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Stokes
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Stokes/demo.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/Mpi4)
......
......@@ -38,30 +38,40 @@ morefem_install(MoReFEM4Stokes_2_operators MoReFEM4Stokes_2_operators_lib MoReFE
add_test(Stokes_2_operators
MoReFEM4Stokes_2_operators
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Stokes/demo.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/TwoOperators/Seq)
set_tests_properties(Stokes-mpi PROPERTIES TIMEOUT 40)
add_test(Stokes_2_operators-mpi
${OPEN_MPI_INCL_DIR}/../bin/mpirun
--oversubscribe
-np 4 MoReFEM4Stokes_2_operators
--overwrite_directory
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_ROOT}/Sources/ModelInstances/Stokes/demo.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/TwoOperators/Mpi4)
set_tests_properties(Stokes-mpi PROPERTIES TIMEOUT 40)
add_test(Stokes_2_operatorsModelEnsightOutput
MoReFEM4Stokes_2_operatorsEnsightOutput
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_TEST_OUTPUT_DIR}/TwoOperators/Seq/Stokes/input_data.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/TwoOperators/Seq)
set_tests_properties(Stokes-mpi PROPERTIES TIMEOUT 10)
add_test(Stokes_2_operatorsModelEnsightOutput-mpi
MoReFEM4Stokes_2_operatorsEnsightOutput
-e MOREFEM_ROOT=${MOREFEM_ROOT}
-i ${MOREFEM_TEST_OUTPUT_DIR}/TwoOperators/Mpi4/Stokes/input_data.lua
-e MOREFEM_RESULT_DIR=${MOREFEM_TEST_OUTPUT_DIR}/TwoOperators/Mpi4)
set_tests_properties(Stokes-mpi PROPERTIES TIMEOUT 10)
# Not a typo: the Stokes executable with a different MOREFEM_TEST_OUTPUT_DIR is fine!
add_test(Stokes_2_operatorsCheckResults
......
......@@ -14,4 +14,4 @@ add_test(NowAsString
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR})
set_tests_properties(NowAsString PROPERTIES TIMEOUT 6)
set_tests_properties(NowAsString PROPERTIES TIMEOUT 10)
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