Commit c214eb78 authored by Marcus Mohr's avatar Marcus Mohr
Browse files

Adapting WalberlaAccuracyTest for pipeline PreStage only

On closer inspection it is difficult to test the suspicion that
we run the _sp jobs of the pipeline with double, too. Problem
is that when this is the case the setting of the macro
WALBERLA_DOUBLE_ACCURACY will be wrong and we cannot use it
to distinguish between single and double precision as the
desired value.

Current Prestage has two jobs:
- clang_13.0_mpionly_eigen_petsc_trilinos
- gcc_11_mpionly_dbg_sp
so we can hardcode that for the moment to base decision on
the compiler identification.
parent 5aa914ff
Pipeline #40333 failed with stages
in 44 minutes
......@@ -19,7 +19,7 @@
*/
// This test is actually testing not the code but that the pipeline
// does what we expect. We check here that the postfix _sp tests
// does what we expect. We check here that the postfix _sp jobs
// really run with single precision.
#include "core/Environment.h"
......@@ -32,20 +32,36 @@
using namespace hyteg;
// Pimp for testing the suspicion that we run the _sp jobs
// with double, too. Problem is that when this is the case the
// setting of WALBERLA_DOUBLE_ACCURACY will be wrong and the
// check below will succeed ;-(
//
// Current Prestage has two jobs:
// - clang_13.0_mpionly_eigen_petsc_trilinos
// - gcc_11_mpionly_dbg_sp
// so we can decide based on the compiler identification
int main( int argc, char* argv[] )
{
walberla::Environment walberlaEnv( argc, argv );
walberla::logging::Logging::instance()->setLogLevel( walberla::logging::Logging::PROGRESS );
walberla::MPIManager::instance()->useWorldComm();
#ifdef WALBERLA_DOUBLE_ACCURACY
bool real_t_is_double = std::is_same< double, walberla::real_t >::value;
WALBERLA_CHECK( real_t_is_double );
#ifdef __clang__
bool real_t_is_double = std::is_same< double, walberla::real_t >::value;
WALBERLA_CHECK( real_t_is_double );
#else
bool real_t_is_float = std::is_same< float, walberla::real_t >::value;
WALBERLA_CHECK( real_t_is_float );
bool real_t_is_float = std::is_same< float, walberla::real_t >::value;
WALBERLA_CHECK( real_t_is_float );
#endif
// #ifdef WALBERLA_DOUBLE_ACCURACY
// bool real_t_is_double = std::is_same< double, walberla::real_t >::value;
// WALBERLA_CHECK( real_t_is_double );
// #else
// bool real_t_is_float = std::is_same< float, walberla::real_t >::value;
// WALBERLA_CHECK( real_t_is_float );
// #endif
return 0;
}
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