I have a functioning implementation of a MPI routine, which works fine. In the process of making this a hybrid between MPI and shared memory, I am using pthreads. This in turn proofed the need of pthread_barriers.
But when I try to compile my code with the mpicc compiler, it complains over pthread_barrier_t and other barrier commands. If I remove these, and keep other threading parts it compiles just fine.
This is the line of code I insert to break the compilation:
pthread_barrier_t* barrier;
And for compilation I use:
mpicc -lm myprogram.c -o myprogram
The error returned from the compiler is:
myprogram.c:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
Where line 34 corresponds to what I wrote above.
[Edit] I am runnings this on Ubuntu 9.10, with the following gcc/mpicc compiler: gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1. [/Edit]
Does anyone know what could be wrong and how I can make it compile?
Cheers!