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

HyperIterables ignore loop phasers #1200

Closed
gfldex opened this issue Oct 22, 2017 · 5 comments

Comments

Projects
None yet
6 participants
@gfldex
Copy link
Contributor

commented Oct 22, 2017

my @a = (^10).list; @a = @a.hyper(:batch(5)).map({ LAST say "last"; „∅“ });
# rakudo-moar d10d69774: ( no output )

# expexted output at the end of a batch:
# last

# FIRST and NEXT are ignored too
# It may be sensible to fail on LAST in a HyperIterable and provide a
# LAST-BATCH phaser to avoid confusion when non-parallel code is
# changed.
@lizmat

This comment has been minimized.

Copy link
Contributor

commented Oct 22, 2017

@AlexDaniel AlexDaniel added hyper/race NYI and removed hyper/race labels Oct 22, 2017

@AlexDaniel

This comment has been minimized.

Copy link
Member

commented Oct 22, 2017

a042fd9

@jnthn

This comment has been minimized.

Copy link
Member

commented Oct 25, 2017

They're simply NYI (which is the case for many things with hyper/race). FIRST should fire on the first element, and LAST on the last element, just as with a non-hyper loop. Batches shouldn't come in to it. The batch with the first element carries a flag indicating that, and it's the same for the batch with the last element. I don't think that we should need to make any guarantee that FIRST will run before iterations in another worker, nor that LAST will run after, since a loop with such order dependencies couldn't be parallelized anyway.

I suspect most situations where a LAST-IN-BATCH could be useful would generally be better done with a race reduce, which will be one of the next race-related things I implement (if nobody beats me to it).

@chee

This comment has been minimized.

Copy link

commented May 16, 2019

could this issue be considered closed now that it throws a X::NYI?

@lizmat

This comment has been minimized.

Copy link
Contributor

commented May 20, 2019

Yes, thanks for the nudge!

@lizmat lizmat closed this May 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.