Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
dcd8685c
Commit
dcd8685c
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Be more verbose about using homemeade barriers.
parent
840de9bb
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!442
Support for OSX
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
configure.ac
+19
-14
19 additions, 14 deletions
configure.ac
examples/main.c
+7
-0
7 additions, 0 deletions
examples/main.c
src/common_io.c
+1
-0
1 addition, 0 deletions
src/common_io.c
src/version.c
+16
-0
16 additions, 0 deletions
src/version.c
src/version.h
+1
-0
1 addition, 0 deletions
src/version.h
with
44 additions
and
14 deletions
configure.ac
+
19
−
14
View file @
dcd8685c
...
...
@@ -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
barrier
s])
,
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
...
...
This diff is collapsed.
Click to expand it.
examples/main.c
+
7
−
0
View file @
dcd8685c
...
...
@@ -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
));
...
...
This diff is collapsed.
Click to expand it.
src/common_io.c
+
1
−
0
View file @
dcd8685c
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/version.c
+
16
−
0
View file @
dcd8685c
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/version.h
+
1
−
0
View file @
dcd8685c
...
...
@@ -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 */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment