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

Create SharedArray from disk file #12560

Merged
merged 5 commits into from
Aug 12, 2015
Merged

Create SharedArray from disk file #12560

merged 5 commits into from
Aug 12, 2015

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented Aug 11, 2015

The third commit here allows you to share data from a pre-existing disk file (or a newly-created one) across all workers.

The first commit is just a cleanup (and net code deletion): it leverages #10525 for indexing, and makes all fields of a SharedArray concrete (I think the important ones were already). The second is #12423 without the documentation changes (because docs can always be added later, and we're in a bit of doc-paralysis at the moment). That commit should still be good even after this merges.

CC @amitmurthy

workermode = mode == "w+" ? "r+" : mode # workers don't truncate!

# Ensure the file will be readable
mode in ("r", "r+", "w+", "a+") || error("mode must be readable, but I got $mode")
Copy link
Member

Choose a reason for hiding this comment

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

can these be ArgumentError's? Also, using a personal pronoun in an error message is a bit weird.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Good points all round, will fix.

@timholy
Copy link
Sponsor Member Author

timholy commented Aug 12, 2015

OK, the remaining AppVeyor error seems unrelated (LoadError("C:\\projects\\julia\\test\\pollfd.jl",112,ErrorException("test failed: Any[] == [1]\n in expression: a == [1]"))). The one oddity is that the mmap code throws different error types on Windows vs Unix. Is this something we should harmonize, or is the split in testing fine?

@timholy timholy mentioned this pull request Aug 12, 2015
@tkelman
Copy link
Contributor

tkelman commented Aug 12, 2015

Where are the throws coming from? If it's really the same condition then it would make sense to me to make it the same exception type if that's not much work.

timholy added a commit that referenced this pull request Aug 12, 2015
Create SharedArray from disk file
@timholy timholy merged commit c6283a1 into master Aug 12, 2015
@timholy timholy deleted the teh/shared_file branch August 12, 2015 20:44

# Mapping an existing file
fn = tempname()
open(fn, "w") do io
Copy link
Contributor

Choose a reason for hiding this comment

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

these should probably clean up after themselves when they're done

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Fixed in 13846e5

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.

3 participants