[Openmp-dev] Another bug in LLVM OpenMP runtime when compiled in debug mode and exercised using the GNU API

John Mellor-Crummey johnmc at rice.edu
Tue Jul 14 09:33:42 PDT 2015


Yesterday, I posted an OpenMP fatal assertion when compiled in debug mode. Here is another. As I stated yesterday, I would file this bug with bugzilla, but I can’t figure out where the OpenMP bugs should go. If someone could enlighten me, I’d be grateful.

Compiling the code below with g++ and linking it to the LLVM OpenMP runtime compiled in debug mode produces a fatal error.

The program:

#include <inttypes.h>
#include <stdio.h>
#include <omp.h>

#define NTHREADS 8
#define NBOUND 40 

uint64_t result[NBOUND]; 

uint64_t fib(int n) 
{
  if (n < 2) return n;
  else return fib(n-1) + fib(n-2);
}

void testparallel()
{
#pragma omp parallel num_threads(NTHREADS) 
  {
#pragma omp for
    for(int i = 0; i < NBOUND; i++)  result[i] = fib(40);
  }
}

void teststatic()
{
#pragma omp parallel for schedule(static)
  for(int i = 0; i < NBOUND; i++) result[i] += fib(40);
}

int main(int argc, char **argv)
{
  int i;

  testparallel();
  teststatic();

  for(i=0;i< NBOUND;i++) printf("%lld ", result[i]);
  printf("\n");
}

The error:

Assertion failure at kmp_runtime.c(2089): master_th->th.th_task_team == parent_team->t.t_task_team[master_th->th.th_task_state].
OMP: Error #13: Assertion failure at kmp_runtime.c(2089).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see http://www.intel.com/software/products/support/.

This assertion triggers on both the PPC64 and Intel64 architectures on which I tested it.

When the runtime is not compiled in debug mode, the program runs successfully to completion and produces the same answer as the sequential code.

While the assertion triggers when executing teststatic(), removing the prior call to testparallel() makes the assertion disappear.
--
John Mellor-Crummey         Professor
Dept of Computer Science    Rice University
email: johnmc at rice.edu <mailto:johnmc at rice.edu>      phone: 713-348-5179

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20150714/b80ae781/attachment.html>


More information about the Openmp-dev mailing list