Skip to content

Commit

Permalink
Rename the omntrace-causal binary
Browse files Browse the repository at this point in the history
  • Loading branch information
dgaliffiAMD committed Sep 14, 2024
1 parent 4a47eec commit 20b3905
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 32 deletions.
4 changes: 2 additions & 2 deletions cmake/ConfigInstall.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export(PACKAGE ${PROJECT_NAME})
#
configure_file(
${PROJECT_SOURCE_DIR}/tests/validate-causal-json.py
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/omnitrace-causal-print COPYONLY)
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/rocprof-sys-causal-print COPYONLY)

install(PROGRAMS ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/omnitrace-causal-print
install(PROGRAMS ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/rocprof-sys-causal-print
DESTINATION ${CMAKE_INSTALL_BINDIR})

# ------------------------------------------------------------------------------#
Expand Down
3 changes: 2 additions & 1 deletion source/bin/omnitrace-causal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ target_link_libraries(
omnitrace::omnitrace-common-library omnitrace::omnitrace-core)
set_target_properties(
omnitrace-causal PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${OMNITRACE_EXE_INSTALL_RPATH}")
INSTALL_RPATH "${OMNITRACE_EXE_INSTALL_RPATH}"
OUTPUT_NAME "rocprof-sys-causal")

omnitrace_strip_target(omnitrace-causal)

Expand Down
24 changes: 12 additions & 12 deletions source/bin/omnitrace-causal/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ get_initial_environment()
update_env(_env, "OMNITRACE_USE_PROCESS_SAMPLING", false);
update_env(_env, "OMNITRACE_THREAD_POOL_SIZE",
get_env<int>("OMNITRACE_THREAD_POOL_SIZE", 0));
update_env(_env, "OMNITRACE_LAUNCHER", "omnitrace-causal");
update_env(_env, "OMNITRACE_LAUNCHER", "rocprof-sys-causal");

return _env;
}
Expand All @@ -228,7 +228,7 @@ prepare_command_for_run(char* _exe, std::vector<char*>& _argv)
if(!_injected)
{
throw std::runtime_error(
join("", "omnitrace-causal was unable to match \"", launcher,
join("", "rocprof-sys-causal was unable to match \"", launcher,
"\" to any arguments on the command line: \"",
join(array_config{ " ", "", "" }, _argv), "\""));
}
Expand Down Expand Up @@ -419,13 +419,13 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
This executable is designed to streamline that process.
For example (assume all commands end with '-- <exe> <args>'):
omnitrace-causal -n 5 -- <exe> # runs <exe> 5x with causal profiling enabled
rocprof-sys-causal -n 5 -- <exe> # runs <exe> 5x with causal profiling enabled
omnitrace-causal -s 0 5,10,15,20 # runs <exe> 2x with virtual speedups:
rocprof-sys-causal -s 0 5,10,15,20 # runs <exe> 2x with virtual speedups:
# - 0
# - randomly selected from 5, 10, 15, and 20
omnitrace-causal -F func_A func_B func_(A|B) # runs <exe> 3x with the function scope limited to:
rocprof-sys-causal -F func_A func_B func_(A|B) # runs <exe> 3x with the function scope limited to:
# 1. func_A
# 2. func_B
# 3. func_A or func_B
Expand All @@ -435,8 +435,8 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
- Collect a flat profile via sampling
- E.g., rocprof-sys-sample -F -- <exe> <args>
- Inspect sampling_wall_clock.txt and sampling_cpu_clock.txt for functions to target
- Run omnitrace-causal in "function" mode first (does not require debug info)
- Run omnitrace-causal in "line" mode when you are targeting one function (requires debug info)
- Run rocprof-sys-causal in "function" mode first (does not require debug info)
- Run rocprof-sys-causal in "line" mode when you are targeting one function (requires debug info)
- Preferably, use predictions from the "function" mode to determine which function to target
- Limit the virtual speedups to a smaller pool, e.g., 0,5,10,25,50, to get reliable predictions quicker
- Make use of the binary, source, and function scope to limit the functions/lines selected for experiments
Expand All @@ -451,7 +451,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
});

parser.enable_help();
parser.enable_version("omnitrace-causal", OMNITRACE_ARGPARSE_VERSION_INFO);
parser.enable_version("rocprof-sys-causal", OMNITRACE_ARGPARSE_VERSION_INFO);

auto _cols = std::get<0>(console::get_columns());
if(_cols > parser.get_help_width() + 8)
Expand Down Expand Up @@ -483,7 +483,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
});

std::string _config_file = {};
std::string _config_folder = "omnitrace-causal-config";
std::string _config_folder = "rocprof-sys-causal-config";
bool _generate_configs = false;
bool _add_defaults = true;

