Skip to content
Snippets Groups Projects
Commit d25f89c3 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

tweaks documentation/version information

parent 9a32878d
No related branches found
No related tags found
1 merge request!70Feature/update branching rules
Pipeline #185022 canceled
......@@ -51,9 +51,6 @@ void print_pinning_info(void)
std::cerr << "### pinning info begin" << std::endl;
std::cerr << pinning_info;
std::cerr << "### pinning info end" << std::endl;
std::cout << "### pinning info begin" << std::endl;
std::cout << pinning_info;
std::cout << "### pinning info end" << std::endl;
}
}
......@@ -69,6 +66,11 @@ int main_code(
char *argv[],
const bool floating_point_exceptions)
{
/**********************/
/* basic code info */
std::cerr
<< "TurTLE version " + std::string(TURTLE_VERSION)
<< std::endl;
/* floating point exception switch */
if (floating_point_exceptions)
feenableexcept(FE_INVALID | FE_OVERFLOW);
......@@ -86,34 +88,31 @@ int main_code(
return EXIT_SUCCESS;
}
std::string simname = std::string(argv[1]);
/**********************/
/**********************/
/* initialize MPI environment */
#ifndef USE_FFTW_OMP
MPI_Init(&argc, &argv);
// turn off MPI profiling for initialization
#else
int mpiprovided;
MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &mpiprovided);
#endif
/* turn off MPI profiling for initialization */
MPI_Pcontrol(0);
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
print_pinning_info();
#ifndef USE_FFTW_OMP
fftw_mpi_init();
fftwf_mpi_init();
DEBUG_MSG("There are %d processes\n", nprocs);
#else
int mpiprovided;
MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &mpiprovided);
MPI_Pcontrol(0);
assert(mpiprovided >= MPI_THREAD_FUNNELED);
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
print_pinning_info();
const int nThreads = omp_get_max_threads();
DEBUG_MSG("Number of threads for the FFTW = %d\n",
nThreads);
if (nThreads > 1){
fftw_init_threads();
fftwf_init_threads();
......@@ -129,10 +128,14 @@ int main_code(
}
#endif
print_pinning_info();
/* read maximum MPI tag value */
read_maximum_MPI_tag_value();
/**********************/
/**********************/
/* import fftw wisdom */
if (myrank == 0)
{
......@@ -146,18 +149,13 @@ int main_code(
fftwf_set_timelimit(300);
fftw_set_timelimit(300);
/**********************/
/**********************/
/* actually run DNS */
/*
* MPI environment:
* I could in principle pass myrank and nprocs instead of the global
* communicator, but it is possible that we'd like to do something more
* complex in the future (since I've done it in the past), and it's not
* expensive to keep several copies of myrank and nprocs.
*
* usage of assert:
/* usage of assert:
* we could use assert here, but I assume that any problems we can still
* recover from should not be important enough to not clean up fftw and MPI
* things.
......@@ -198,9 +196,10 @@ int main_code(
}
delete dns;
/**********************/
/**********************/
/* export fftw wisdom */
fftwf_mpi_gather_wisdom(MPI_COMM_WORLD);
fftw_mpi_gather_wisdom(MPI_COMM_WORLD);
......@@ -212,9 +211,11 @@ int main_code(
fftw_export_wisdom_to_filename(
(simname + std::string("_fftw_wisdom.txt")).c_str());
}
/**********************/
/**********************/
/* clean up */
fftwf_mpi_cleanup();
fftw_mpi_cleanup();
......@@ -231,6 +232,7 @@ int main_code(
#endif
MPI_Finalize();
/**********************/
return global_return_value;
}
......
......@@ -27,6 +27,7 @@
#define TURTLE_CONFIG_HPP
#define TURTLE_VERSION "@TURTLE_VERSION@"
#define TURTLE_VERSION_LONG "@TURTLE_VERSION_LONG@"
#cmakedefine USE_FFTW_OMP
#cmakedefine USE_TIMING_OUTPUT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment