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

src,test: fix some bugs around ivar recovery and pos splits #499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rohany
Copy link
Contributor

@rohany rohany commented Jan 2, 2022

This commit fixes several bugs around the recovery of index variables
when splits/divides of the position spaces are involved. In particular,
the old code would emit position loops like

for (int jposo = A2_pos[i] / chunkSize; jposo < (A2_pos[i+1] + (chunkSize - 1)) / chunkSize; jposo++) {
  for (int jposi = 0; jposi < chunkSize; jposi++) {
    int jposA = jposo * chunkSize + jposi;
    ...
  }
}

This does not correctly iterate over the position space. A correct code is:

for (int jposo = 0; jposo < ((A2_pos[i+1] - A2_pos[i]) + (chunkSize - 1)) / chunkSize; jposo++) {
  for (int jposi = 0; jposi < chunkSize; jposi++) {
    int jposA = jposo * chunkSize + jposi + A2_pos[i];
    ...
  }
}

@rohany rohany changed the title src,test: fix some bugs around ivar recovery and pos splits [WIP,DNM]: src,test: fix some bugs around ivar recovery and pos splits Jan 2, 2022
This commit fixes several bugs around the recovery of index variables
when splits/divides of the position spaces are involved. In particular,
the old code would emit position loops like
```
for (int jposo = A2_pos[i] / chunkSize; jposo < (A2_pos[i+1] + (chunkSize - 1)) / chunkSize; jposo++) {
  for (int jposi = 0; jposi < chunkSize; jposi++) {
    int jposA = jposo * chunkSize + jposi;
    ...
  }
}
```
This does not correctly iterate over the position space. A correct code is:
```
for (int jposo = 0; jposo < ((A2_pos[i+1] - A2_pos[i]) + (chunkSize - 1)) / chunkSize; jposo++) {
  for (int jposi = 0; jposi < chunkSize; jposi++) {
    int jposA = jposo * chunkSize + jposi + A2_pos[i];
    ...
  }
}
```
@rohany rohany changed the title [WIP,DNM]: src,test: fix some bugs around ivar recovery and pos splits src,test: fix some bugs around ivar recovery and pos splits Jan 2, 2022
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.

1 participant