Skip to content

Commit 510df3a

Browse files
Liang YuGitHub Enterprise
authored andcommitted
Workflow unit tests fixed to run with CPU-only ISCE3 (#843)
* correctly set rubbersheet at CUDA only in CMake * added CPU only check for geocode_insar test
1 parent 343b293 commit 510df3a

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

tests/python/packages/CMakeLists.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ nisar/workflows/focus.py
77
nisar/workflows/stage_dem.py
88
nisar/workflows/gcov.py
99
nisar/workflows/geo2rdr.py
10+
nisar/workflows/geocode_insar.py
1011
nisar/workflows/gslc.py
1112
nisar/workflows/gpu_check.py
12-
nisar/workflows/geocode_insar.py
1313
nisar/workflows/insar.py
1414
nisar/workflows/process_args.py
1515
nisar/workflows/point_target_info.py
1616
nisar/workflows/rdr2geo.py
1717
nisar/workflows/resample_slc.py
18-
nisar/workflows/rubbersheet.py
1918
nisar/workflows/unwrap.py
2019
nisar/workflows/antenna_parser.py
2120
)
@@ -45,17 +44,19 @@ set_tests_properties(test.python.pkg.nisar.workflows.geo2rdr PROPERTIES
4544
DEPENDS test.python.pkg.nisar.workflows.rdr2geo)
4645
set_tests_properties(test.python.pkg.nisar.workflows.resample_slc PROPERTIES
4746
DEPENDS test.python.pkg.nisar.workflows.geo2rdr)
48-
if(WITH_CUDA)
49-
set_tests_properties(test.python.pkg.nisar.workflows.dense_offsets PROPERTIES
50-
DEPENDS test.python.pkg.nisar.workflows.cuda_insar)
51-
set_tests_properties(test.python.pkg.nisar.workflows.rubbersheet PROPERTIES
52-
DEPENDS test.python.pkg.nisar.workflows.cuda_insar)
53-
endif()
5447
set_tests_properties(test.python.pkg.nisar.workflows.crossmul PROPERTIES
5548
DEPENDS test.python.pkg.nisar.workflows.resample_slc)
5649
# using rdr2geo outputs as RUNW rasters to confirm geocode run
5750
# using RUNW HDF5 needed as a verifiable dummy RUNW input
5851
set_tests_properties(test.python.pkg.nisar.workflows.geocode_insar PROPERTIES
5952
DEPENDS "test.python.pkg.nisar.workflows.rdr2geo;test.python.pkg.nisar.workflows.unwrap")
53+
6054
set_tests_properties(test.python.pkg.nisar.workflows.insar PROPERTIES
6155
DEPENDS test.python.pkg.nisar.workflows.geocode_insar)
56+
57+
if(WITH_CUDA)
58+
set_tests_properties(test.python.pkg.nisar.workflows.dense_offsets PROPERTIES
59+
DEPENDS test.python.pkg.nisar.workflows.cuda_insar)
60+
set_tests_properties(test.python.pkg.nisar.workflows.rubbersheet PROPERTIES
61+
DEPENDS test.python.pkg.nisar.workflows.cuda_insar)
62+
endif()

tests/python/packages/nisar/workflows/geocode_insar.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import h5py
66
import numpy as np
77

8+
import isce3
89
from nisar.workflows import geocode_insar, h5_prep
910
from nisar.workflows.geocode_insar_runconfig import GeocodeInsarRunConfig
1011

@@ -16,6 +17,10 @@ def test_geocode_run():
1617
'''
1718
test_yaml_path = os.path.join(iscetest.data, 'insar_test.yaml')
1819
for pu in ['cpu', 'gpu']:
20+
# Skip GPU geocode insar if cuda not included
21+
if pu == 'gpu' and not hasattr(isce3, 'cuda'):
22+
continue
23+
1924
with open(test_yaml_path) as fh_test_yaml:
2025
test_yaml = fh_test_yaml.read().replace('@ISCETEST@', iscetest.data). \
2126
replace('@TEST_OUTPUT@', f'{pu}_gunw.h5'). \
@@ -73,6 +78,10 @@ def test_geocode_validate():
7378
# prepare the check gunw hdf5
7479
scratch_path = '.'
7580
for pu in ['cpu', 'gpu']:
81+
# Skip GPU geocode insar if cuda not included
82+
if pu == 'gpu' and not hasattr(isce3, 'cuda'):
83+
continue
84+
7685
path_gunw = os.path.join(scratch_path, f'{pu}_gunw.h5')
7786
product_path = 'science/LSAR/GUNW/grids/frequencyA/interferogram/HH'
7887
with h5py.File(path_gunw, 'r', libver='latest', swmr=True) as h:

0 commit comments

Comments
 (0)