Search found 803 matches

by MarkB
Tue Aug 11, 2020 8:31 am
Forum: Using OpenMP
Topic: Tasks executed by thread 0 only
Replies: 2
Views: 626

Re: Tasks executed by thread 0 only

There is no way to specify which thread executes a task. Most likely you do not need to restrict file I/O to thread 0, as long as you don't have multiple tasks/threads trying to write the same file concurrently. But a pattern like this might work for you: #pragma omp parallel { #pragma omp master { ...
by MarkB
Fri Jul 24, 2020 1:51 pm
Forum: Using OpenMP
Topic: loop
Replies: 1
Views: 1017

Re: loop

Where is normal_fact modified? (Your code snippet doesn't show this).
by MarkB
Thu Jun 18, 2020 2:41 am
Forum: Using OpenMP
Topic: OPENMP Performance Problem
Replies: 3
Views: 523

Re: OPENMP Performance Problem

The OpenMP runtime will create threads even though the parallel region does nothing, and these may well stay alive and consume CPU resources outside of the parallel regions. What could be happening is that the threads are being bound to the same core as the MPI process. You may need to set some flag...
by MarkB
Tue Jun 16, 2020 5:53 am
Forum: Using OpenMP
Topic: parallel http requests program
Replies: 1
Views: 337

Re: parallel http requests program

This is a rather unusual use case for OpenMP - normally it is used for compute intensive tasks. I think the performance of this code will be be very dependent on your I/O and network bandwidth.
by MarkB
Tue Jun 16, 2020 5:46 am
Forum: Using OpenMP
Topic: OPENMP Performance Problem
Replies: 3
Views: 523

Re: OPENMP Performance Problem

What are you using to measure the execution time?
by MarkB
Mon Jun 08, 2020 4:05 am
Forum: Using OpenMP
Topic: Parallel DO hangs 2nd time thru
Replies: 1
Views: 318

Re: Parallel DO hangs 2nd time thru

I would not be surprised if the (version of the) Intel compiler does not support mixing C++ threads and OpenMP in the same application in this way.
by MarkB
Mon May 25, 2020 6:46 am
Forum: Using OpenMP
Topic: Issue with CPU affinity in teams in OpenMP 5.0
Replies: 1
Views: 472

Re: Issue with CPU affinity in teams in OpenMP 5.0

In OpenMP 5.0, binding of (the initial thread of) teams to places (i.e. sockets, cores. hardware threads) is left up to the implementation - see lines 29-31 on page 83. I'm not aware of any compiler-specific support for this in gcc. Is using nested parallel regions not a possible solution for your u...
by MarkB
Tue May 19, 2020 3:06 am
Forum: Using OpenMP
Topic: How to parallelize a recursive function
Replies: 8
Views: 1103

Re: How to parallelize a recursive function

But other threads’ job is directly depended on this thread. They will never touch “return true” statement (can’t complete assigning values to all grids of matrix) if that thread doesn’t return and revise its value. In this way, the code gets stuck in a dead-end. Sorry, I don't really understand - "...
by MarkB
Sun May 17, 2020 8:01 am
Forum: Using OpenMP
Topic: How to parallelize a recursive function
Replies: 8
Views: 1103

Re: How to parallelize a recursive function

PSK wrote:Shall I follow the idea of using flags again here (along with cancellation directive)?
Yes, you will still need to use flags - it's not permitted to jump out of a parallel region.
by MarkB
Fri May 15, 2020 2:52 am
Forum: Using OpenMP
Topic: CPU-GPU Asynchronous execution
Replies: 1
Views: 498

Re: CPU-GPU Asynchronous execution

You can use the nowait clause on the target construct to make the target region execute asynchronously, and then (if required) wait for completion in the same way as you would for a task region (e.g. with taskwait).