Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SIONfwd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cstao-public
SIONlib
SIONfwd
Commits
d7aaa141
Commit
d7aaa141
authored
Feb 6, 2021
by
Benedikt Steinbusch
Browse files
Options
Downloads
Patches
Plain Diff
replace boost::variant by std::variant
parent
2d74cab8
No related branches found
No related tags found
No related merge requests found
Pipeline
#59258
passed
Feb 8, 2021
Stage: test
Changes
5
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
CMakeLists.txt
+0
-2
0 additions, 2 deletions
CMakeLists.txt
README.md
+0
-1
0 additions, 1 deletion
README.md
cmake/SIONfwdConfig.cmake
+0
-1
0 additions, 1 deletion
cmake/SIONfwdConfig.cmake
src/server.cxx
+5
-11
5 additions, 11 deletions
src/server.cxx
with
6 additions
and
15 deletions
CHANGELOG.md
+
1
−
0
View file @
d7aaa141
...
...
@@ -9,6 +9,7 @@
### Changed
-
`boost::variant`
has been replaced by
`std::variant`
and Boost is no longer needed as a dependency
-
If no explicit choice is made via
`CMAKE_POSITION_INDEPENDENT_CODE`
, the client library defaults to being built as position independent code
[
Unreleased
]:
https://gitlab.version.fz-juelich.de/SIONlib/SIONfwd/-/compare/v1.0.0...main
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
0
−
2
View file @
d7aaa141
...
...
@@ -18,7 +18,6 @@ set(CMAKE_C_STANDARD 99)
set
(
CMAKE_C_STANDARD_REQUIRED TRUE
)
set
(
CMAKE_C_EXTENSIONS FALSE
)
find_package
(
Boost 1.69 REQUIRED
)
find_package
(
MPI 3.0 REQUIRED
)
find_program
(
CLANG_TIDY_EXE NAMES
"clang-tidy"
DOC
"Path to clang-tidy executable"
)
...
...
@@ -49,7 +48,6 @@ if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
endif
()
add_executable
(
sionfwd-server src/server.cxx
)
target_link_libraries
(
sionfwd-server PRIVATE Boost::boost
)
target_link_libraries
(
sionfwd-server PRIVATE MPI::MPI_CXX
)
add_executable
(
sionfwd-test-client src/test-client.c
)
...
...
This diff is collapsed.
Click to expand it.
README.md
+
0
−
1
View file @
d7aaa141
...
...
@@ -9,7 +9,6 @@ It contains a C++ server and a C client library.
-
C++ compiler with support for C++17
-
CMake 3.12 or newer
-
MPI 3.0 or newer
-
Boost 1.69 or newer
## Installation
...
...
This diff is collapsed.
Click to expand it.
cmake/SIONfwdConfig.cmake
+
0
−
1
View file @
d7aaa141
include
(
CMakeFindDependencyMacro
)
find_dependency
(
MPI 3.0
)
find_dependency
(
Boost 1.69
)
include
(
"
${
CMAKE_CURRENT_LIST_DIR
}
/SIONfwdTargets.cmake"
)
This diff is collapsed.
Click to expand it.
src/server.cxx
+
5
−
11
View file @
d7aaa141
...
...
@@ -11,10 +11,9 @@
#include
<sys/types.h>
#include
<sys/uio.h>
#include
<unistd.h>
#include
<variant>
#include
<vector>
#include
<boost/variant.hpp>
#include
<mpi.h>
static
bool
debug
=
false
;
...
...
@@ -214,7 +213,7 @@ private:
struct
Unknown
{};
using
Message
=
boo
st
::
variant
<
using
Message
=
st
d
::
variant
<
Shutdown
,
Hello
,
Disconnect
,
...
...
@@ -228,11 +227,6 @@ using Message = boost::variant<
Unknown
>
;
template
<
typename
T
,
typename
...
Us
>
bool
holds_alternative
(
const
boost
::
variant
<
Us
...
>&
v
)
{
return
boost
::
get
<
T
>
(
&
v
)
!=
nullptr
;
}
struct
Communicator
{
explicit
Communicator
(
MPI_Comm
comm
)
noexcept
:
comm_
{
comm
}
{}
...
...
@@ -460,7 +454,7 @@ struct CommunicatorReceiver {
bool
go_on
;
do
{
Message
message
{
communicator_
.
receive
()};
go_on
=
boo
st
::
apply_
visit
or
(
MessageVisitor
{
communicator_
},
std
::
move
(
message
));
go_on
=
st
d
::
visit
(
MessageVisitor
{
communicator_
},
std
::
move
(
message
));
}
while
(
go_on
);
}
...
...
@@ -521,8 +515,8 @@ struct PortAcceptor {
}
Communicator
client
{
port_
.
accept
()};
Message
message
{
client
.
receive
()};
if
(
holds_alternative
<
Shutdown
>
(
message
))
{
break
;
}
if
(
!
holds_alternative
<
Hello
>
(
message
))
{
if
(
std
::
holds_alternative
<
Shutdown
>
(
message
))
{
break
;
}
if
(
!
std
::
holds_alternative
<
Hello
>
(
message
))
{
throw
std
::
runtime_error
{
"unexpected message type"
};
}
CommunicatorReceiver
{
std
::
move
(
client
)}();
...
...
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