Skip to content

Add boost short options for benchmarks - #1387

Open
aprokop wants to merge 3 commits into
arborx:masterfrom
aprokop:boost_short
Open

Add boost short options for benchmarks#1387
aprokop wants to merge 3 commits into
arborx:masterfrom
aprokop:boost_short

Conversation

@aprokop

@aprokop aprokop commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

To ease writing command line.

Drive-by change: fixing treatment of help in distributed drivers.

Copilot AI left a comment

Copy link
Copy Markdown

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 adds Boost.Program_options short aliases to multiple benchmark executables to make their command lines quicker to type.

Changes:

  • Added ,h short help option across benchmarks.
  • Added short aliases for common numeric/string parameters (e.g., values,n, queries,m, dimension,d, etc.).
  • Added additional short flags for some benchmark-specific options (e.g., predicate-sort,s, buffer,b).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
benchmarks/triangulated_surface_distance/triangulated_surface_distance.cpp Adds short aliases for help/angle/geometry/n/radius/refinements.
benchmarks/distributed_tree_driver/distributed_tree_driver.cpp Adds short aliases for help/values/queries.
benchmarks/cluster/mst.cpp Adds short aliases for help and several generator parameters.
benchmarks/cluster/hdbscan.cpp Adds short aliases for help and several generator parameters.
benchmarks/cluster/distributed_dbscan.cpp Adds short aliases for help and several distributed DBSCAN parameters.
benchmarks/cluster/dbscan.cpp Adds short aliases for help and several DBSCAN parameters.
benchmarks/bvh_driver/bvh_driver.cpp Adds short aliases for help/values/queries/predicate-sort/buffer.
benchmarks/brute_force_vs_bvh/brute_force_vs_bvh.cpp Adds short aliases for help/dimension/predicates/primitives/repetitions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread benchmarks/cluster/distributed_dbscan.cpp
( "help,h", "help message" )
( "dimension,d", bpo::value<int>(&dim)->default_value(3), "dimension" )
( "predicates,n", bpo::value<int>(&nqueries)->default_value(5), "number of predicates" )
( "primitives,m", bpo::value<int>(&nprimitives)->default_value(5), "number of primitives" )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
( "primitives,m", bpo::value<int>(&nprimitives)->default_value(5), "number of primitives" )
( "primitives,q", bpo::value<int>(&nprimitives)->default_value(5), "number of primitives" )

for "query"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was thinking using n for the stuff we construct on, and m for the stuff we search for. Could use p and q instead for primitives and queries, as predicates and primitives start with the same letter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't feel strongly about it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

( "dimension,d", bpo::value<int>(&params.dim)->default_value(-1), "dimension of points to generate" )
( "filename,f", bpo::value<std::string>(&params.filename), "filename containing data" )
( "max-num-points,N", bpo::value<int>(&params.max_num_points)->default_value(-1), "max number of points to read in")
( "n,n", bpo::value<int>(&params.n)->default_value(10), "number of points to generate" )
Comment thread benchmarks/cluster/distributed_dbscan.cpp
Comment thread benchmarks/cluster/dbscan.cpp
Comment thread examples/wall_distance/example_wall_distance.cpp Outdated
Comment thread benchmarks/distributed_tree_driver/distributed_tree_driver.cpp
Comment thread benchmarks/distributed_contact/distributed_contact.cpp Outdated
Comment thread benchmarks/bvh_driver/bvh_driver.cpp

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread benchmarks/distributed_tree_driver/distributed_tree_driver.cpp Outdated
Comment thread benchmarks/execution_space_instances/execution_space_instances_driver.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Suppressed comments (1)

benchmarks/distributed_tree_driver/distributed_tree_driver.cpp:315

  • This change removes Kokkos::ScopeGuard RAII in favor of manual initialize/finalize. If boost::program_options parsing (or any later code) throws, Kokkos::finalize() will not run. Consider using an RAII guard (e.g., ScopeGuard in an inner scope with MPI_Finalize() after it, or custom guards) to guarantee Kokkos finalization and preserve the required finalize-before-MPI_Finalize order.
  Kokkos::initialize(argc, argv);

  namespace bpo = boost::program_options;

  Parameters params;
  std::string precision;
  bpo::options_description desc("Allowed options");
  // clang-format off
  desc.add_options()
      ( "help,h", "produce help message" )
      ( "predicates,m", bpo::value<int>(&params.n_queries)->default_value(5000), "Number of predicates per MPI rank." )
      ( "primitives,n", bpo::value<int>(&params.n_values)->default_value(20000), "Number of primitives per MPI rank." )
      ( "neighbors", bpo::value<int>(&params.n_neighbors)->default_value(10), "Desired number of results per query." )
      ( "shift", bpo::value<float>(&params.shift)->default_value(1.f), "Shift of the point clouds. '0' means the clouds are built "
                                                                       "at the same place, while '1' places the clouds next to each"
                                                                       "other. Negative values and values larger than one "
                                                                       "mean that the clouds are separated." )
      ( "partition_dim", bpo::value<int>(&params.partition_dim)->default_value(3), "Number of dimension used by the partitioning of the global "
                                                                                   "point cloud. 1 -> local clouds are aligned on a line, 2 -> "
                                                                                   "local clouds form a board, 3 -> local clouds form a box." )
      ( "precision,p", bpo::value<std::string>(&precision)->default_value("float"), "Precision (float | double)" )
      ( "do-not-perform-knn-search", "skip kNN search" )
      ( "do-not-perform-radius-search", "skip radius search" )
      ( "shift-queries" , "By default, points are reused for the queries. Enabling this option shrinks the local box queries are created "
                          "in to a third of its size and moves it to the center of the global box. The result is a huge imbalance for the "
                          "number of queries that need to be processed by each processor.")
      ;
  // clang-format on
  bpo::variables_map vm;
  bpo::store(bpo::command_line_parser(argc, argv).options(desc).run(), vm);
  bpo::notify(vm);

  if (is_help_present)
  {
    if (comm_rank == 0)
      std::cout << desc << '\n';
    Kokkos::finalize();
    MPI_Finalize();
    return 0;

Comment on lines +224 to +226
auto *help_it = std::find_if(argv, argv + argc, [](std::string const &x) {
return x == "--help" || x == "--kokkos-help";
});
Comment on lines +234 to 247
Kokkos::initialize(argc, argv);

if (is_help_present)
{
Kokkos::finalize();
MPI_Finalize();
return 0;
}

main_<float>(comm);

Kokkos::finalize();
MPI_Finalize();

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