MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / GenerateGNode

Class GenerateGNode

example/E04-MapReduce.cpp:27–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26
27class GenerateGNode : public GNode {
28public:
29 CStatus init() override {
30 auto status = CGRAPH_CREATE_GPARAM(NumsGParam, PARAM_KEY);
31 return status;
32 }
33
34 CStatus run() override {
35 std::mt19937 generator;
36 auto param = CGRAPH_GET_GPARAM_WITH_NO_EMPTY(NumsGParam, PARAM_KEY);
37
38 std::uniform_int_distribution<int> distribution(0, MAX_NUM - 1);
39 for (int i = 0; i < MAP_SIZE * NUMS_PER_MAP; i++) {
40 int num = distribution(generator);
41 param->random_nums_.push_back(num);
42 }
43
44 return CStatus();
45 }
46};
47
48
49template<int MAP_TAG>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected