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
07f818be
Commit
07f818be
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added MPI version string to the greeting message.
parent
1a816849
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
src/version.c
+28
-1
28 additions, 1 deletion
src/version.c
src/version.h.in
+1
-0
1 addition, 0 deletions
src/version.h.in
with
29 additions
and
1 deletion
src/version.c
+
28
−
1
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
"
);
}
This diff is collapsed.
Click to expand it.
src/version.h.in
+
1
−
0
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 */
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