Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
19a9d0d2
Commit
19a9d0d2
authored
Mar 22, 2016
by
Marian Triebe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add replication submodule
parent
813fed9b
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
2 deletions
+65
-2
CMakeLists.txt
CMakeLists.txt
+18
-1
configure
configure
+4
-0
examples/caf-application.ini
examples/caf-application.ini
+5
-0
libcaf_core/caf/actor_factory.hpp
libcaf_core/caf/actor_factory.hpp
+1
-1
libcaf_core/caf/actor_system.hpp
libcaf_core/caf/actor_system.hpp
+9
-0
libcaf_core/caf/actor_system_config.hpp
libcaf_core/caf/actor_system_config.hpp
+4
-0
libcaf_core/caf/fwd.hpp
libcaf_core/caf/fwd.hpp
+8
-0
libcaf_core/src/actor_system.cpp
libcaf_core/src/actor_system.cpp
+13
-0
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+3
-0
No files found.
CMakeLists.txt
View file @
19a9d0d2
...
@@ -379,7 +379,11 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libcaf_opencl/CMakeLists.txt")
...
@@ -379,7 +379,11 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libcaf_opencl/CMakeLists.txt")
install
(
DIRECTORY libcaf_opencl/caf/ DESTINATION include/caf
install
(
DIRECTORY libcaf_opencl/caf/ DESTINATION include/caf
FILES_MATCHING PATTERN
"*.hpp"
)
FILES_MATCHING PATTERN
"*.hpp"
)
endif
()
endif
()
#install includes from crdt
if
(
EXISTS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/libcaf_crdt/CMakeLists.txt"
)
install
(
DIRECTORY libcaf_crdt/caf/ DESTINATION include/caf
FILES_MATCHING PATTERN
"*.hpp"
)
endif
()
# process cmake_uninstall.cmake.in
# process cmake_uninstall.cmake.in
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/cmake_uninstall.cmake.in"
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/cmake_uninstall.cmake.in"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cmake_uninstall.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cmake_uninstall.cmake"
...
@@ -404,6 +408,11 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libcaf_opencl/CMakeLists.txt")
...
@@ -404,6 +408,11 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libcaf_opencl/CMakeLists.txt")
set
(
LIBCAF_INCLUDE_DIRS
set
(
LIBCAF_INCLUDE_DIRS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/libcaf_opencl/"
"
${
LIBCAF_INCLUDE_DIRS
}
"
)
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/libcaf_opencl/"
"
${
LIBCAF_INCLUDE_DIRS
}
"
)
endif
()
endif
()
# path to caf crdt headers
if
(
EXISTS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/libcaf_crdt/CMakeLists.txt"
)
set
(
LIBCAF_INCLUDE_DIRS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/libcaf_crdt/"
"
${
LIBCAF_INCLUDE_DIRS
}
"
)
endif
()
# enable tests if not disabled
# enable tests if not disabled
if
(
NOT CAF_NO_UNIT_TESTS
)
if
(
NOT CAF_NO_UNIT_TESTS
)
enable_testing
()
enable_testing
()
...
@@ -496,6 +505,12 @@ if(NOT CAF_NO_OPENCL)
...
@@ -496,6 +505,12 @@ if(NOT CAF_NO_OPENCL)
endif
()
endif
()
endif
()
endif
()
# build crdt library if not told otherwise
if
(
NOT CAF_NO_CRDT
)
add_optional_caf_lib
(
crdt
)
add_optional_caf_binaries
(
libcaf_crdt/examples
)
endif
()
# build Python binding if not being told otherwise
# build Python binding if not being told otherwise
if
(
NOT CAF_NO_PYTHON AND EXISTS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/libcaf_python/CMakeLists.txt"
)
if
(
NOT CAF_NO_PYTHON AND EXISTS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/libcaf_python/CMakeLists.txt"
)
add_subdirectory
(
libcaf_python
)
add_subdirectory
(
libcaf_python
)
...
@@ -675,6 +690,7 @@ invertYesNo(CAF_NO_EXCEPTIONS CAF_BUILD_WITH_EXCEPTIONS)
...
@@ -675,6 +690,7 @@ invertYesNo(CAF_NO_EXCEPTIONS CAF_BUILD_WITH_EXCEPTIONS)
invertYesNo
(
CAF_NO_MEM_MANAGEMENT CAF_BUILD_MEM_MANAGEMENT
)
invertYesNo
(
CAF_NO_MEM_MANAGEMENT CAF_BUILD_MEM_MANAGEMENT
)
invertYesNo
(
CAF_NO_BENCHMARKS CAF_BUILD_BENCHMARKS
)
invertYesNo
(
CAF_NO_BENCHMARKS CAF_BUILD_BENCHMARKS
)
invertYesNo
(
CAF_NO_OPENCL CAF_BUILD_OPENCL
)
invertYesNo
(
CAF_NO_OPENCL CAF_BUILD_OPENCL
)
invertYesNo
(
CAF_NO_CRDT CAF_BUILD_CRDT
)
invertYesNo
(
CAF_NO_PYTHON CAF_BUILD_PYTHON
)
invertYesNo
(
CAF_NO_PYTHON CAF_BUILD_PYTHON
)
# collect all compiler flags
# collect all compiler flags
string
(
TOUPPER
"
${
CMAKE_BUILD_TYPE
}
"
UPPER_BUILD_TYPE
)
string
(
TOUPPER
"
${
CMAKE_BUILD_TYPE
}
"
UPPER_BUILD_TYPE
)
...
@@ -701,6 +717,7 @@ if(NOT CAF_NO_SUMMARY)
...
@@ -701,6 +717,7 @@ if(NOT CAF_NO_SUMMARY)
"
\n
Build benchmarks:
${
CAF_BUILD_BENCHMARKS
}
"
"
\n
Build benchmarks:
${
CAF_BUILD_BENCHMARKS
}
"
"
\n
Build opencl:
${
CAF_BUILD_OPENCL
}
"
"
\n
Build opencl:
${
CAF_BUILD_OPENCL
}
"
"
\n
Build Python:
${
CAF_BUILD_PYTHON
}
"
"
\n
Build Python:
${
CAF_BUILD_PYTHON
}
"
"
\n
Build CRDT:
${
CAF_BUILD_CRDT
}
"
"
\n
"
"
\n
"
"
\n
CXX:
${
CMAKE_CXX_COMPILER
}
"
"
\n
CXX:
${
CMAKE_CXX_COMPILER
}
"
"
\n
CXXFLAGS:
${
ALL_CXX_FLAGS
}
"
"
\n
CXXFLAGS:
${
ALL_CXX_FLAGS
}
"
...
...
configure
View file @
19a9d0d2
...
@@ -65,6 +65,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
...
@@ -65,6 +65,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--no-curl-examples build without libcurl examples
--no-curl-examples build without libcurl examples
--no-unit-tests build without unit tests
--no-unit-tests build without unit tests
--no-opencl build without OpenCL module
--no-opencl build without OpenCL module
--no-crdt build without CRDT module
--no-benchmarks build without benchmarks
--no-benchmarks build without benchmarks
--no-tools build without CAF tools such as caf-run
--no-tools build without CAF tools such as caf-run
--no-io build without I/O module
--no-io build without I/O module
...
@@ -335,6 +336,9 @@ while [ $# -ne 0 ]; do
...
@@ -335,6 +336,9 @@ while [ $# -ne 0 ]; do
--no-opencl
)
--no-opencl
)
append_cache_entry CAF_NO_OPENCL BOOL
yes
append_cache_entry CAF_NO_OPENCL BOOL
yes
;;
;;
--no-crdt
)
append_cache_entry CAF_NO_CRDT BOOL
yes
;;
--build-static
)
--build-static
)
append_cache_entry CAF_BUILD_STATIC BOOL
yes
append_cache_entry CAF_BUILD_STATIC BOOL
yes
;;
;;
...
...
examples/caf-application.ini
View file @
19a9d0d2
...
@@ -46,3 +46,8 @@ max-consecutive-reads=50
...
@@ -46,3 +46,8 @@ max-consecutive-reads=50
; heartbeat message interval in ms (0 disables heartbeating)
; heartbeat message interval in ms (0 disables heartbeating)
heartbeat-interval
=
0
heartbeat-interval
=
0
; when loading replication::replicator
[replicator]
; connect to other nodes on init, format is host:port, seperate nodes with ','
nodes
=
"127.0.0.1:1337"
port
=
1337
libcaf_core/caf/actor_factory.hpp
View file @
19a9d0d2
...
@@ -175,7 +175,7 @@ struct dyn_spawn_class_helper {
...
@@ -175,7 +175,7 @@ struct dyn_spawn_class_helper {
actor_config
&
cfg
;
actor_config
&
cfg
;
void
operator
()(
Ts
...
xs
)
{
void
operator
()(
Ts
...
xs
)
{
CAF_ASSERT
(
cfg
.
host
);
CAF_ASSERT
(
cfg
.
host
);
result
=
cfg
.
host
->
system
().
spawn_class
<
T
,
no_spawn_options
>
(
cfg
,
xs
...);
result
=
cfg
.
host
->
system
().
spawn_class
<
T
,
hidden
>
(
cfg
,
xs
...);
}
}
};
};
...
...
libcaf_core/caf/actor_system.hpp
View file @
19a9d0d2
...
@@ -138,6 +138,7 @@ public:
...
@@ -138,6 +138,7 @@ public:
scheduler
,
scheduler
,
middleman
,
middleman
,
opencl_manager
,
opencl_manager
,
replicator
,
num_ids
num_ids
};
};
...
@@ -267,6 +268,13 @@ public:
...
@@ -267,6 +268,13 @@ public:
/// Returns `true` if the opencl module is available, `false` otherwise.
/// Returns `true` if the opencl module is available, `false` otherwise.
bool
has_opencl_manager
()
const
;
bool
has_opencl_manager
()
const
;
/// Returns the replicator instance from replication module.
/// @throws `std::logic_error` if module is not loaded.
crdt
::
replicator
&
replicator
()
const
;
/// Returns `true` if the replication module is available, `false` otherwise.
bool
has_replicator
()
const
;
/// Returns a dummy execution unit that forwards
/// Returns a dummy execution unit that forwards
/// everything to the scheduler.
/// everything to the scheduler.
scoped_execution_unit
*
dummy_execution_unit
();
scoped_execution_unit
*
dummy_execution_unit
();
...
@@ -520,6 +528,7 @@ private:
...
@@ -520,6 +528,7 @@ private:
io
::
middleman
*
middleman_
;
io
::
middleman
*
middleman_
;
scoped_execution_unit
dummy_execution_unit_
;
scoped_execution_unit
dummy_execution_unit_
;
opencl
::
manager
*
opencl_manager_
;
opencl
::
manager
*
opencl_manager_
;
crdt
::
replicator
*
replicator_
;
bool
await_actors_before_shutdown_
;
bool
await_actors_before_shutdown_
;
strong_actor_ptr
config_serv_
;
strong_actor_ptr
config_serv_
;
strong_actor_ptr
spawn_serv_
;
strong_actor_ptr
spawn_serv_
;
...
...
libcaf_core/caf/actor_system_config.hpp
View file @
19a9d0d2
...
@@ -271,6 +271,10 @@ public:
...
@@ -271,6 +271,10 @@ public:
std
::
string
opencl_device_ids
;
std
::
string
opencl_device_ids
;
// -- config parameters of the replication module ----------------------------
std
::
string
replication_hosts
;
// -- factories --------------------------------------------------------------
// -- factories --------------------------------------------------------------
value_factory_string_map
value_factories_by_name
;
value_factory_string_map
value_factories_by_name
;
...
...
libcaf_core/caf/fwd.hpp
View file @
19a9d0d2
...
@@ -138,6 +138,14 @@ class manager;
...
@@ -138,6 +138,14 @@ class manager;
}
// namespace opencl
}
// namespace opencl
// -- Replication classes ------------------------------------------------------
namespace
crdt
{
class
replicator
;
}
// namespace crdt
// -- scheduler classes --------------------------------------------------------
// -- scheduler classes --------------------------------------------------------
namespace
scheduler
{
namespace
scheduler
{
...
...
libcaf_core/src/actor_system.cpp
View file @
19a9d0d2
...
@@ -205,6 +205,9 @@ actor_system::actor_system(actor_system_config& cfg)
...
@@ -205,6 +205,9 @@ actor_system::actor_system(actor_system_config& cfg)
auto
&
clptr
=
modules_
[
module
::
opencl_manager
];
auto
&
clptr
=
modules_
[
module
::
opencl_manager
];
if
(
clptr
)
if
(
clptr
)
opencl_manager_
=
reinterpret_cast
<
opencl
::
manager
*>
(
clptr
->
subtype_ptr
());
opencl_manager_
=
reinterpret_cast
<
opencl
::
manager
*>
(
clptr
->
subtype_ptr
());
auto
&
rptr
=
modules_
[
module
::
replicator
];
if
(
rptr
)
replicator_
=
reinterpret_cast
<
crdt
::
replicator
*>
(
rptr
->
subtype_ptr
());
auto
&
sched
=
modules_
[
module
::
scheduler
];
auto
&
sched
=
modules_
[
module
::
scheduler
];
using
test
=
scheduler
::
test_coordinator
;
using
test
=
scheduler
::
test_coordinator
;
using
share
=
scheduler
::
coordinator
<
policy
::
work_sharing
>
;
using
share
=
scheduler
::
coordinator
<
policy
::
work_sharing
>
;
...
@@ -357,6 +360,16 @@ opencl::manager& actor_system::opencl_manager() const {
...
@@ -357,6 +360,16 @@ opencl::manager& actor_system::opencl_manager() const {
return
*
opencl_manager_
;
return
*
opencl_manager_
;
}
}
bool
actor_system
::
has_replicator
()
const
{
return
replicator_
!=
nullptr
;
}
crdt
::
replicator
&
actor_system
::
replicator
()
const
{
if
(
!
replicator_
)
CAF_RAISE_ERROR
(
"cannot access replicator: module not loaded"
);
return
*
replicator_
;
}
scoped_execution_unit
*
actor_system
::
dummy_execution_unit
()
{
scoped_execution_unit
*
actor_system
::
dummy_execution_unit
()
{
return
&
dummy_execution_unit_
;
return
&
dummy_execution_unit_
;
}
}
...
...
libcaf_core/src/actor_system_config.cpp
View file @
19a9d0d2
...
@@ -154,6 +154,9 @@ actor_system_config::actor_system_config()
...
@@ -154,6 +154,9 @@ actor_system_config::actor_system_config()
opt_group
(
options_
,
"opencl"
)
opt_group
(
options_
,
"opencl"
)
.
add
(
opencl_device_ids
,
"device-ids"
,
.
add
(
opencl_device_ids
,
"device-ids"
,
"restricts which OpenCL devices are accessed by CAF"
);
"restricts which OpenCL devices are accessed by CAF"
);
opt_group
(
options_
,
"replication"
)
.
add
(
replication_hosts
,
"nodes"
,
"connects to other CAF nodes at init"
);
// add renderers for default error categories
// add renderers for default error categories
error_renderers
.
emplace
(
atom
(
"system"
),
render_sec
);
error_renderers
.
emplace
(
atom
(
"system"
),
render_sec
);
error_renderers
.
emplace
(
atom
(
"exit"
),
render_exit_reason
);
error_renderers
.
emplace
(
atom
(
"exit"
),
render_exit_reason
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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