Expand All @@ -498,10 +498,10 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
parser
.add_argument(
{ "-l", "--launcher" },
"When running MPI jobs, omnitrace-causal needs to be *before* the executable "
"When running MPI jobs, rocprof-sys-causal needs to be *before* the executable "
"which launches the MPI processes (i.e. before `mpirun`, `srun`, etc.). Pass "
"the name of the target executable (or a regex for matching to the name of "
"the target) for causal profiling, e.g., `omnitrace-causal -l foo -- mpirun "
"the target) for causal profiling, e.g., `rocprof-sys-causal -l foo -- mpirun "
"-n 4 foo`. This ensures that the omnitrace library is LD_PRELOADed on the "
"proper target")
.count(1)
Expand All @@ -511,7 +511,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
.add_argument({ "-g", "--generate-configs" },
"Generate config files instead of passing environment variables "
"directly. If no arguments are provided, the config files will be "
"placed in ${PWD}/omnitrace-causal-config folder")
"placed in ${PWD}/rocprof-sys-causal-config folder")
.min_count(0)
.max_count(1)
.dtype("folder")
Expand Down
2 changes: 1 addition & 1 deletion source/bin/omnitrace-causal/omnitrace-causal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma once

#define TIMEMORY_PROJECT_NAME "omnitrace-causal"
#define TIMEMORY_PROJECT_NAME "rocprof-sys-causal"

#include <csignal>
#include <map>
Expand Down
4 changes: 2 additions & 2 deletions source/lib/omnitrace/library/causal/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,11 @@ perform_experiment_impl(std::shared_ptr<std::promise<void>> _started) // NOLINT
}
std::cerr << std::flush;

// if launched via omnitrace-causal, allow end-to-end runs that do not
// if launched via rocprof-sys-causal, allow end-to-end runs that do not
// start experiments
auto _omni_causal_launcher =
get_env<std::string>("OMNITRACE_LAUNCHER", "", false) ==
"omnitrace-causal";
"rocprof-sys-causal";

if(!(get_causal_end_to_end() && _omni_causal_launcher))
{
Expand Down
4 changes: 2 additions & 2 deletions source/python/gui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ python -m pip install .
#### Console Script

```console
omnitrace-causal-plot <args...>
rocprof-sys-causal-plot <args...>
```

#### Module

```console
python -m omnitrace_causal_viewer <args...>
python -m rocprof-sys_causal_viewer <args...>
```

### From source tree
Expand Down
4 changes: 2 additions & 2 deletions source/python/gui/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
name = omnitrace-causal-viewer
name = rocprof-sys-causal-viewer
url = https://github.com/ROCm/omnitrace
download_url = https://github.com/ROCm/omnitrace.git
maintainer = AMD Research
Expand All @@ -22,7 +22,7 @@ classifiers =
Programming Language :: Python :: 3

[options]
packages = omnitrace_causal_viewer
packages = rocprof_sys_causal_viewer
zip_safe = true
include_package_data = true

Expand Down
10 changes: 5 additions & 5 deletions source/python/gui/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ def parse_requirements(fname="requirements.txt"):


setup(
name="omnitrace-causal-viewer",
name="rocprof-sys-causal-viewer",
version=get_project_version(),
description="GUI for viewing causal profilers",
long_description=get_long_description(),
long_description_content_type="text/markdown",
author="AMD Research",
packages=["omnitrace_causal_viewer"],
package_dir={"omnitrace_causal_viewer": "source"},
packages=["rocprof_sys_causal_viewer"],
package_dir={"rocprof_sys_causal_viewer": "source"},
package_data={
"omnitrace_causal_viewer": [
"rocprof_sys_causal_viewer": [
"source/assets/*",
"source/workloads/*",
"source/VERSION",
Expand All @@ -65,6 +65,6 @@ def parse_requirements(fname="requirements.txt"):
install_requires=parse_requirements(),
python_requires=">=3.6",
entry_points={
"console_scripts": ["omnitrace-causal-plot=omnitrace_causal_viewer.__main__:main"]
"console_scripts": ["rocprof-sys-causal-plot=rocprof_sys_causal_viewer.__main__:main"]
},
)
8 changes: 4 additions & 4 deletions source/python/gui/source/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def main():

for itr in [
settings_path,
os.path.join(os.environ.get("HOME"), ".omnitrace-causal-plot.json"),
os.path.join(os.environ.get("HOME"), ".rocprof-sys-causal-plot.json"),
]:
if os.path.exists(itr):
with open(itr, "r") as f:
Expand Down Expand Up @@ -150,19 +150,19 @@ def main():
prog, max_help_position=40
),
usage="""
omnitrace-causal-plot [ARGS...]
rocprof-sys-causal-plot [ARGS...]
-------------------------------------------------------------------------------
Examples:
\tomnitrace-causal-plot --path workloads/toy -n 0
\trocprof-sys-causal-plot --path workloads/toy -n 0
-------------------------------------------------------------------------------
""",
)

my_parser.add_argument(
"--version",
action="version",
version="OmniTrace Causal Viewer v{}\n".format(f"{__version__}".strip("\n")),
version="ROCm Systems Profiler Causal Viewer v{}\n".format(f"{__version__}".strip("\n")),
)

my_parser.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion tests/omnitrace-causal-tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ macro(
_V30
_TOL # tolerance for virtual speedup
)
# arguments to omnitrace-causal
# arguments to rocprof-sys-causal
set(${_NAME}_args "${_causal_common_args} ${_MODE} ${_EXPER}")

# arguments to validate-causal-json.py
Expand Down

0 comments on commit 20b3905

Please sign in to comment.