Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the <~> operator equivalent to channel.read/channel.write #14430

Merged

Conversation

dlongnecke-cray
Copy link
Contributor

@dlongnecke-cray dlongnecke-cray commented Nov 13, 2019

This PR makes the <~> IO operator throw, and insofar as possible equivalent in semantics to channel.read and channel.write. It also adds the throws keyword to dsi IO routines for domains and arrays, as a consequence of the above.

If a SystemError is thrown from within IO routines up through readThis/writeThis, then the error is caught and the equivalent QIO error code is stored in the channel. Otherwise, the error is unpacked and the EIO error code is stored in the channel.

As of this time there is no way to distinguish between SystemError thrown by the user and SystemError thrown by the Chapel IO machinery.

The test test/classes/deitz/class/tree.chpl was rewritten to use an iterative postorder traversal instead of a recursive iterator due to compilation bugs (likely due to #7134).


Testing:

  • ALL on linux64 when CHPL_COMM=none and CHPL_LLVM=llvm
  • ALL on linux64 when CHPL_COMM=gasnet and CHPL_LLVM=llvm

@dlongnecke-cray dlongnecke-cray self-assigned this Nov 13, 2019
@dlongnecke-cray
Copy link
Contributor Author

FYI, I plan to figure out why the test classes/deitz/classes/tree is segfaulting sometime early this week.

@dlongnecke-cray dlongnecke-cray marked this pull request as ready for review January 3, 2020 22:27
Copy link
Member

@mppf mppf left a comment

Choose a reason for hiding this comment

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

Generally this looks good to me.

The PR message has some out of date stuff (removing inline, e.g.). and says "Otherwise, the error is unpacked" but I think you mean "Otherwise EIO is stored in the channel".

I'll discuss your open questions with you separately.

modules/standard/IO.chpl Outdated Show resolved Hide resolved
test/classes/deitz/class/tree.chpl Outdated Show resolved Hide resolved
@dlongnecke-cray dlongnecke-cray merged commit 279eb38 into chapel-lang:master Jan 8, 2020
dlongnecke-cray added a commit that referenced this pull request Jan 10, 2020
Adjust IO future to have deterministic output (#14736)

A future added in #14430 was non-deterministic because it printed
platform sensitive details about `stdout`. This PR adjusts the test
to catch the thrown Error and print its subclass type instead.

Change to future, trivial and not reviewed.
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.

None yet

2 participants