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

ParFORM redefine bug with more than one expressions #525

Open
tueda opened this issue May 23, 2024 · 1 comment · May be fixed by #530
Open

ParFORM redefine bug with more than one expressions #525

tueda opened this issue May 23, 2024 · 1 comment · May be fixed by #530
Labels
bug Something isn't working

Comments

@tueda
Copy link
Collaborator

tueda commented May 23, 2024

Minimized example from the ParFORM issue in #524.

mpirun -np 3 parform freezes with the following input:

L F1 = 1;
L F2 = 1;
.sort
#define flag "0"
if (expression(F1)) redefine flag "1";
.sort
#if `flag'
.sort
#endif
.end
@tueda tueda added the bug Something isn't working label May 23, 2024
@tueda
Copy link
Collaborator Author

tueda commented May 28, 2024

There are 3 basic strategies to handle redefine in parallelisation:

  1. Modify a redefined preprocessor variable with synchronisation, as TFORM does.
  2. Synchronise redefined preprocessor variables at the end of processing each expression.
  3. Synchronise redefined preprocessor variables at the end of a module.

The current implementation of ParFORM tries to adopt option 3 for efficiency while at the same time trying to resemble TFORM code to share some variables and code (see also 23285ec). As a result(?), it gathers redefined variables after each expression is processed, and broadcasts them at the end of the module. But, with more than one expression, the information gathered after finishing an expression that indicates which variables are redefined (stored in AC.inputnumbers on the rank 0 process) is cleared at the beginning of processing the next expression (in DoExecute()).

A natural solution would be to move the broadcast to the end of processing each expression, rather than the end of the module.

It may be an option to gather redefined variables at the end of the module (and then broadcast them), but then the meaning of inputnumbers (is the last ninterms, which is reset at the beginning of processing each expression) becomes more obscure.

tueda added a commit to tueda/form that referenced this issue May 28, 2024
Redefined variables must be broadcast after processing each expression.
Otherwise, the information collected in AC.inputnumbers is wiped out
at the beginning of processing the next expression.

This fixes vermaseren#525.
@tueda tueda linked a pull request May 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant