helloworld.cpp
Go to the documentation of this file.
1 #include <ttg.h>
2 
3 using namespace ttg;
4 
5  int main(int argc, char *argv[]) {
6  ttg::initialize(argc, argv);
7 
8  auto tt = ttg::make_tt([]() { std::cout << "Hello, World!\n"; });
9 
11  ttg::execute();
12  if (ttg::get_default_world().rank() == 0) tt->invoke();
13  ttg::fence();
14 
15  ttg::finalize();
16  return 0;
17 }
int main(int argc, char *argv[])
Definition: helloworld.cpp:5
auto make_tt(funcT &&func, const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &inedges=std::tuple<>{}, const std::tuple< output_edgesT... > &outedges=std::tuple<>{}, const std::string &name="wrapper", const std::vector< std::string > &innames=std::vector< std::string >(sizeof...(input_edge_valuesT), "input"), const std::vector< std::string > &outnames=std::vector< std::string >(sizeof...(output_edgesT), "output"))
Factory function to assist in wrapping a callable with signature.
Definition: make_tt.h:560
top-level TTG namespace contains runtime-neutral functionality
Definition: keymap.h:8
void execute(ttg::World world)
Starts the execution in the given execution context.
Definition: run.h:74
void initialize(int argc, char **argv, int num_threads=-1, RestOfArgs &&...)
std::enable_if_t<(std::is_convertible_v< decltype(*(std::declval< TTBasePtrs >))), TTBase & > bool make_graph_executable(TTBasePtrs &&...tts)
Definition: func.h:80
void fence(ttg::World world)
Returns when all tasks associated with the given execution context have finished on all ranks.
Definition: run.h:81
int rank(World world=default_execution_context())
Definition: run.h:85
std::enable_if_t<!meta::is_void_v< keyT >, void > finalize(const keyT &key, ttg::Out< out_keyT, out_valueT > &t)
Finalize streaming input terminals connecting to the given output terminal for tasks identified by ke...
Definition: func.h:545
ttg::World & get_default_world()
Definition: world.h:80