Comments (3)
I have renamed the file name from DRB173-threadprivate-orig-no.c
to DRB173-threadprivate3-orig-no.c
. We already have DRB085-threadprivate-orig-no.c
with the same name and DRB091-threadprivate2-orig-no.c
. You might like to do this once you are done with Big table result and create a new PR.
from dataracebench.
As per my understanding of the code, I have simplified as below. There are a few questions, @chunhualiao please comment if my understanding is correct. x is a Threadprivate. That said, if we are using private(i,j,k)
, it will always result in j and k value as 0. The x[0] = -1.0
only for tid=0. For the rest of the tids it will be 0.0. The final j, k-values are quite indeterministic here. And more of it, it is not a correct execution.
//sample simplification to test - not correct
#include <omp.h>
#include <stdio.h>
static double x[20];
#pragma omp threadprivate(x)
int main(){
int i;
double j,k;
#pragma omp parallel for default(shared) private(i,j,k)
for (i = 0; i < 20; i++){
x[i] = -1.0;
j = x[0];
k = i+0.05;
}
printf ("%f %f\n", j, k);
return 0;
}
To have a data race free code, we can have something like below:
#include <omp.h>
#include <stdio.h>
static double x[20];
#pragma omp threadprivate(x)
int main(){
int i;
double j,k;
#pragma omp parallel for default(shared)
for (i = 0; i < 20; i++){
x[i] = -1.0;
if(omp_get_thread_num()==0){
j = x[0];
}
if(omp_get_thread_num()==0){
k = i+0.05;
}
}
printf ("%f %f\n", j, k);
return 0;
}
Please share your thoughts. or else can use copyprivate
, but that we already have; one such kernel.
from dataracebench.
We need @Yaying-llnl-summer to write down in the comment area about which variables in the benchmarks are exposing the tools' problems. Based on the information, we can then remove unnecessary variables.
@Yaying-llnl-summer The tests you are adding need
-
better commenting
-
removing unnecessary variables and statements
-
justification about the new ones are not just duplicating existing programs. The new ones exposing tools' new problems.
from dataracebench.
Related Issues (20)
- data races in smith-waterman code HOT 1
- Add verfication of data race reports in the test harness HOT 3
- doubts about high recall value for Intel inspector
- a potential paper HOT 1
- More metadata for existing tests for version and category information HOT 2
- getSourceRaceInfo.py and read/write sets HOT 1
- make a new release 1.4.0
- static tools: may vs. must analysis
- address paper review comments
- DRB136: possible wrong comments HOT 2
- merge pending pull requests
- ISCP project report
- a possible new pattern from NPB LU
- update dashboard based on the latest v1.4.0
- updating benchmark lists
- -q is not a gnu time flag HOT 3
- DRB181-SmithWaterman-yes.c uses abs with long HOT 2
- support C++ templates
- Survey Question on the For loop in source file micro-benchmarks/DRB178-input-dependence-var-yes.c line 41
- DRB189-barrier3-yes.c does not contain a data race HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataracebench.