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

Rename handful of BigInteger functions and deprecate get_str #22818

Merged
merged 15 commits into from
Aug 1, 2023

Conversation

jabraham17
Copy link
Member

@jabraham17 jabraham17 commented Jul 26, 2023

Summary of changes

  • rename scan0/scan1 to findNext0/findNext1 and update its documentation
  • rename popcount to popCount and update its documentation
  • rename ior to or and update its argument names and documentation
  • rename rootrem/sqrtrem to rootRem/sqrtRem and update its argument names and documentation
  • rename addmul/submul to addMul/subMul and update its argument names and documentation
  • deprecate get_str in favor of casting to a string or using writeThis
  • Removed previously deprecated scan0 and scan1
    • these have been deprecated for some time, removing them now as they are not used anymore and it allows for cleaner docs

New tests

  • adds test/deprecated/BigInteger/scan01.chpl
  • adds test/deprecated/BigInteger/ior.chpl
  • adds test/deprecated/BigInteger/popcount.chpl
  • adds test/deprecated/BigInteger/rootSqrtRem.chpl
  • adds test/deprecated/BigInteger/addSubMul.chpl
  • adds test/deprecated/BigInteger/deprecateGet_str.chpl
  • adds test/library/standard/BigInteger/getStr.chpl
  • removes test/deprecated/BigInteger/deprecateScanArg.chpl

Testing

  • paratest with futures
  • paratest + gasnet
  • built and checked docs

[Reviewed by @bmcdonald3]

closes #17737
closes #19389
implements remaining topics from #17724, closes #17724
closes cray/chapel-private#5097

@jabraham17 jabraham17 changed the title Rename handlful of BigInteger functions and deprecate get_str Rename handful of BigInteger functions and deprecate get_str Jul 26, 2023
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
@jabraham17 jabraham17 marked this pull request as ready for review July 28, 2023 14:53
Copy link
Member

@bmcdonald3 bmcdonald3 left a comment

Choose a reason for hiding this comment

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

Apologize for the nit picking on the documentation! Looks good for the most part.

Comment on lines +519 to +521
// private method
@chpldoc.nodoc
proc getStr(base: int = 10): string {
Copy link
Member

Choose a reason for hiding this comment

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

Should we make this a private proc?

Copy link
Member Author

@jabraham17 jabraham17 Jul 31, 2023

Choose a reason for hiding this comment

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

That unfortunately requires it no longer being a method

Comment on lines 523 to 525
if compiledForSingleLocale() {
var tmpvar = chpl_gmp_mpz_get_str(base_, this.mpz);

try! {
ret = string.createAdoptingBuffer(tmpvar);
}

} else if this.localeId == chpl_nodeID {
if compiledForSingleLocale() || this.localeId == chpl_nodeID {
Copy link
Member

Choose a reason for hiding this comment

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

I think the compiledForSingleLocale() is a param, so that is why these were separated out into different branches. It's difficult to say if that is important, but that's why this was here originally. Now, in single locale configurations, we will have the branch and construction of the locale object since we can't fold that out, which can cause some overhead.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did test compiling this in a single locale configuration and it does not generate the extra check (looking at AST for 'codegen' pass). It is short enough code that I can also just put it back

modules/standard/BigInteger.chpl Outdated Show resolved Hide resolved
modules/standard/BigInteger.chpl Outdated Show resolved Hide resolved
modules/standard/BigInteger.chpl Outdated Show resolved Hide resolved
@jabraham17 jabraham17 merged commit d16e270 into chapel-lang:main Aug 1, 2023
7 checks passed
@jabraham17 jabraham17 deleted the bigint-rename-bundle branch August 1, 2023 21:29
jabraham17 added a commit that referenced this pull request Jan 11, 2024
Removes almost all of the remaining BigInteger deprecations

This PR removes the deprecations from the following PRs I authored
- #22775
- #22888/#22774
- #22818
- #22794
- #22788
- #22121

I also removed the remaining deprecations done by Yash Raj
- #18855
- #18827

I moved one test out of the deprecated/BigInteger directory,
`bigint_getlimbs.chpl`, since its not a deprecation test and actually
checks functionality.


Testing
- [x] paratest without comm
- [x] paratest with comm
- [x] built docs and checked them

[Reviewed by @ShreyasKhandekar]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants