Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
07f818be
Commit
07f818be
authored
Jan 07, 2016
by
Matthieu Schaller
Browse files
Added MPI version string to the greeting message.
parent
1a816849
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/version.c
View file @
07f818be
...
...
@@ -18,6 +18,14 @@
*
******************************************************************************/
/* Config parameters. */
#include
"../config.h"
/* MPI headers. */
#ifdef WITH_MPI
#include
<mpi.h>
#endif
/* Some standard headers. */
#include
<stdio.h>
#include
<string.h>
...
...
@@ -122,6 +130,21 @@ const char *compiler_version(void) {
return
version
;
}
const
char
*
mpi_version
(
void
)
{
static
char
version
[
256
]
=
{
0
};
#ifdef WITH_MPI
static
char
lib_version
[
MPI_MAX_LIBRARY_VERSION_STRING
]
=
{
0
};
int
len
,
std_version
,
std_subversion
;
MPI_Get_library_lib_version
(
version
,
&
len
);
MPI_Get_version
(
&
std_version
,
&
std_subversion
);
sprintf
(
"%s (standard v %i.%i)"
,
lib_version
,
std_version
,
std_subversion
);
#else
sprintf
(
version
,
"Code was not compiled with MPI support"
);
#endif
return
version
;
}
/**
* @brief Prints a greeting message to the standard output containing code
* version and revision number
...
...
@@ -139,5 +162,9 @@ void greetings(void) {
printf
(
" Version : %s
\n
"
,
package_version
());
printf
(
" Revision: %s, Branch: %s
\n
"
,
git_revision
(),
git_branch
());
printf
(
" Webpage : www.swiftsim.com
\n
"
);
printf
(
" Compiler: %s, Version: %s
\n\n
"
,
compiler_name
(),
compiler_version
());
printf
(
" Compiler: %s, Version: %s
\n
"
,
compiler_name
(),
compiler_version
());
#ifdef WITH_MPI
printf
(
" MPI library: %s
\n
"
,
mpi_version
());
#endif
printf
(
"
\n
"
);
}
src/version.h.in
View file @
07f818be
...
...
@@ -35,6 +35,7 @@ const char* git_revision(void);
const char* git_branch(void);
const char* compiler_name(void);
const char* compiler_version(void);
const char* mpi_version(void);
void greetings(void);
#endif /* SWIFT_VERSION_H */
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment