Bug #2678

OpenMP sections in GObservations::likelihood::eval

Added by Cardenzana Josh over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:09/17/2018
Priority:NormalDue date:
Assigned To:Cardenzana Josh% Done:

100%

Category:-Estimated time:0.50 hour
Target version:1.6.0
Duration:

Description

There’s an OpenMP 'sections’ specifier in 'GObservations::likelihood::eval()'. However, the pragma does not actually do anything because it’s not wrapped in a 'omp parallel' section. This means that the individual sections are not executed in parallel, which I presume is the intention. However, if the analysis is used in another applications that implements an omp parallel' at a higher level, this can cause problems.

I’m seeing the above issue when I try to run multiple ctlike fits in parallel as part of the survey pipeline. One of the analyses enters this section and ultimately gets locked in one of the omp section blocks. The end result is that the program freezes using no cores, but not progressing. This is still an issue even after turning off nested parallelism.

The suggested change is to change the following line:

#pragma omp sections

to

#pragma omp parallel sections

This should identify this as a parallel section, triggering the appropriate parallelization when necessary, and properly handle the parallelism when nested in another parallel section.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 5 years ago

  • Target version set to 1.6.0

Great catch. Can you make a patch for this bug so that I can merge it in the code?

#2 Updated by Cardenzana Josh over 5 years ago

I’ve made the change. It’s pretty straight forward, so I don’t think there’s much to show for the results. All current tests still pass.

Pull branch:
Josh Cardenzana/gammalib: 2678-gobservations_omp_sections

#3 Updated by Knödlseder Jürgen over 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Merged into devel.

Also available in: Atom PDF