Search found 5 matches

by muphof
Mon Apr 08, 2013 3:55 pm
Forum: OpenMP 4.0 Public Review Release Candidates
Topic: Objects with dynamic storage duration are shared
Replies: 2
Views: 27740

Re: Objects with dynamic storage duration are shared

Hi, Thank you for your answer. I am still somewhat unclear about your reply. First off, I updated the compiler: g++-mp-4.7 --version g++-mp-4.7 (MacPorts gcc47 4.7.2_2) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. which got rid of the error message as you pointed out. Thank you. I underst...
by muphof
Sun Apr 07, 2013 10:04 pm
Forum: OpenMP 4.0 Public Review Release Candidates
Topic: Objects with dynamic storage duration are shared
Replies: 2
Views: 27740

Objects with dynamic storage duration are shared

Hi, I am quoting p. 123 of the specifications. I cannot understand the purpose of this statement. Assume I use a pointer for a dynamically allocated object as in: int * x = new int[10]; #pragma omp parallel private(x) { int tid = omp_get_thread_num(); x = new int; *x = tid; sleep(1); printf("tid, x ...
by muphof
Thu Mar 28, 2013 11:07 am
Forum: OpenMP 4.0 Public Review Release Candidates
Topic: flush: example A.2.2.c p. 225
Replies: 5
Views: 30640

Re: flush: example A.2.2.c p. 225

OK. I got it. What I was not seeing is that it is possible for flag to become >= 1 without doing the flush on line 31. In that case, you may not see the update on data. However since at that point thread 0 must have moved past line 18, the second flush by thread 1 on line 35 will force a read on dat...
by muphof
Thu Mar 28, 2013 9:35 am
Forum: OpenMP 4.0 Public Review Release Candidates
Topic: flush: example A.2.2.c p. 225
Replies: 5
Views: 30640

Re: flush: example A.2.2.c p. 225

Hi Mark, Thank you for your explanation. It does help answer the first part of my question. I understand that if writes and reads are not atomic, the value of flag is indeed undefined. However let us consider the case of data=42 now. The specification claims that data is undefined at line 34. Let's ...
by muphof
Wed Mar 27, 2013 4:39 pm
Forum: OpenMP 4.0 Public Review Release Candidates
Topic: flush: example A.2.2.c p. 225
Replies: 5
Views: 30640

flush: example A.2.2.c p. 225

This regards Version 4.0 - RC 2 - March 2013 Public Review Release Candidate 2. This example is a bit puzzling. I have looked for an explanation on forums but I could not find anything. This is the example illustrating pitfalls with flush. As far as I can tell, flag at any given time can only be equ...