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
2779137b
Commit
2779137b
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added METIS version to greetings message
parent
9db71466
No related branches found
No related tags found
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
-12
28 additions, 12 deletions
src/version.c
src/version.h.in
+1
-0
1 addition, 0 deletions
src/version.h.in
with
29 additions
and
12 deletions
src/version.c
+
28
−
12
View file @
2779137b
...
...
@@ -24,6 +24,9 @@
/* MPI headers. */
#ifdef WITH_MPI
#include
<mpi.h>
#ifdef HAVE_METIS
#include
<metis.h>
#endif
#endif
#ifdef HAVE_HDF5
...
...
@@ -47,8 +50,8 @@ const char *git_revision(void) {
static
char
buf
[
256
];
static
int
initialised
=
0
;
static
const
char
*
revision
=
GIT_REVISION
;
if
(
!
initialised
)
{
if
(
strlen
(
revision
)
==
0
)
if
(
!
initialised
)
{
if
(
strlen
(
revision
)
==
0
)
sprintf
(
buf
,
"%s"
,
"unknown"
);
else
sprintf
(
buf
,
"%s"
,
revision
);
...
...
@@ -66,8 +69,8 @@ const char *git_branch(void) {
static
char
buf
[
256
];
static
int
initialised
=
0
;
static
const
char
*
branch
=
GIT_BRANCH
;
if
(
!
initialised
)
{
if
(
strlen
(
branch
)
==
0
)
if
(
!
initialised
)
{
if
(
strlen
(
branch
)
==
0
)
sprintf
(
buf
,
"%s"
,
"unknown"
);
else
sprintf
(
buf
,
"%s"
,
branch
);
...
...
@@ -134,7 +137,6 @@ const char *compiler_version(void) {
return
version
;
}
const
char
*
mpi_version
(
void
)
{
static
char
version
[
256
]
=
{
0
};
#ifdef WITH_MPI
...
...
@@ -147,24 +149,35 @@ const char *mpi_version(void) {
sprintf
(
lib_version
,
"Unknow library"
);
#endif
MPI_Get_version
(
&
std_version
,
&
std_subversion
);
sprintf
(
version
,
"%s (standard v %i.%i)"
,
lib_version
,
std_version
,
std_subversion
);
sprintf
(
version
,
"%s (standard v %i.%i)"
,
lib_version
,
std_version
,
std_subversion
);
#else
sprintf
(
version
,
"Code was not compiled with MPI support"
);
#endif
return
version
;
}
const
char
*
hdf5_version
(
void
)
{
static
char
version
[
256
]
=
{
0
};
#ifdef HAVE_HDF5
unsigned
int
majnum
,
minnum
,
relnum
;
H5get_libversion
(
&
majnum
,
&
minnum
,
&
relnum
)
;
H5get_libversion
(
&
majnum
,
&
minnum
,
&
relnum
)
;
sprintf
(
version
,
"%i.%i.%i"
,
majnum
,
minnum
,
relnum
);
#else
sprintf
(
lib_version
,
"Unknow version"
);
sprintf
(
version
,
"Unknow version"
);
#endif
return
version
;
}
const
char
*
metis_version
(
void
)
{
static
char
version
[
256
]
=
{
0
};
#if defined(WITH_MPI) && defined(HAVE_METIS)
sprintf
(
version
,
"%i.%i.%i"
,
METIS_VER_MAJOR
,
METIS_VER_MINOR
,
METIS_VER_SUBMINOR
);
#else
sprintf
(
version
,
"Unknow version"
);
#endif
return
version
;
}
...
...
@@ -187,11 +200,14 @@ void greetings(void) {
printf
(
" Revision: %s, Branch: %s
\n
"
,
git_revision
(),
git_branch
());
printf
(
" Webpage : www.swiftsim.com
\n\n
"
);
printf
(
" Compiler: %s, Version: %s
\n
"
,
compiler_name
(),
compiler_version
());
#ifdef HAVE_HDF5
printf
(
" HDF5 library version: %s
\n
"
,
hdf5_version
());
#endif
#ifdef WITH_MPI
printf
(
" MPI library: %s
\n
"
,
mpi_version
());
#ifdef HAVE_METIS
printf
(
" METIS library: %s
\n
"
,
metis_version
());
#endif
#ifdef HAVE_HDF5
printf
(
" HDF5 library version: %s
\n
"
,
hdf5_version
());
#endif
printf
(
"
\n
"
);
}
This diff is collapsed.
Click to expand it.
src/version.h.in
+
1
−
0
View file @
2779137b
...
...
@@ -37,6 +37,7 @@ const char* compiler_name(void);
const char* compiler_version(void);
const char* mpi_version(void);
const char *hdf5_version(void);
const char *metis_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