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

Method FindProgramPath

Parallel/Core/vtkPSystemTools.cxx:119–141  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

117
118//------------------------------------------------------------------------------
119bool vtkPSystemTools::FindProgramPath(const char* argv0, std::string& pathOut,
120 std::string& errorMsg, const char* exeName, const char* buildDir, const char* installPrefix)
121{
122 vtkMultiProcessController* controller = vtkMultiProcessController::GetGlobalController();
123 int retVal = 1;
124 if (controller->GetLocalProcessId() == 0)
125 {
126 retVal = static_cast<int>(vtksys::SystemTools::FindProgramPath(
127 argv0, pathOut, errorMsg, exeName, buildDir, installPrefix));
128 }
129 controller->Broadcast(&retVal, 1, 0);
130 // if the retVal on proc 0 is non-zero then only information is
131 // put in pathOut. Otherwise information is put in errorMsg.
132 if (retVal)
133 {
134 vtkPSystemTools::BroadcastString(pathOut, 0);
135 }
136 else
137 {
138 vtkPSystemTools::BroadcastString(errorMsg, 0);
139 }
140 return retVal != 0;
141}
142
143//------------------------------------------------------------------------------
144std::string vtkPSystemTools::GetCurrentWorkingDirectory(bool /* collapse */)

Callers

nothing calls this directly

Calls 3

BroadcastStringFunction · 0.50
GetLocalProcessIdMethod · 0.45
BroadcastMethod · 0.45

Tested by

no test coverage detected