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
1c6c0c24
Commit
1c6c0c24
authored
9 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Add features to get PLATFORM MPI library name reported
parent
65f04687
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!136
Master
,
!72
Print information about the libraries used in the greeting message
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure.ac
+5
-0
5 additions, 0 deletions
configure.ac
src/version.c
+9
-4
9 additions, 4 deletions
src/version.c
with
14 additions
and
4 deletions
configure.ac
+
5
−
0
View file @
1c6c0c24
...
...
@@ -60,6 +60,7 @@ AC_ARG_ENABLE([mpi],
good_mpi="yes"
if test "$enable_mpi" = "yes"; then
AX_MPI([CC="$MPICC" AC_DEFINE(HAVE_MPI, 1, [Define if you have the MPI library.]) ])
MPI_LIBRARY="Unknown MPI"
# Various MPI implementations require additional libraries when also using
# threads. Use mpirun (on PATH) as that seems to be only command with
...
...
@@ -83,14 +84,17 @@ if test "$enable_mpi" = "yes"; then
case "$version" in
*Intel*MPI*)
MPI_THREAD_LIBS="-mt_mpi"
MPI_LIBRARY="Intel MPI"
AC_MSG_RESULT([Intel MPI])
;;
*Platform*)
MPI_THREAD_LIBS="-lmtmpi"
MPI_LIBRARY="PLATFORM MPI"
AC_MSG_RESULT([PLATFORM MPI])
;;
*"Open MPI"*)
MPI_THREAD_LIBS=""
MPI_LIBRARY="Open MPI"
AC_MSG_RESULT([Open MPI])
# OpenMPI should be 1.8.6 or later, if not complain.
# Version is last word on first line of -version output.
...
...
@@ -109,6 +113,7 @@ if test "$enable_mpi" = "yes"; then
esac
AC_SUBST([MPI_THREAD_LIBS])
fi
AC_DEFINE_UNQUOTED([SWIFT_MPI_LIBRARY], ["$MPI_LIBRARY"], [The MPI library name, if known.])
fi
AM_CONDITIONAL([HAVEMPI],[test $enable_mpi = "yes"])
...
...
This diff is collapsed.
Click to expand it.
src/version.c
+
9
−
4
View file @
1c6c0c24
...
...
@@ -140,21 +140,26 @@ const char *compiler_version(void) {
const
char
*
mpi_version
(
void
)
{
static
char
version
[
256
]
=
{
0
};
#ifdef WITH_MPI
int
len
,
std_version
,
std_subversion
;
/* Check that the library implements the version string routine */
int
std_version
,
std_subversion
;
/* Check that the library implements the version string routine */
#ifdef MPI_MAX_LIBRARY_VERSION_STRING
static
char
lib_version
[
MPI_MAX_LIBRARY_VERSION_STRING
]
=
{
0
};
int
len
;
MPI_Get_library_version
(
lib_version
,
&
len
);
/* Find first \n and truncate string to this length, get many lines from
/* Find first \n and truncate string to this length,
can
get many lines from
* some MPIs (MPICH). */
char
*
ptr
=
strchr
(
lib_version
,
'\n'
);
if
(
ptr
!=
NULL
)
*
ptr
=
'\0'
;
#else
/* Use autoconf guessed value. */
static
char
lib_version
[
256
]
=
{
0
};
sprintf
(
lib_version
,
"Unknown library"
);
sprintf
(
lib_version
,
SWIFT_MPI_LIBRARY
);
#endif
/* Numeric version. */
MPI_Get_version
(
&
std_version
,
&
std_subversion
);
snprintf
(
version
,
256
,
"%s (implementing MPI standard v %i.%i)"
,
lib_version
,
std_version
,
std_subversion
);
...
...
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