Skip to content

Conversation

@polarker
Copy link
Contributor

@polarker polarker commented Oct 9, 2015

While Array supports these kind of constructors: Array{Int}(100), SharedArray does not have.

@kshyatt kshyatt added the parallelism Parallel or distributed computation label Oct 10, 2015
Copy link
Member

Choose a reason for hiding this comment

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

Just an FYI: this and the next two are just for getting rid of the splatting penalty. For a SharedArray, there's sufficient overhead for creation that this is probably negligible, so these probably aren't really necessary. However, neither do they hurt anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My original intention was to make ShareArray have the same interface as Array, since I am writing a library using both with type parameters. My fix is kind of naive. And Kevin Squire said in the user group that there could be deeper and cleaner than falling back to SharedArray(T, x), maybe someone could improve later.

@timholy
Copy link
Member

timholy commented Oct 11, 2015

Looks nice, and thanks for the contribution!

Could I ask you to add tests for the new constructors? That will reduce the likelihood that any future changes will break your new addition.

jakebolewski added a commit that referenced this pull request Oct 14, 2015
Make the constructors of Array and SharedArray consistent
@jakebolewski jakebolewski merged commit d35e69c into JuliaLang:master Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parallelism Parallel or distributed computation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants