MCPcopy Create free account
hub / github.com/Kitware/VTK / Execute

Method Execute

Parallel/MPI/Testing/Cxx/TestProcess.cxx:47–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void MyProcess::Execute()
48{
49 // multiprocess logic
50 int numProcs = this->Controller->GetNumberOfProcesses();
51 int me = this->Controller->GetLocalProcessId();
52
53 std::cout << "numProcs=" << numProcs << " me=" << me << std::endl;
54 std::cout << "executable=" << this->Argv[0] << std::endl;
55 std::cout << "argc=" << this->Argc << std::endl;
56
57 const int MY_RETURN_VALUE_MESSAGE = 0x11;
58
59 if (me == 0)
60 {
61 // root node
62 this->ReturnValue = 0;
63 int i = 1;
64 while (i < numProcs)
65 {
66 this->Controller->Send(&this->ReturnValue, 1, i, MY_RETURN_VALUE_MESSAGE);
67 ++i;
68 }
69 }
70 else
71 {
72 // satellites
73 this->Controller->Receive(&this->ReturnValue, 1, 0, MY_RETURN_VALUE_MESSAGE);
74 }
75}
76
77}
78

Callers 1

RunTestCaseFunction · 0.45

Calls 4

GetNumberOfProcessesMethod · 0.80
GetLocalProcessIdMethod · 0.45
SendMethod · 0.45
ReceiveMethod · 0.45

Tested by

no test coverage detected