Search found 135 matches

by lfm
Tue Mar 08, 2011 9:26 am
Forum: Draft 3.1 Public Comment
Topic: About reduction clause
Replies: 3
Views: 28438

Re: About reduction clause

There are at least three reasons that this shouldn't be a restriction: - It can't in general be checked at compile time - The obvious implementations are unable to enforce such a restriction - We want to leave the door open for future extensions for user-defined reductions The opinion of the ARB is ...
by lfm
Sun Sep 12, 2010 9:47 am
Forum: Using OpenMP
Topic: how to control this process to let it wait
Replies: 6
Views: 6599

Re: how to control this process to let it wait

Well, I think that the argument about size and time is completely wrong. First, it seems like you're setting up a pipeline. So you don't need a lock per array element, you need a lock per thread and maybe a flag variable per thread. You're just trying to emulate MPI message passing except that you d...
by lfm
Sun Sep 12, 2010 9:40 am
Forum: Using OpenMP
Topic: runtime increases with number of threads
Replies: 9
Views: 13226

Re: runtime increases with number of threads

Sorry, I didn't read the code close enough. I see that you're using omp_get_wtime. There's a couple of things going on: - The first loop is store-bandwidth bound. Depending on your hardware you might get some speedup but it is really dependent on hardware, and multi-core chips with shared caches don...
by lfm
Sun Sep 12, 2010 8:32 am
Forum: Using OpenMP
Topic: runtime increases with number of threads
Replies: 9
Views: 13226

Re: runtime increases with number of threads

It could be memory bandwidth but this code looks like it should scale.

How are you timing it? You want to look at elapsed time (wallclock time)
by lfm
Sun Sep 12, 2010 8:28 am
Forum: Using OpenMP
Topic: Hi. Can i parallelize these multiple loop? How i can???
Replies: 6
Views: 6841

Re: Hi. Can i parallelize these multiple loop? How i can???

Sorry, I don't understand the question.
by lfm
Sat Sep 11, 2010 9:14 am
Forum: Using OpenMP
Topic: need of help for very simple problem
Replies: 2
Views: 3649

Re: need of help for very simple problem

There's a data race on sum=sum+i2

Fortunately this is a reduction so it should work if you add:
reduction(+:sum)
to the clases on the PARALLEL DO directive

-- Larry
by lfm
Sat Sep 11, 2010 9:11 am
Forum: Using OpenMP
Topic: Hi. Can i parallelize these multiple loop? How i can???
Replies: 6
Views: 6841

Re: Hi. Can i parallelize these multiple loop? How i can???

Maybe: #pragma omp parallel for collapse(2) reduction(+:cc, +:nca) outside the outermost loop I didn't see a reference to nca in the loop. But I think this is a legal parallelization. Hope I got the syntax right. If your compiler doesn't support the collapse clause you could simulate it yourself or ...
by lfm
Sat Sep 11, 2010 9:06 am
Forum: Using OpenMP
Topic: openmp task based application translation support
Replies: 4
Views: 5136

Re: openmp task based application translation support

I think there's a couple of source-to-source compilers out there: omni (though it may not be maintained) out of Japan ROSE out of Lawrence Livermore Barcelona http://www.upc.edu/ -- not sure what the project is called OpenUH (University of Houston) based on Open64 Are you sure gcc doesn't support yo...
by lfm
Sat Sep 11, 2010 8:56 am
Forum: Using OpenMP
Topic: how to control this process to let it wait
Replies: 6
Views: 6599

Re: how to control this process to let it wait

You could do something with locks: Producer: omp_set_lock(&lock_var); flag = 1; omp_unset_lock(&lock_var); Consumer: for (;;) { omp_set_lock(&lock_var); if (flag == 1) { omp_unset_lock(&lock_var); break; } omp_unset_lock(&lock_var); } Something like that. This is sort of like condition variables. Yo...
by lfm
Wed Jun 30, 2010 12:38 pm
Forum: Using OpenMP - The Book and Examples
Topic: How to use with distributed memory
Replies: 2
Views: 12904

Re: How to use with distributed memory

You need some kind of software that makes your cluster look like a shared memory machine. OpenMP does not address distributed memory programming. You could, of course, use OpenMP+MPI.