Skip to content

Commit

Permalink
Supporting TECA_assets for app tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elbashandy committed Sep 17, 2020
1 parent 922a609 commit 0b2a677
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
5 changes: 3 additions & 2 deletions test/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}

teca_add_test(test_deeplabv3p_ar_detect_app_serial
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_deeplabv3p_ar_detect_app.sh
${CMAKE_BINARY_DIR}/${BIN_PREFIX} ${TECA_DATA_ROOT}
${CMAKE_BINARY_DIR}/${BIN_PREFIX} ${TECA_DATA_ROOT} ${TECA_ASSETS_ROOT}
FEATURES ${TECA_HAS_NETCDF}
REQ_TECA_DATA)

teca_add_test(test_deeplabv3p_ar_detect_app_mpi
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_deeplabv3p_ar_detect_app.sh
${CMAKE_BINARY_DIR}/${BIN_PREFIX} ${TECA_DATA_ROOT} ${MPIEXEC} 2
${CMAKE_BINARY_DIR}/${BIN_PREFIX} ${TECA_DATA_ROOT}
${TECA_ASSETS_ROOT} ${MPIEXEC} 2
FEATURES ${TECA_HAS_NETCDF_MPI} ${TECA_HAS_MPI} ${MPI4Py_FOUND}
REQ_TECA_DATA)

Expand Down
21 changes: 11 additions & 10 deletions test/apps/test_deeplabv3p_ar_detect_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@

if [[ $# < 2 ]]
then
echo "usage: test_deeplabv3p_ar_detect_app.sh [app prefix] " \
"[data root] [mpi exec] [test cores]"
echo "usage: test_deeplabv3p_ar_detect_app.sh [app prefix] " \
"[data root] [assets root] [mpi exec] [test cores]"
exit -1
fi

app_prefix=${1}
data_root=${2}
assets_root=${3}

if [[ $# -eq 4 ]]
if [[ $# -eq 5 ]]
then
mpi_exec=${3}
test_cores=${4}
mpi_exec=${4}
test_cores=${5}
launcher="${mpi_exec} -n ${test_cores}"
fi

set -x

# run the app
${launcher} ${app_prefix}/teca_deeplabv3p_ar_detect \
--input_regex "${data_root}/ARTMIP_MERRA_2D_2017-05.*\.nc$" \
--pytorch_deeplab_model ${data_root}/cascade_deeplab_IVT.pt \
${launcher} ${app_prefix}/teca_deeplabv3p_ar_detect \
--input_regex "${data_root}/ARTMIP_MERRA_2D_2017-05.*\.nc$" \
--pytorch_deeplab_model ${assets_root}/cascade_deeplab_IVT.pt \
--output_file test_deeplabv3p_ar_detect_app_output_%t%.nc

# run the diff
${app_prefix}/teca_cartesian_mesh_diff \
"test_deeplabv3p_ar_detect_app_output.*\.nc" \
${app_prefix}/teca_cartesian_mesh_diff \
"test_deeplabv3p_ar_detect_app_output.*\.nc" \
"${data_root}/test_deeplabv3p_ar_detect_app_ref.nc"

# clean up
Expand Down

0 comments on commit 0b2a677

Please sign in to comment.