Commit dcd8685c authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Be more verbose about using homemeade barriers.

parent 840de9bb
......@@ -380,9 +380,13 @@ AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
non-standard location.]))
# Check whether POSIX thread barriers are implemented (e.g. OSX does not have them)
have_pthread_barrier="no"
AC_CHECK_LIB(pthread, pthread_barrier_init,
AC_DEFINE([HAVE_PTHREAD_BARRIERS], [1], [The posix library implements barriers]),
have_pthread_barrier="yes",
AC_MSG_WARN(POSIX implementation does not have barriers. SWIFT will use home-made ones.))
if test "x$have_pthread_barrier" == "xyes"; then
AC_DEFINE([HAVE_PTHREAD_BARRIERS], [1], [The posix library implements barriers])
fi
# Check whether POSIX file allocation functions exist (e.g. OSX does not have them)
AC_CHECK_LIB(pthread, posix_fallocate,
......@@ -914,19 +918,20 @@ AC_MSG_RESULT([
$PACKAGE_NAME v.$PACKAGE_VERSION
Compiler : $CC
- vendor : $ax_cv_c_compiler_vendor
- version : $ax_cv_c_compiler_version
- flags : $CFLAGS
MPI enabled : $enable_mpi
HDF5 enabled : $with_hdf5
- parallel : $have_parallel_hdf5
Metis enabled : $have_metis
FFTW3 enabled : $have_fftw3
libNUMA enabled : $have_numa
Using tcmalloc : $have_tcmalloc
Using jemalloc : $have_jemalloc
CPU profiler : $have_profiler
Compiler : $CC
- vendor : $ax_cv_c_compiler_vendor
- version : $ax_cv_c_compiler_version
- flags : $CFLAGS
MPI enabled : $enable_mpi
HDF5 enabled : $with_hdf5
- parallel : $have_parallel_hdf5
Metis enabled : $have_metis
FFTW3 enabled : $have_fftw3
libNUMA enabled : $have_numa
Using tcmalloc : $have_tcmalloc
Using jemalloc : $have_jemalloc
CPU profiler : $have_profiler
Pthread barriers : $have_pthread_barrier
Hydro scheme : $with_hydro
Dimensionality : $with_dimension
......
......@@ -390,6 +390,13 @@ int main(int argc, char *argv[]) {
message("WARNING: Floating point exceptions will be reported.");
}
/* Do we have slow barriers? */
#ifdef HAVE_PTHREAD_BARRIERS
if (myrank == 0)
message(
"WARNING: Slow homemade thread barriers in use. Code will be slower.");
#endif
/* How large are the parts? */
if (myrank == 0) {
message("sizeof(part) is %4zi bytes.", sizeof(struct part));
......
......@@ -386,6 +386,7 @@ void io_write_code_description(hid_t h_file) {
configuration_options());
io_write_attribute_s(h_grpcode, "CFLAGS", compilation_cflags());
io_write_attribute_s(h_grpcode, "HDF5 library version", hdf5_version());
io_write_attribute_s(h_grpcode, "Thread barriers", thread_barrier_version());
#ifdef HAVE_FFTW
io_write_attribute_s(h_grpcode, "FFTW library version", fftw3_version());
#endif
......
......@@ -332,6 +332,22 @@ const char *fftw3_version(void) {
return version;
}
/**
* @brief return the thread barrier used in SWIFT.
*
* @result description of the thread barriers
*/
const char *thread_barrier_version(void) {
static char version[256] = {0};
#if defined(HAVE_PTHREAD_BARRIERS)
sprintf(version, "%s", "pthread");
#else
sprintf(version, "homemade");
#endif
return version;
}
/**
* @brief Prints a greeting message to the standard output containing code
* version and revision number
......
......@@ -34,6 +34,7 @@ const char* mpi_version(void);
const char* metis_version(void);
const char* hdf5_version(void);
const char* fftw3_version(void);
const char* thread_barrier_version(void);
void greetings(void);
#endif /* SWIFT_VERSION_H */
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