Skip to content

PARPACK: Initialize machine dependent constants only once in PDNAITR - #483

Merged
fghoussen merged 1 commit into
opencollab:masterfrom
mmuetzel:parpack
Aug 1, 2026
Merged

PARPACK: Initialize machine dependent constants only once in PDNAITR#483
fghoussen merged 1 commit into
opencollab:masterfrom
mmuetzel:parpack

Conversation

@mmuetzel

Copy link
Copy Markdown
Contributor

Pull request purpose

The current implementation checks the value of the variable aitr_first but sets first.

Detailed changes proposed in this pull request

Change that to set aitr_first to false after the initialization has run.

This also brings that part of the implementation of PDNAITR in line with the corresponding logic that is used in the implementation of the other P?NAITR.

@mergify

mergify Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@fghoussen

Copy link
Copy Markdown
Collaborator

Looks relevant. Do this triggered problems at you r side?
Can you rebase?

The current implementation checks the value of the variable `aitr_first` but
sets `first`.

Change that to set `aitr_first` to false after the initialization has run.

This also brings that part of the implementation of `PDNAITR` in line with
the corresponding logic that is used in the implementation of the other
`P?NAITR`.
@mmuetzel

mmuetzel commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing.

No, I didn't see any actual problems.
We stumbled across that while checking if ElmerFEM could switch to ARPACK-ng. Currently, it is using an older version of the original ARPACK/PARPACK with some local changes for issues that have been found with that version. The developers wanted to make sure that the potential switch to ARPACK-ng wouldn't cause regressions when it comes to those local changes. (It wouldn't. So, ARPACK-ng is a good contender for ElmerFEM.)

While at that, I skimmed some of the source files of ARPACK-ng and came across this inconsistency.
Very likely, it isn't noticeable by any user of ARPACK-ng. At the worst, it currently causes a (very) slight slowdown when pdlamch10 is called when it isn't necessary. But calling that function isn't very costly afaict.
The current implementation looks like the intension was to avoid calling pdlamch10 repeatedly. The current behavior is probably just caused by a typo. (That interpretation is also supported by the fact that the implementations for the other P?NAITR set the "expected" variable.)

@fghoussen

fghoussen commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Very likely, it isn't noticeable by any user of ARPACK-ng.
looks like the intension was to avoid calling pdlamch10 repeatedly. The current behavior is probably just caused by a typo.

OK. Indeed, it sounds like what my first impressions were when grepping/reviewing the code.

@mmuetzel

Copy link
Copy Markdown
Contributor Author

OK. Indeed, it sounds like what my first impressions were when grepping/reviewing the code.

So, do you agree that this can be merged as-is?

@fghoussen

Copy link
Copy Markdown
Collaborator

do you agree that this can be merged as-is?

I guess yes. Is the patch complete?

@mmuetzel

mmuetzel commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Is the patch complete?

As far as I can tell, this one line change is all that is needed.
Do you think that more than that needs to change?

@fghoussen
fghoussen merged commit 6ae2072 into opencollab:master Aug 1, 2026
23 checks passed
@fghoussen

Copy link
Copy Markdown
Collaborator

@mmuetzel: thanks!

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.

2 participants