ttg 1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
helloworld.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2#include <ttg.h>
3
4using namespace ttg;
5
6 int main(int argc, char *argv[]) {
7 ttg::initialize(argc, argv);
8
9 auto tt = ttg::make_tt([]() { std::cout << "Hello, World!\n"; });
10
13 if (ttg::get_default_world().rank() == 0) tt->invoke();
14 ttg::fence();
15
17 return 0;
18}
int main(int argc, char *argv[])
Definition helloworld.cpp:6
top-level TTG namespace contains runtime-neutral functionality
Definition keymap.h:9
void execute(ttg::World world)
Starts the execution in the given execution context.
Definition run.h:116
void initialize(int argc, char **argv, int num_threads=-1, RestOfArgs &&...)
ttg::World & get_default_world()
Definition world.h:81
void fence(ttg::World world)
Returns when all tasks associated with the given execution context have finished on all ranks.
Definition run.h:123
void finalize()
Finalizes the TTG runtime.
Definition func.h:590
int rank(World world=default_execution_context())
Definition run.h:127
std::enable_if_t<(std::is_convertible_v< decltype(*(std::declval< TTBasePtrs >())), TTBase & > &&...), bool > make_graph_executable(TTBasePtrs &&...tts)
Make the TTG tts executable. Applies.
Definition func.h:81