Skip to content

Commit bda83b3

Browse files
committed
Squashed 'libs/EXTERNAL/libtatum/' changes from 7fc65f57e..4e4583163
4e4583163 Remove Cilk Plus support since it is no longer supported by new compilers git-subtree-dir: libs/EXTERNAL/libtatum git-subtree-split: 4e45831638996f9e63ef7cf8737aac03b755debe
1 parent f0f2a50 commit bda83b3

File tree

6 files changed

+13
-127
lines changed

6 files changed

+13
-127
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ matrix:
1414
- env: TESTS="basic mcnc20" TATUM_EXECUTION_ENGINE=tbb MATRIX_EVAL="CC=gcc-5 CXX=g++-5"
1515
addons: { apt: { packages: ["cmake", "g++-5", "libtbb-dev"], sources: ["ubuntu-toolchain-r-test"] } }
1616

17-
- env: TESTS="basic mcnc20" TATUM_EXECUTION_ENGINE=cilk MATRIX_EVAL="CC=gcc-5 CXX=g++-5"
18-
addons: { apt: { packages: ["cmake", "g++-5", "libtbb-dev"], sources: ["ubuntu-toolchain-r-test"] } }
19-
2017
#Simple testing for other compilers
2118
- env: TESTS="basic" TATUM_EXECUTION_ENGINE=auto MATRIX_EVAL="CC=gcc-8 CXX=g++-8"
2219
addons: { apt: { packages: ["cmake", "g++-8", "libtbb-dev"], sources: ["ubuntu-toolchain-r-test"] } }

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12)
33
project("tatum")
44

55
set(TATUM_EXECUTION_ENGINE "auto" CACHE STRING "Specify the framework for (potential) parallel execution")
6-
set_property(CACHE TATUM_EXECUTION_ENGINE PROPERTY STRINGS auto serial cilk tbb)
6+
set_property(CACHE TATUM_EXECUTION_ENGINE PROPERTY STRINGS auto serial tbb)
77

88
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
99

libtatum/CMakeLists.txt

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,8 @@ project("libtatum")
66
#Check for parallel execution framework support
77
#
88
#
9-
set(CILK_PLUS_SUPPORTED FALSE)
109
set(TBB_SUPPORTED FALSE)
1110

