Skip to content

Commit 9c1942b

Browse files
committed
Merge branch 'potrf-composition2' of github.com:therault/ttg into potrf-composition2
2 parents 645f932 + db27cc6 commit 9c1942b

38 files changed

Lines changed: 1648 additions & 603 deletions

.github/workflows/cmake.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
CCACHE_DIR : ${{github.workspace}}/build/.ccache
2727
CCACHE_COMPRESS : true
2828
CCACHE_COMPRESSLEVEL : 6
29+
OMPI_MCA_btl_vader_single_copy_mechanism : none
30+
PARSEC_MCA_runtime_bind_threads : 0
2931
BUILD_CONFIG : >
3032
-G Ninja
3133
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
@@ -38,22 +40,30 @@ jobs:
3840
steps:
3941
- uses: actions/checkout@v2
4042

41-
- name: Create Build Environment
42-
# Some projects don't allow in-source building, so create a separate build directory
43-
# We'll use this as our working directory for all subsequent commands
44-
run: cmake -E make_directory ${{github.workspace}}/build
45-
4643
- name: Install prerequisite MacOS packages
4744
if: ${{ matrix.os == 'macos-latest' }}
4845
run: brew install ninja gcc@10 boost eigen open-mpi bison ccache
4946

5047
- name: Install prerequisites Ubuntu packages
5148
if: ${{ matrix.os == 'ubuntu-20.04' }}
5249
run: |
50+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
51+
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
5352
sudo apt-get update
54-
sudo apt-get install ninja-build g++-9 liblapack-dev libboost-dev libboost-serialization-dev libeigen3-dev openmpi-bin libopenmpi-dev libtbb-dev ccache
53+
sudo apt-get -y install ninja-build g++-9 liblapack-dev libboost-dev libboost-serialization-dev libeigen3-dev openmpi-bin libopenmpi-dev libtbb-dev ccache flex bison cmake
54+
55+
- name: Create Build Environment
56+
# Some projects don't allow in-source building, so create a separate build directory
57+
# We'll use this as our working directory for all subsequent commands
58+
run: |
59+
cmake -E make_directory ${{github.workspace}}/build
60+
61+
62+
- name: Install doxygen for Release test
63+
if: ${{ matrix.os == 'ubuntu-20.04' }}
64+
run: |
5565
if [ "${{matrix.build_type}}" = "Release" ]; then
56-
sudo apt-get install libclang1-9 libclang-cpp9 graphviz fonts-liberation
66+
sudo apt-get -y install libclang1-9 libclang-cpp9 graphviz fonts-liberation
5767
cd ${{github.workspace}}/build
5868
wget https://downloads.sourceforge.net/project/doxygen/rel-${DOXYGEN_VERSION}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz
5969
# using EFV's gdrive mirror of 1.9.2 to work around the unreliable sourceforge

cmake/modules/AddTTGLibrary.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ macro(add_ttg_library)
4949

5050
target_include_directories(${_library} PUBLIC
5151
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
52+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> # look in binary dir also for files preprocessed by configure_file
5253
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
5354
)
5455

cmake/modules/ExternalDependenciesVersions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ set(TTG_TRACKED_BOOST_VERSION 1.66)
66
set(TTG_TRACKED_CATCH2_VERSION 2.13.1)
77
set(TTG_TRACKED_CEREAL_VERSION 1.3.0)
88
set(TTG_TRACKED_MADNESS_TAG 851ef271858129c47a912a088cc833b085c382aa)
9-
set(TTG_TRACKED_PARSEC_TAG 423ad3476b0533a40b0bf14cb2c7f4dadda915c8)
9+
set(TTG_TRACKED_PARSEC_TAG f35ee04c3cb2d3a9d89713fab2e438b3fd871455)
1010
set(TTG_TRACKED_BTAS_TAG ab866a760b72ff23053266bf46b87f19d3df44b7)

