Skip to content

Conversation

@hariharan-devarajan
Copy link
Member

@hariharan-devarajan hariharan-devarajan commented Oct 27, 2025

We make the following dynamic based on env.

  • HWLOC
  • HIP
  • MPI

Copilot AI review requested due to automatic review settings October 27, 2025 00:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors build system options to make feature detection dynamic based on the environment instead of requiring explicit user configuration. The changes convert several hardcoded CMake options (HWLOC, HIP, and MPI) from manual opt-in flags to automatic detection that queries the system for available libraries.

Key Changes:

  • Removed manual CMake options for HWLOC, HIP, and MPI support
  • Implemented automatic find_package() detection with QUIET flag for graceful fallback
  • Changed error handling from FATAL_ERROR to informational STATUS messages when optional dependencies are missing

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cmake/modules/dftracer-utils.cmake Added utility function to print all CMake variables for debugging
CMakeLists.txt Converted HWLOC, HIP, and MPI from manual options to automatic detection; updated error handling to allow builds without optional dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CMakeLists.txt Outdated
endif()

find_package(MPI COMPONENTS CXX QUIET)
if (MPI_CXX_FOUND AND DFTRACER_ENABLE_MPI)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a high level knob to enable detection based on user's request? The knob would be disabled by default

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

@hariharan-devarajan
Copy link
Member Author

Ok I have added a variable for automatic detection. That is off by default but if on, would ignore if user wanted to enable or disable feature.

@hariharan-devarajan
Copy link
Member Author

@amarathe84 Can you check the PR

@hariharan-devarajan hariharan-devarajan force-pushed the feature/dynamic-detection branch 3 times, most recently from cbba4c7 to bb43f07 Compare December 2, 2025 19:37
@hariharan-devarajan hariharan-devarajan force-pushed the feature/dynamic-detection branch 2 times, most recently from 5643be7 to 4fb1cb9 Compare December 2, 2025 20:37
autobuild.sh Outdated
--enable-ftracing Enable function tracing
--enable-hip Enable HIP tracing
--enable-mpi Enable MPI support
--enable-dynamic Enable dynamic detection of MPI, HWLOC, and HIP at runtime
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit: should this be '--enable-dynamic-detection'? Existing option name suggests slightly different interpretation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

If users enables dynamic detection, dftracer will at runtime
detect which modules (HIP, HWLOC, MPI) are available and load them accordingly.
Copy link
Collaborator

@amarathe84 amarathe84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good.

@hariharan-devarajan hariharan-devarajan merged commit ff3b99c into develop Dec 4, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants