Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions skills/building/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,44 @@ If the user does **not** specify a host-config file, determine the best match by
```

Use its output as the `-hc` argument (as shown in the examples above). If the user explicitly provides a host-config file/path, use that instead.

### Symlinked directories in the sandbox

If configure/build commands report that an existing path is missing, inaccessible, or outside the sandbox, check whether the source, build, install, host-config, or TPL paths include symlinks. Compare logical and physical paths with:

```bash
pwd -P
readlink -f <path>
```

Prefer physical paths resolved by `readlink -f` when invoking `config-build.py` (for `-bp`, `-ip`, `-hc`, and any explicit source/TPL paths), or restart the sandbox from the resolved workspace path. A symlinked path may appear outside the sandbox policy even when its resolved target is visible.

### MPI and Slurm in the sandbox

To run MPI-enabled commands from the sandbox, launch Codex with the `--mpi` command-line argument. This starts a Flux instance when needed. MPI through the sandbox is single-node only. If MPI or Slurm commands fail because no Flux allocation is available, stop and ask the user to restart the sandbox with `--mpi`.

On Slurm-based systems, run Slurm commands through the Flux wrapper instead of the system executable, for example:

```bash
/usr/global/tools/flux_wrappers/bin/srun -n 2 <command>
```

Loading the flux wrappers before launching the agent allows you to run the srun wrapper, e.g.
```bash
module load flux_wrappers
srun -n 2 <command>
```

When configuring builds whose MPI tests use `srun`, override CMake's MPI launcher:

```bash
./config-build.py -hc "$(./skills/building/scripts/determine_host_config)" -DMPIEXEC_EXECUTABLE=/usr/global/tools/flux_wrappers/bin/srun
```

### Shroud in the sandbox

If CMake configuration has trouble with Shroud in the sandbox, unset the cached Shroud executable at configure time:

```bash
./config-build.py -hc "$(./skills/building/scripts/determine_host_config)" -USHROUD_EXECUTABLE
```
2 changes: 1 addition & 1 deletion src/axom/quest/detail/DistributedClosestPointImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class DistributedClosestPointImpl
{
auto& queryDom = isMultidomain ? queryNode.child(domainNum) : queryNode;
conduit::Node& xferDom = xferDoms.child(domainNum);
conduit::Node& fields = queryDom.fetch_existing("fields");
conduit::Node& fields = queryDom.fetch("fields");

conduit::Node genericHeaders;
genericHeaders["association"] = "vertex";
Expand Down
128 changes: 85 additions & 43 deletions src/axom/quest/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -381,81 +381,123 @@ if(AXOM_ENABLE_MPI AND AXOM_ENABLE_SIDRE AND HDF5_FOUND)
if(AXOM_ENABLE_TESTS AND AXOM_DATA_DIR)
set(_nranks 3)

# Run the distributed closest point example on N ranks for each enabled policy
# Non-zero empty-rank probability tests domain underloading case
# Run the distributed closest point example on N ranks for each enabled policy.
# Query meshes match the original DCP example. Object meshes were
# generated with src/tools/gen-multidom-point-mesh.py.
set(_meshes "mdmesh.2x1" "mdmesh.2x3" "mdmesh.2x2x1" "mdmeshg.2x2x1")
# The mdmesh.* files were generated by these commands:
# src/tools/gen-multidom-structured-mesh.py -ml=0,0 -mu=2,2 -ms=100,100 -dc=2,1 -o mdmesh.2x1
# src/tools/gen-multidom-structured-mesh.py -ml=0,0 -mu=2,2 -ms=100,100 -dc=2,3 -o mdmesh.2x3
# src/tools/gen-multidom-structured-mesh.py -ml=0,0,0 -mu=2,2,2 -ms=20,20,15 -dc=2,2,1 -o mdmeshg.2x2x1 --strided
foreach(_pol ${AXOM_EXECUTION_POLICIES})
# sets the number of threads for the omp policy; leave empty for non-omp policies
set(_num_threads)
if(_pol STREQUAL "omp")
set(_num_threads ${AXOM_TEST_NUM_OMP_THREADS})
foreach(_mesh ${_meshes})
string(REGEX MATCH "\\.[0-9]+(x[0-9]+)+$" _sizes "${_mesh}")
string(REGEX MATCHALL "[0-9]+" _sizes ${_sizes})
list(LENGTH _sizes _ndim)

if(_ndim EQUAL 2)
set(_dim 2)
set(_shape circle)
set(_object_mesh ${quest_data_dir}/dcp_object_circle.root)
elseif(_ndim EQUAL 3)
set(_dim 3)
set(_shape sphere)
set(_object_mesh ${quest_data_dir}/dcp_object_sphere.root)
endif()

foreach(_mesh ${_meshes})
# Determine problem dimension by mesh filename.
# and set dimension-dependent arguments.
string(REGEX MATCH "\\.[0-9]+(x[0-9]+)+$" _sizes "${_mesh}")
string(REGEX MATCHALL "[0-9]+" _sizes ${_sizes})
list(LENGTH _sizes _ndim)

if(_ndim EQUAL 2)
set(_center 0.7 0.9)
elseif(_ndim EQUAL 3)
set(_center 0.7 0.9 0.5)
foreach(_pol ${AXOM_EXECUTION_POLICIES})
# sets the number of threads for the omp policy; leave empty for non-omp policies
set(_num_threads)
if(_pol STREQUAL "omp")
set(_num_threads ${AXOM_TEST_NUM_OMP_THREADS})
endif()

set(_test "quest_distributed_closest_point_run_${_ndim}D_${_pol}_${_mesh}")
set(_test "quest_distributed_closest_point_run_${_dim}D_${_pol}_${_mesh}")
axom_add_test(
NAME ${_test}
COMMAND quest_distributed_distance_query_ex
--mesh-file ${quest_data_dir}/${_mesh}.root
--long-point-count 60
--center ${_center}
--radius 0.9
--lat-point-count 30
--obj-domain-count-range 0 2
--object-mesh-file ${_object_mesh}
--dist-threshold .3
--no-random-spacing
--check-results
--dynamic-distance-filtering
--policy ${_pol}
--object-file dcp_object_mesh_${_ndim}d_${_pol}_${_mesh}
--distance-file dcp_closest_point_2d_${_pol}_${_mesh}
--distance-file dcp_closest_point_${_dim}d_${_pol}_${_mesh}
NUM_MPI_TASKS ${_nranks}
NUM_OMP_THREADS ${_num_threads})
set_tests_properties(${_test}
PROPERTIES
PASS_REGULAR_EXPRESSION "Analytic verification for '${_shape}' found 0 errors")

if(_pol STREQUAL "seq" AND (_mesh STREQUAL "mdmesh.2x1" OR _mesh STREQUAL "mdmesh.2x2x1"))
if(_pol STREQUAL "seq" AND
(_mesh STREQUAL "mdmesh.2x1" OR _mesh STREQUAL "mdmesh.2x2x1"))
# Keep fallback coverage for the non-dynamic filtering path
# with one 2D and one 3D seq case.
set(_static_test "${_test}_no_dynamic_distance_filtering")
axom_add_test(
NAME ${_static_test}
COMMAND quest_distributed_distance_query_ex
--mesh-file ${quest_data_dir}/${_mesh}.root
--long-point-count 60
--center ${_center}
--radius 0.9
--lat-point-count 30
--obj-domain-count-range 0 2
--object-mesh-file ${_object_mesh}
--dist-threshold .3
--no-random-spacing
--check-results
--no-dynamic-distance-filtering
--policy ${_pol}
--object-file dcp_object_mesh_${_ndim}d_${_pol}_${_mesh}_no_dynamic
--distance-file dcp_closest_point_2d_${_pol}_${_mesh}_no_dynamic
--distance-file dcp_closest_point_${_dim}d_${_pol}_${_mesh}_no_dynamic
NUM_MPI_TASKS ${_nranks}
NUM_OMP_THREADS ${_num_threads})
set_tests_properties(${_static_test}
PROPERTIES
PASS_REGULAR_EXPRESSION "Analytic verification for '${_shape}' found 0 errors")
endif()
endforeach()
endforeach()

unset(optional_dependency)
foreach(_pol ${AXOM_EXECUTION_POLICIES})
# sets the number of threads for the omp policy; leave empty for non-omp policies
set(_num_threads)
if(_pol STREQUAL "omp")
set(_num_threads ${AXOM_TEST_NUM_OMP_THREADS})
endif()

set(_test "quest_distributed_closest_point_run_2D_${_pol}_single_domain_object")
axom_add_test(
NAME ${_test}
COMMAND quest_distributed_distance_query_ex
--mesh-file ${quest_data_dir}/mdmesh.2x1.root
--object-mesh-file ${quest_data_dir}/dcp_object_circle_single_domain.root
--dist-threshold .3
--policy ${_pol}
--distance-file dcp_closest_point_2d_${_pol}_single_domain_object
NUM_MPI_TASKS ${_nranks}
NUM_OMP_THREADS ${_num_threads})
set_tests_properties(${_test}
PROPERTIES
PASS_REGULAR_EXPRESSION "Analytic verification for 'circle' found 0 errors")
endforeach()

if("seq" IN_LIST AXOM_EXECUTION_POLICIES)
set(_test "quest_distributed_closest_point_memory_instrumentation")
axom_add_test(
NAME ${_test}
COMMAND quest_distributed_distance_query_ex
--mesh-file ${quest_data_dir}/mdmesh.2x1.root
--object-mesh-file ${quest_data_dir}/dcp_object_circle.root
--dist-threshold .3
--policy seq
--track-memory
--trim-after-query
--sample-memory-ms 1
--distance-file dcp_closest_point_2d_seq_memory_instrumentation
NUM_MPI_TASKS ${_nranks})
set_tests_properties(${_test}
PROPERTIES
PASS_REGULAR_EXPRESSION "peak RSS during phase")
endif()

unset(_dim)
unset(_mesh)
unset(_meshes)
unset(_ndim)
unset(_num_threads)
unset(_object_mesh)
unset(_pol)
unset(_nranks)
unset(_shape)
unset(_sizes)
unset(_test)
unset(_static_test)
endif()
Expand Down
Loading