cmake/modules/GetGitMetadata.cmake

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#
2+
# SPDX-FileCopyrightText: 2022 Eduard Valeyev <eduard@valeyev.net>
3+
#
4+
# SPDX-License-Identifier: BSD-2-Clause
5+
#
6+
7+
#
8+
# vgkit_cmake_git_revision() defines variable ${PROJECT_NAME_UPPER}_GIT_REVISION,
9+
# where ${PROJECT_NAME_UPPER} is the upper-case version of ${PROJECT_NAME}, to
10+
# the "long-form" GIT revision produced by `git rev-parse -q HEAD` command.
11+
# N.B. If the variable is already defined will print a warning message but not change the value of
12+
# ${PROJECT_NAME_UPPER}_GIT_REVISION
13+
#
14+
macro(vgkit_cmake_git_revision)
15+
string(TOUPPER "${PROJECT_NAME}_GIT_REVISION" vgkit_cmake_git_revision_result)
16+
if (DEFINED ${vgkit_cmake_git_revision_result})
17+
message(WARNING "vgkit_cmake_git_revision() called for project ${PROJECT_NAME} but the result variable ${vgkit_cmake_git_revision_result} already defined; will not change its value")
18+
else()
19+
if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
20+
find_package(Git REQUIRED)
21+
if (GIT_FOUND)
22+
execute_process(
23+
COMMAND ${GIT_EXECUTABLE} rev-parse -q HEAD
24+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
25+
RESULT_VARIABLE vgkit_cmake_git_revision_errcod
26+
OUTPUT_VARIABLE ${vgkit_cmake_git_revision_result}
27+
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
28+
if(NOT vgkit_cmake_git_revision_errcod EQUAL 0)
29+
set(${vgkit_cmake_git_revision_result} "unknown")
30+
endif()
31+
unset(vgkit_cmake_git_revision_errcod)
32+
else()
33+
set(${vgkit_cmake_git_revision_result} "unknown")
34+
endif()
35+
else()
36+
set(${vgkit_cmake_git_revision_result} "unknown")
37+
endif()
38+
endif()
39+
unset(vgkit_cmake_git_revision_result)
40+
endmacro()
41+
42+
#
43+
# vgkit_cmake_git_description() defines variable ${PROJECT_NAME_UPPER}_GIT_DESCRIPTION,
44+
# where ${PROJECT_NAME_UPPER} is the upper-case version of ${PROJECT_NAME}, to
45+
# the human-readable form produced by `git describe --dirty` command.
46+
# If the variable is already defined will print a warning message but not change the value of
47+
# ${PROJECT_NAME_UPPER}_GIT_DESCRIPTION
48+
#
49+
macro(vgkit_cmake_git_description)
50+
string(TOUPPER "${PROJECT_NAME}_GIT_DESCRIPTION" vgkit_cmake_git_description_result)
51+
if (DEFINED ${vgkit_cmake_git_description_result})
52+
message(WARNING "vgkit_cmake_git_description() called for project ${PROJECT_NAME} but the result variable ${vgkit_cmake_git_description_result} already defined; will not change its value")
53+
else()
54+
if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
55+
find_package(Git REQUIRED)
56+
if (GIT_FOUND)
57+
execute_process(
58+
COMMAND ${GIT_EXECUTABLE} describe --dirty
59+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
60+
RESULT_VARIABLE vgkit_cmake_git_description_errcod
61+
OUTPUT_VARIABLE ${vgkit_cmake_git_description_result}
62+
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
63+
if(NOT vgkit_cmake_git_description_errcod EQUAL 0)
64+
set(${vgkit_cmake_git_description_errcod} "unknown")
65+
endif()
66+
unset(vgkit_cmake_git_description_errcod)
67+
else()
68+
set(${vgkit_cmake_git_description_errcod} "unknown")
69+
endif()
70+
else()
71+
set(${vgkit_cmake_git_description_errcod} "unknown")
72+
endif()
73+
endif()
74+
unset(vgkit_cmake_git_description_errcod)
75+
endmacro()
76+
77+
#
78+
# vgkit_cmake_git_metadata() invokes vgkit_cmake_git_revision and vgkit_cmake_git_description
79+
#
80+
macro(vgkit_cmake_git_metadata)
81+
vgkit_cmake_git_revision()
82+
vgkit_cmake_git_description()
83+
endmacro()

doc/dox/user/examples/distributed.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <ttg.h>
22
#include <ttg/serialization/std/pair.h>
3+
#include <ttg/util/hash/std/pair.h>
34

45
const double threshold = 100.0;
56
using Key2 = std::pair<int, int>;
@@ -35,7 +36,7 @@ int main(int argc, char **argv) {
3536
ttg::Edge<int, double> C_A("C(k)->A(k)");
3637

3738
auto wc(ttg::make_tt(c, ttg::edges(B_C), ttg::edges(C_A), "C", {"From B"}, {"to A"}));
38-
39+
3940
/**! \link TT::set_input_reducer() */wc->set_input_reducer/**! \endlink */<0>([](double &a, const double &b) { a += b; });
4041

4142
auto wa(ttg::make_tt([&](const int &k, const double &input, std::tuple<ttg::Out<Key2, double>> &out) {
@@ -67,8 +68,8 @@ int main(int argc, char **argv) {
6768
/**
6869
* \example distributed.cc
6970
* This is the iterative diamond DAG with variable number of inputs using the reducing
70-
* terminals of Template Task Graph, adapted to run in distributed: iteratively, a reducing
71-
* diamond of data-dependent width is run, until the amount of data gathered at the bottom
71+
* terminals of Template Task Graph, adapted to run in distributed: iteratively, a reducing
72+
* diamond of data-dependent width is run, until the amount of data gathered at the bottom
7273
* of the diamond exceeds a given threshold. First and last tasks of each diamond are run
7374
* on rank 0, while the tasks inside the diamond are distributed between the ranks in a
7475
* round-robin fashion.

doc/dox/user/examples/iterative.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <ttg.h>
22
#include <ttg/serialization/std/pair.h>
3+
#include <ttg/util/hash/std/pair.h>
34

45
const double threshold = 100.0;
56
using Key2 = std::pair<int, int>;
@@ -13,26 +14,23 @@ namespace std {
1314

1415
static void a(const int &k, const double &input, std::tuple<ttg::Out<Key2, double>> &out) {
1516
ttg::print("Called task A(", k, ")");
16-
/**! \link ttg::send() */ ttg::send/**! \endlink */<0>(Key2{k, 0}, 1.0 + input, out);
17-
/**! \link ttg::send() */ ttg::send/**! \endlink */<0>(Key2{k, 1}, 2.0 + input, out);
17+
/**! \link ttg::send() */ ttg::send /**! \endlink */<0>(Key2{k, 0}, 1.0 + input, out);
18+
/**! \link ttg::send() */ ttg::send /**! \endlink */<0>(Key2{k, 1}, 2.0 + input, out);
1819
}
1920

2021
static void b(const Key2 &key, const double &input, std::tuple<ttg::Out<int, double>, ttg::Out<int, double>> &out) {
2122
ttg::print("Called task B(", key, ") with input data ", input);
2223
if (std::get<1>(key) == 0)
23-
/**! \link ttg::send() */
24-
ttg::send/**! \endlink */<0>(std::get<0>(key), input + 1.0, out);
24+
/**! \link ttg::send() */ ttg::send /**! \endlink */<0>(std::get<0>(key), input + 1.0, out);
2525
else
26-
/**! \link ttg::send() */
27-
ttg::send/**! \endlink */<1>(std::get<0>(key), input + 1.0, out);
26+
/**! \link ttg::send() */ ttg::send /**! \endlink */<1>(std::get<0>(key), input + 1.0, out);
2827
}
2928

3029
static void c(const int &k, const double &b0, const double &b1, std::tuple<ttg::Out<int, double>> &out) {
3130
ttg::print("Called task C(", k, ") with inputs ", b0, " from B(", k, " 0) and ", b1, " from B(", k, " 1)");
3231
if (b0 + b1 < threshold) {
3332
ttg::print(" ", b0, "+", b1, "<", threshold, " so continuing to iterate");
34-
/**! \link ttg::send() */
35-
ttg::send/**! \endlink */<0>(k + 1, b0 + b1, out);
33+
/**! \link ttg::send() */ ttg::send /**! \endlink */<0>(k + 1, b0 + b1, out);
3634
} else {
3735
ttg::print(" ", b0, "+", b1, ">=", threshold, " so stopping the iterations");
3836
}
@@ -47,7 +45,8 @@ int main(int argc, char **argv) {
4745
ttg::Edge<int, double> C_A("C(k)->A(k)");
4846

4947
auto wa(ttg::make_tt(a, ttg::edges(C_A), ttg::edges(A_B), "A", {"from C"}, {"to B"}));
50-
auto wb(ttg::make_tt(b, ttg::edges(A_B), ttg::edges(B_C0, B_C1), "B", {"from A"}, {"to 1st input of C", "to 2nd input of C"}));
48+
auto wb(ttg::make_tt(b, ttg::edges(A_B), ttg::edges(B_C0, B_C1), "B", {"from A"},
49+
{"to 1st input of C", "to 2nd input of C"}));
5150
auto wc(ttg::make_tt(c, ttg::edges(B_C0, B_C1), ttg::edges(C_A), "C", {"From B", "From B"}, {"to A"}));
5251

5352
ttg::make_graph_executable(wa);

doc/dox/user/examples/reducing.cc

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <ttg.h>
22
#include <ttg/serialization/std/pair.h>
3+
#include <ttg/util/hash/std/pair.h>
34

45
const double threshold = 100.0;
56
using Key2 = std::pair<int, int>;
@@ -13,15 +14,14 @@ namespace std {
1314

1415
static void b(const Key2 &key, const double &input, std::tuple<ttg::Out<int, double>> &out) {
1516
ttg::print("Called task B(", key, ") with input data ", input);
16-
/**! \link ttg::send() */ ttg::send/**! \endlink */<0>(std::get<0>(key), input + 1.0, out);
17+
/**! \link ttg::send() */ ttg::send /**! \endlink */<0>(std::get<0>(key), input + 1.0, out);
1718
}
1819

1920
static void c(const int &k, const double &sum, std::tuple<ttg::Out<int, double>> &out) {
2021
ttg::print("Called task C(", k, ") with input ", sum);
2122
if (sum < threshold) {
2223
ttg::print(" ", sum, "<", threshold, " so continuing to iterate");
23-
/**! \link ttg::send() */
24-
ttg::send/**! \endlink */<0>(k + 1, sum, out);
24+
/**! \link ttg::send() */ ttg::send /**! \endlink */<0>(k + 1, sum, out);
2525
} else {
2626
ttg::print(" ", sum, ">=", threshold, " so stopping the iterations");
2727
}
@@ -35,17 +35,20 @@ int main(int argc, char **argv) {
3535
ttg::Edge<int, double> C_A("C(k)->A(k)");
3636

3737
auto wc(ttg::make_tt(c, ttg::edges(B_C), ttg::edges(C_A), "C", {"From B"}, {"to A"}));
38-
39-
/**! \link TT::set_input_reducer() */wc->set_input_reducer/**! \endlink */<0>([](double &a, const double &b) { a += b; });
4038

41-
auto wa(ttg::make_tt([&](const int &k, const double &input, std::tuple<ttg::Out<Key2, double>> &out) {
42-
ttg::print("Called task A(", k, ")");
43-
wc->set_argstream_size<0>(k, k+1);
44-
for(int i = 0; i < k+1; i++) {
45-
/**! \link ttg::send() */
46-
ttg::send/**! \endlink */<0>(Key2{k, i}, 1.0 + k + input, out);
47-
}
48-
}, ttg::edges(C_A), ttg::edges(A_B), "A", {"from C"}, {"to B"}));
39+
/**! \link TT::set_input_reducer() */ wc->set_input_reducer /**! \endlink */<0>(
40+
[](double &a, const double &b) { a += b; });
41+
42+
auto wa(ttg::make_tt(
43+
[&](const int &k, const double &input, std::tuple<ttg::Out<Key2, double>> &out) {
44+
ttg::print("Called task A(", k, ")");
45+
wc->set_argstream_size<0>(k, k + 1);
46+
for (int i = 0; i < k + 1; i++) {
47+
/**! \link ttg::send() */
48+
ttg::send /**! \endlink */<0>(Key2{k, i}, 1.0 + k + input, out);
49+
}
50+
},
51+
ttg::edges(C_A), ttg::edges(A_B), "A", {"from C"}, {"to B"}));
4952

5053
auto wb(ttg::make_tt(b, ttg::edges(A_B), ttg::edges(B_C), "B", {"from A"}, {"to C"}));
5154

@@ -64,6 +67,6 @@ int main(int argc, char **argv) {
6467
* \example reducing.cc
6568
* This is the iterative diamond DAG with variable number of inputs using the reducing
6669
* terminals of Template Task Graph: iteratively, a reducing diamond of data-dependent
67-
* width is run, until the amount of data gathered at the bottom of the diamond exceeds
70+
* width is run, until the amount of data gathered at the bottom of the diamond exceeds
6871
* a given threshold.
6972
*/

examples/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ endif (TARGET MADworld)
2727
add_ttg_executable(wavefront-wf wavefront/wavefront-wf.cc SINGLERANKONLY)
2828
add_ttg_executable(wavefront-wf2 wavefront/wavefront-wf2.cc SINGLERANKONLY)
2929
add_ttg_executable(wavefront-df wavefront/wavefront-df.cc)
30+
add_ttg_executable(wavefront-pull wavefront/wavefront-pull.cc LINK_LIBRARIES MADworld)
3031
add_ttg_executable(fw-apsp floyd-warshall/floyd_warshall.cc LINK_LIBRARIES MADworld SINGLERANKONLY)
31-
3232
add_ttg_executable(helloworld helloworld/helloworld.cpp)
33+
add_ttg_executable(simplegenerator simplegenerator/simplegenerator.cc RUNTIMES "mad")
3334

3435
if(TARGET DPLASMA::dplasma)
3536
add_ttg_executable(testing_dpotrf potrf/testing_dpotrf.cc LINK_LIBRARIES lapackpp DPLASMA::dplasma MADworld)

examples/floyd-warshall/floyd_warshall.cc

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ using namespace ttg;
2323

2424
#include "ttg/serialization.h"
2525
#include "ttg/serialization/std/pair.h"
26+
#include "ttg/util/hash/std/pair.h"
2627

2728
struct Key {
2829
// ((I, J), K) where (I, J) is the tile coordinate and K is the iteration number
@@ -81,8 +82,8 @@ namespace std {
8182
};
8283
} // namespace std
8384

84-
class Initiator : public TT<int, std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>>,
85-
Initiator> {
85+
class Initiator
86+
: public TT<int, std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>>, Initiator> {
8687
using baseT = typename Initiator::ttT;
8788

8889
public:
@@ -112,10 +113,11 @@ class Initiator : public TT<int, std::tuple<Out<Key, void>, Out<Key, void>, Out<
112113
}
113114
};
114115

115-
class FuncA : public TT<Key,
116-
std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>,
117-
Out<Key, void>, Out<Key, void>>,
118-
FuncA, ttg::typelist<void>> {
116+
class FuncA
117+
: public TT<
118+
Key,
119+
std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>>,
120+
FuncA, ttg::typelist<void>> {
119121
using baseT = typename FuncA::ttT;
120122
double* adjacency_matrix_ttg;
121123
int problem_size;
@@ -204,11 +206,8 @@ class FuncA : public TT<Key,
204206
}
205207
};
206208

207-
class FuncB
208-
: public TT<
209-
Key,
210-
std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>>,
211-
FuncB, ttg::typelist<void, void>> {
209+
class FuncB : public TT<Key, std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>>,
210+
FuncB, ttg::typelist<void, void>> {
212211
using baseT = typename FuncB::ttT;
213212
double* adjacency_matrix_ttg;
214213
int problem_size;
@@ -295,11 +294,8 @@ class FuncB
295294
}
296295
};
297296

298-
class FuncC
299-
: public TT<
300-
Key,
301-
std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>>,
302-
FuncC, ttg::typelist<void, void>> {
297+
class FuncC : public TT<Key, std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>>,
298+
FuncC, ttg::typelist<void, void>> {
303299
using baseT = typename FuncC::ttT;
304300
double* adjacency_matrix_ttg;
305301
int problem_size;
@@ -386,8 +382,8 @@ class FuncC
386382
}
387383
};
388384

389-
class FuncD : public TT<Key, std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>>,
390-
FuncD, ttg::typelist<void, void, void>> {
385+
class FuncD : public TT<Key, std::tuple<Out<Key, void>, Out<Key, void>, Out<Key, void>, Out<Key, void>>, FuncD,
386+
ttg::typelist<void, void, void>> {
391387
using baseT = typename FuncD::ttT;
392388
double* adjacency_matrix_ttg;
393389
int problem_size;

examples/floyd-warshall/floyd_warshall_df.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ using namespace ttg;
2323

2424
#include "ttg/serialization.h"
2525
#include "ttg/serialization/std/pair.h"
26+
#include "ttg/util/hash/std/pair.h"
2627

2728
#include "../blockmatrix.h"
2829
#include "ttg/util/bug.h"

0 commit comments

Comments
 (0)