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

[Unimplemented feature]: Support zippering sets with other types #26627

Closed
lydia-duncan opened this issue Jan 30, 2025 · 1 comment
Closed

[Unimplemented feature]: Support zippering sets with other types #26627

lydia-duncan opened this issue Jan 30, 2025 · 1 comment

Comments

@lydia-duncan
Copy link
Member

Summary of Problem

Description:
This issue is split off of #15824 after the work in #26595 improved how sets zipper with other sets. Trying to zip a set with an array or range (for instance) results in either:

rank mismatch in zippered iteration (can't zip a 3D expression with a <type>, which is 1D)

when the set is the leader (due to the set providing more information in its followThis than the other type is expecting) or:

error: zippered iterations have non-equal lengths

when the set is the follower (due to the other type sending in less information in its followThis than the set needs to appropriately divide the work).

Using the toArray() method on the set is a workaround for this, but it would be nice to use the set as is and not have to pay that memory cost.

Is this issue currently blocking your progress?
no

Steps to Reproduce

Source Code:

use Set;

var LocalSet= new set(int,parSafe = true);
LocalSet.add(1);
LocalSet.add(2);
LocalSet.add(3);
LocalSet.add(4);
LocalSet.add(5);

var A : [0..4] int;
writeln(A.size, " ", LocalSet.size);
forall (a,b) in zip(A,LocalSet) {
    a=b;
}
writeln(A);

Compile command:
chpl foo.chpl

Execution command:
./foo

Associated Future Test(s):
test/library/standard/Set/zippering/arrayShorter2.chpl #26595
test/library/standard/Set/zippering/withArray1.chpl #26595
test/library/standard/Set/zippering/withArray2.chpl #26595
test/library/standard/Set/zippering/withArrayLonger1.chpl #26595
test/library/standard/Set/zippering/withRange1.chpl #26595
test/library/standard/Set/zippering/withRange2.chpl #26595

Configuration Information

  • Output of chpl --version: 2.4.0 pre-release
  • Output of $CHPL_HOME/util/printchplenv --anonymize: any
  • Back-end compiler and version, e.g. gcc --version or clang --version: any
  • (For Cray systems only) Output of module list: N/A
@lydia-duncan
Copy link
Member Author

Never mind, Brad had a better solution

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

No branches or pull requests

1 participant