Problem on ARM

Problem on ARM

Hi

I have successfully cross compiled libiomp5.so for ARM using clang and arm-linux-gnueabihf toolchain. Then I cross compiled a simple openmp program with libiomp5.so. But when I tried to run the program on ARM, I got a problem. The program is:

#include
#include
#include
int main(int argc, char** argv)
{
int i = 0;
#pragma omp parallel for
for(i = 0; i < 10; i++) {
int tid = omp_get_thread_num();
printf("hello from thread %d\n", tid);
}
return 0;
}

The output is:

hello from thread 0
hello from thread 0
hello from thread 2
hello from thread 2
hello from thread 1
hello from thread 1
hello from thread 3
hello from thread 3
hello from thread 4
hello from thread 4
pthread_mutex_lock.c:80: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
Aborted

Can someone provide some help?

Thanks!

Xiaokang

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Sorry! The Ctrl+C and Ctrl+V have lost the headers. The first 3 lines of the program are:

#include <stdio.h>

#include <stdlib.h>

#include <omp.h>

hello,

it looks there are problems with atomics implementation in case they are implemented at all.

--Vladimir

Leave a Comment

Please sign in to add a comment. Not a member? Join today