tsung-wei-huang / DtCraft

A High-performance Cluster Computing Engine
https://tsung-wei-huang.github.io/DtCraft/
MIT License
144 stars 25 forks source link
cluster-computing dataflow-programming distributed-systems event-driven-programming network-programming parallel-computing reactor stream-processing-engine streaming

What's DtCraft?

DtCraft is a general-purpose distributed programming system based on data-parallel streams. It offers a new powerful programming model called stream graph to build parallel and distributed workloads. Once an application is cast into this framework, the kernel transparently performs job distribution for you. You don't have to worry about system programming and can focus on high-level development!

Unified Framework Stream Graph

Whether you are application developers or domain-specific engineers, you can use DtCraft for:

To get your first DtCraft program up and running, visit QuickStart.

Design Goals

The goal of DtCraft is to help you write simple, easy, and effective code at cluster scale. The example below demonstrates a simple application to run two programs on two machines sending each other a message.

#include <dtc/dtc.hpp>

using namespace std::literals;  // for the use of string literal
using namespace dtc::literals;  // for the use of memory literal

int main(int argc, char* argv[]) {

  dtc::Graph G;

  auto A = G.vertex();
  auto B = G.vertex();

  auto lambda = [] (dtc::Vertex& v, dtc::InputStream& is) {
    if(std::string s; is(s) != -1) {
      std::cout << "Received: " << s << '\n';
      return dtc::Event::REMOVE;
    }
    return dtc::Event::DEFAULT;
  };

  auto AB = G.stream(A, B).on(lambda);
  auto BA = G.stream(B, A).on(lambda); 

  A.on([&AB] (dtc::Vertex& v) { (*v.ostream(AB))("hello world from A"s); });  
  B.on([&BA] (dtc::Vertex& v) { (*v.ostream(BA))("hello world from B"s); });

  G.container().add(A).cpu(1).memory(1_GB);
  G.container().add(B).cpu(1).memory(1_GB);

  dtc::Executor(G).run();
}

There are myriads of cluster computing frameworks such as Hadoop MapReduce, Apache Spark, Dryad, and Ray. We believe each has its reason to exist. DtCraft targets at:

System Requirements

To install and run DtCraft, you only need the following:

Learn More

Get Involved