12-
# Determine if the compiler has Cilk Plus support
13-
# This is required for the analyzer to run in parallel mode
14-
# As of April 2015 the following compilers have full support
15-
# for Cilk Plus:
16-
# * GCC 5+ (Note: GCC 4.9 has only partial support, it does support the cilk_for keyword)
17-
# * Intel
18-
#
19-
# Note that Cilk Plus is considered deprecated as of GCC 7, and Intel 2018
20-
include(CheckCXXCompilerFlag)
21-
22-
set(CMAKE_REQUIRED_FLAGS "-fcilkplus -lcilkrts")
23-
#Check for cilk_for support, since some compilers like gcc 4.9
24-
#supports cilk but not cilk_for
25-
CHECK_CXX_SOURCE_COMPILES("#include <cilk/cilk.h>
26-
int main(int argc, char** argv) {
27-
int cnt = 0;
28-
cilk_for(int i = 0; i < 10; i++) {
29-
cnt++;
30-
}
31-
}" COMPILER_SUPPORTS_CILK_PLUS)
32-
33-
if (COMPILER_SUPPORTS_CILK_PLUS)
34-
set(CILK_PLUS_SUPPORTED TRUE)
35-
endif()
36-
3711
#Check for Thread Building Blocks support
3812
find_package(TBB)
3913

@@ -52,18 +26,12 @@ if (TATUM_EXECUTION_ENGINE STREQUAL "auto")
5226
#Pick the best supported execution engine
5327
if (TBB_SUPPORTED)
5428
set(TATUM_USE_EXECUTION_ENGINE "tbb")
55-
elseif (CILK_PLUS_SUPPORTED)
56-
set(TATUM_USE_EXECUTION_ENGINE "cilk")
5729
else()
5830
set(TATUM_USE_EXECUTION_ENGINE "serial")
5931
endif()
6032
else()
6133
#The user requested a specific execution engine
62-
if (TATUM_EXECUTION_ENGINE STREQUAL "cilk")
63-
if (NOT CILK_PLUS_SUPPORTED)
64-
message(FATAL_ERROR "Tatum: Requested execution engine '${TATUM_EXECUTION_ENGINE}' not found")
65-
endif()
66-
elseif (TATUM_EXECUTION_ENGINE STREQUAL "tbb")
34+
if (TATUM_EXECUTION_ENGINE STREQUAL "tbb")
6735
if (NOT TBB_SUPPORTED)
6836
message(FATAL_ERROR "Tatum: Requested execution engine '${TATUM_EXECUTION_ENGINE}' not found")
6937
endif()
@@ -103,25 +71,7 @@ set_target_properties(libtatum PROPERTIES PREFIX "") #Avoid extra 'lib' prefix
10371
target_include_directories(libtatum PUBLIC ${LIB_TATUM_INCLUDE_DIRS})
10472

10573
#Setup parallel execution
106-
if (TATUM_USE_EXECUTION_ENGINE STREQUAL "cilk")
107-
message(STATUS "Tatum: will support parallel execution using '${TATUM_USE_EXECUTION_ENGINE}'")
108-
109-
message(WARNING "Tatum: Cilk Plus support is deprecated and will be removed in the future")
110-
111-
#Compile with parallel support
112-
# Since we the analyzer's are C++ templates, clients must compile
113-
# with cilk to enable parallel analysis
114-
target_compile_options(libtatum PUBLIC "-fcilkplus")
115-
116-
target_compile_definitions(libtatum PUBLIC TATUM_USE_CILK)
117-
if (TBB_SUPPORTED)
118-
target_link_libraries(libtatum tbbmalloc_proxy) #Use the scalable memory allocator
119-
endif()
120-
121-
#Link to the cilk run-time
122-
target_link_libraries(libtatum cilkrts)
123-
124-
elseif (TATUM_USE_EXECUTION_ENGINE STREQUAL "tbb")
74+
if (TATUM_USE_EXECUTION_ENGINE STREQUAL "tbb")
12575
message(STATUS "Tatum: will support parallel execution using '${TATUM_USE_EXECUTION_ENGINE}'")
12676

12777
target_compile_definitions(libtatum PUBLIC TATUM_USE_TBB)

libtatum/tatum/graph_walkers/ParallelLevelizedWalker.hpp

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
#include "tatum/graph_visitors/GraphVisitor.hpp"
44
#include "tatum/TimingGraph.hpp"
55

6-
#ifdef TATUM_USE_CILK
7-
# include <cilk/cilk.h>
8-
# include <cilk/reducer_opadd.h>
9-
#endif
10-
116
#ifdef TATUM_USE_TBB
127
# include <tbb/parallel_for_each.h>
138
# include <tbb/combinable.h>
@@ -18,8 +13,8 @@ namespace tatum {
1813
/**
1914
* A parallel timing analyzer which traveres the timing graph in a levelized
2015
* manner. However nodes within each level are processed in parallel using
21-
* Cilk Plus. If Cilk Plus is not available it operates serially and is
22-
* equivalent to the SerialWalker
16+
* Thread Building Blocks (TBB). If TBB is not available it operates serially and is
17+
* equivalent to the SerialWalker.
2318
*/
2419
class ParallelLevelizedWalker : public TimingGraphWalker {
2520
public:
@@ -28,19 +23,7 @@ class ParallelLevelizedWalker : public TimingGraphWalker {
2823

2924
LevelId first_level = *tg.levels().begin();
3025
auto nodes = tg.level_nodes(first_level);
31-
#if defined(TATUM_USE_CILK)
32-
//Use reducer for thread-safe sum
33-
cilk::reducer<cilk::op_add<size_t>> unconstrained_reducer(0);
34-
35-
cilk_for(auto iter = nodes.begin(); iter != nodes.end(); ++iter) {
36-
bool constrained = visitor.do_arrival_pre_traverse_node(tg, tc, *iter);
37-
38-
if(!constrained) {
39-
*unconstrained_reducer += 1;
40-
}
41-
}
42-
num_unconstrained_startpoints_ = unconstrained_reducer.get_value();
43-
#elif defined(TATUM_USE_TBB)
26+
#if defined(TATUM_USE_TBB)
4427
tbb::combinable<size_t> unconstrained_counter(zero);
4528

4629
tbb::parallel_for_each(nodes.begin(), nodes.end(), [&](auto node) {
@@ -66,20 +49,7 @@ class ParallelLevelizedWalker : public TimingGraphWalker {
6649
void do_required_pre_traversal_impl(const TimingGraph& tg, const TimingConstraints& tc, GraphVisitor& visitor) override {
6750
num_unconstrained_endpoints_ = 0;
6851
const auto& po = tg.logical_outputs();
69-
#if defined(TATUM_USE_CILK)
70-
//Use reducer for thread-safe sum
71-
cilk::reducer<cilk::op_add<size_t>> unconstrained_reducer(0);
72-
73-
cilk_for(auto iter = po.begin(); iter != po.end(); ++iter) {
74-
bool constrained = visitor.do_required_pre_traverse_node(tg, tc, *iter);
75-
76-
if(!constrained) {
77-
*unconstrained_reducer += 1;
78-
}
79-
}
80-
81-
num_unconstrained_endpoints_ = unconstrained_reducer.get_value();
82-
#elif defined(TATUM_USE_TBB)
52+
#if defined(TATUM_USE_TBB)
8353
tbb::combinable<size_t> unconstrained_counter(zero);
8454

8555
tbb::parallel_for_each(po.begin(), po.end(), [&](auto node) {
@@ -106,11 +76,7 @@ class ParallelLevelizedWalker : public TimingGraphWalker {
10676
void do_arrival_traversal_impl(const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, GraphVisitor& visitor) override {
10777
for(LevelId level_id : tg.levels()) {
10878
auto level_nodes = tg.level_nodes(level_id);
109-
#if defined(TATUM_USE_CILK)
110-
cilk_for(auto iter = level_nodes.begin(); iter != level_nodes.end(); ++iter) {
111-
visitor.do_arrival_traverse_node(tg, tc, dc, *iter);
112-
}
113-
#elif defined(TATUM_USE_TBB)
79+
#if defined(TATUM_USE_TBB)
11480
tbb::parallel_for_each(level_nodes.begin(), level_nodes.end(), [&](auto node) {
11581
visitor.do_arrival_traverse_node(tg, tc, dc, node);
11682
});
@@ -125,11 +91,7 @@ class ParallelLevelizedWalker : public TimingGraphWalker {
12591
void do_required_traversal_impl(const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, GraphVisitor& visitor) override {
12692
for(LevelId level_id : tg.reversed_levels()) {
12793
auto level_nodes = tg.level_nodes(level_id);
128-
#if defined(TATUM_USE_CILK)
129-
cilk_for(auto iter = level_nodes.begin(); iter != level_nodes.end(); ++iter) {
130-
visitor.do_required_traverse_node(tg, tc, dc, *iter);
131-
}
132-
#elif defined(TATUM_USE_TBB)
94+
#if defined(TATUM_USE_TBB)
13395
tbb::parallel_for_each(level_nodes.begin(), level_nodes.end(), [&](auto node) {
13496
visitor.do_required_traverse_node(tg, tc, dc, node);
13597
});
@@ -143,11 +105,7 @@ class ParallelLevelizedWalker : public TimingGraphWalker {
143105

144106
void do_update_slack_impl(const TimingGraph& tg, const DelayCalculator& dc, GraphVisitor& visitor) override {
145107
auto nodes = tg.nodes();
146-
#if defined(TATUM_USE_CILK)
147-
cilk_for(auto iter = nodes.begin(); iter != nodes.end(); ++iter) {
148-
visitor.do_slack_traverse_node(tg, dc, *iter);
149-
}
150-
#elif defined(TATUM_USE_TBB)
108+
#if defined(TATUM_USE_TBB)
151109
tbb::parallel_for_each(nodes.begin(), nodes.end(), [&](auto node) {
152110
visitor.do_slack_traverse_node(tg, dc, node);
153111
});
@@ -161,14 +119,7 @@ class ParallelLevelizedWalker : public TimingGraphWalker {
161119
void do_reset_impl(const TimingGraph& tg, GraphVisitor& visitor) override {
162120
auto nodes = tg.nodes();
163121
auto edges = tg.edges();
164-
#if defined(TATUM_USE_CILK)
165-
cilk_for(auto node_iter = nodes.begin(); node_iter != nodes.end(); ++node_iter) {
166-
visitor.do_reset_node(*node_iter);
167-
}
168-
cilk_for(auto edge_iter = edges.begin(); edge_iter != edges.end(); ++edge_iter) {
169-
visitor.do_reset_edge(*edge_iter);
170-
}
171-
#elif defined(TATUM_USE_TBB)
122+
#if defined(TATUM_USE_TBB)
172123
tbb::parallel_for_each(nodes.begin(), nodes.end(), [&](auto node) {
173124
visitor.do_reset_node(node);
174125
});

libtatum/tatum/graph_walkers/ParallelWalker.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22

3-
//ParallelWalker is an alias for ParallelLevelizedCilkWalker
43
#include "tatum/graph_walkers_fwd.hpp"
54

65

tatum_test/main.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
#include "util.hpp"
3333
#include "profile.hpp"
3434

35-
#if defined(TATUM_USE_CILK)
36-
# include <cilk/cilk_api.h>
37-
#elif defined(TATUM_USE_TBB)
35+
#if defined(TATUM_USE_TBB)
3836
# include <tbb/task_scheduler_init.h>
3937
#endif
4038
typedef std::chrono::duration<double> dsec;
@@ -256,16 +254,7 @@ int main(int argc, char** argv) {
256254
cout << "NodeType class alignof = " << alignof(tatum::NodeType) << " bytes." << endl;
257255
}
258256

259-
#if defined(TATUM_USE_CILK)
260-
size_t actual_num_workers = args.num_workers;
261-
if (actual_num_workers == 0) {
262-
actual_num_workers = __cilkrts_get_nworkers();
263-
}
264-
if (__cilkrts_set_param("nworkers", std::to_string(actual_num_workers).c_str()) != 0) {
265-
exit(1);
266-
}
267-
cout << "Tatum executing with up to " << actual_num_workers << " workers via cilk\n";
268-
#elif defined(TATUM_USE_TBB)
257+
#if defined(TATUM_USE_TBB)
269258
size_t actual_num_workers = args.num_workers;
270259
if (actual_num_workers == 0) {
271260
actual_num_workers = tbb::task_scheduler_init::default_num_threads();

0 commit comments

Comments
 (0)