Use execvpe instead of execve in omnitrace-sample (#187)

* Use execvpe instead of execve in omnitrace-sample

- previous implementation preferred exe in PATH over exe in PWD
- 'p' variants of exec duplicate the actions of the shell in searching for an executable file if the specified filename does not contain a slash character

* OpenMPI oversubscribe arg in testing

[ROCm/rocprofiler-systems commit: 139070a2de]
Этот коммит содержится в:
Jonathan R. Madsen
2022-10-27 15:15:50 -05:00
коммит произвёл GitHub
родитель 58c7c71af6
Коммит 268f94be4b
5 изменённых файлов: 11 добавлений и 12 удалений
+1 -1
Просмотреть файл
@@ -1 +1 @@
1.7.2
1.7.3
-6
Просмотреть файл
@@ -64,12 +64,6 @@ auto updated_envs = std::set<std::string_view>{};
auto original_envs = std::set<std::string>{};
} // namespace
std::string
get_command(const char* _argv0)
{
return omnitrace::path::find_path(_argv0, 0, omnitrace::common::get_env("PATH", ""));
}
std::string
get_realpath(const std::string& _v)
{
+1 -2
Просмотреть файл
@@ -56,11 +56,10 @@ main(int argc, char** argv)
if(!_argv.empty())
{
std::string _argv0 = get_command(_argv[0]);
print_command(_argv);
_argv.emplace_back(nullptr);
_env.emplace_back(nullptr);
return execve(_argv0.c_str(), _argv.data(), _env.data());
return execvpe(_argv.front(), _argv.data(), _env.data());
}
}
-3
Просмотреть файл
@@ -26,9 +26,6 @@
#include <string_view>
#include <vector>
std::string
get_command(const char*);
std::string
get_realpath(const std::string&);
+9
Просмотреть файл
@@ -154,6 +154,15 @@ if(OMNITRACE_CI_MPI_RUN_AS_ROOT)
endif()
endif()
execute_process(
COMMAND ${MPIEXEC_EXECUTABLE} --oversubscribe -n 1 ls
RESULT_VARIABLE _mpiexec_oversubscribe
OUTPUT_QUIET ERROR_QUIET)
if(_mpiexec_oversubscribe EQUAL 0)
list(APPEND MPIEXEC_EXECUTABLE_ARGS --oversubscribe)
endif()
# -------------------------------------------------------------------------------------- #
set(_VALID_GPU OFF)