struggling wtih Pthreads. MPI program cannot handle too many threads