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

Fix classification of some microkernels #151

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

Conversation

jprotze
Copy link
Contributor

@jprotze jprotze commented Sep 4, 2023

The two renamed benchmarks do not contain a data race.
DRB142 did not contain a data race. Removing the critical, adds back the intended data race.

Fix data race pairs for barrier3 kernel
@LChenGit
Copy link
Member

Hi @jprotze,

Thank you for the PR. For micro-benchmarks/DRB129-mergeable-taskwait-orig-no.c, What if the code is the following? Does it contain data races? Thank you!

#include <omp.h>
#include <stdio.h>
void func(int *x)
{
#pragma omp task mergeable
    {
        (*x)++;
    }
#pragma omp taskwait
}

int main()
{
    int x = 2;
#pragma omp parallel
    {
        func(&x);
    }
    printf("%d\n", x);
    return 0;
}

@LChenGit
Copy link
Member

LChenGit commented Sep 19, 2023

Hi @jprotze
Regarding micro-benchmarks/DRB142-acquirerelease-orig-yes.c, we think the original intention is to have thread 1 read variable x. Would changing y to x at line 41 correct the code and introduce the data race? Thank you!

@jprotze
Copy link
Contributor Author

jprotze commented Sep 19, 2023

Hi @jprotze Regarding micro-benchmarks/DRB142-acquirerelease-orig-yes.c, we think the original intention is to have thread 1 read variable x. Would changing y to x at line 41 correct the code and introduce the data race? Thank you!

The comment describes a different intent. The implicit flush for the atomic signalling on y does not introduce flush-synchronization for reading x. The problem of the initial code is that the critical region guarding the read of x in the if-statement does actually add the flush-synchronization. Removing the critical avoids this flush-synchronization and implements the issue described in the header of the file.

@jprotze
Copy link
Contributor Author

jprotze commented Sep 19, 2023

Your change suggested for DRB129 changes the test to a completely different test than documented in the comment. I think, the idea of the test is good. It is just not a data race.

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