Skip to content

Commit

Permalink
Compress the SDFG generated when failing/invalid for larger codebase (#…
Browse files Browse the repository at this point in the history
…1456)

Relates to #1453
  • Loading branch information
FlorianDeconinck committed Nov 28, 2023
1 parent cfa0871 commit 54e6860
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dace/sdfg/sdfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2191,8 +2191,8 @@ def compile(self, output_file=None, validate=True) -> 'CompiledSDFG':
# Generate code for the program by traversing the SDFG state by state
program_objects = codegen.generate_code(sdfg, validate=validate)
except Exception:
fpath = os.path.join('_dacegraphs', 'failing.sdfg')
self.save(fpath)
fpath = os.path.join('_dacegraphs', 'failing.sdfgz')
self.save(fpath, compress=True)
print(f'Failing SDFG saved for inspection in {os.path.abspath(fpath)}')
raise

Expand Down
4 changes: 2 additions & 2 deletions dace/sdfg/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ def validate_sdfg(sdfg: 'dace.sdfg.SDFG', references: Set[int] = None, **context
validate_control_flow_region(sdfg, sdfg, initialized_transients, symbols, references, **context)
except InvalidSDFGError as ex:
# If the SDFG is invalid, save it
fpath = os.path.join('_dacegraphs', 'invalid.sdfg')
sdfg.save(fpath, exception=ex)
fpath = os.path.join('_dacegraphs', 'invalid.sdfgz')
sdfg.save(fpath, exception=ex, compress=True)
ex.path = fpath
raise

Expand Down

0 comments on commit 54e6860

Please sign in to comment.