Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Make it impossible to construct irregular ParallelArrays #53

Open
lkuper opened this issue Feb 11, 2015 · 0 comments
Open

Make it impossible to construct irregular ParallelArrays #53

lkuper opened this issue Feb 11, 2015 · 0 comments

Comments

@lkuper
Copy link
Contributor

lkuper commented Feb 11, 2015

Right now, it is possible to do things like:

var pa = new ParallelArray([[0, 1], [2]]);

In the compiler, this will cause createFlatArray to emit a complaint:

"flattenArray:" "shape mismatch: level 1 expected 2 found 1"

but it won't actually fail; it will go ahead and create pa. Such a ParallelArray is pretty useless. We should probably just prevent them from being created in the first place. (The tutorial already claims that they are "not allowed" -- we should make it so.)

Related: if we get rid of the ability to construct irregular ParallelArrays, then there will be no way (that I know of) to construct a ParallelArray that has false as its flat attribute. All regular ParallelArrays are backed by a single TypedArray and therefore flat: true. So if we disallow irregular ParallelArrays then we can also get rid of any code that deals with flat: false arrays (such as in toString, for example).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant