title: MPI processes causes pthreads to execute sequentially
body: <p>I wrote down an MPI/pthread hybrid code and I execute it on a cluster. Specifically, I compile it using mpicc -lpthread and launch 2 MPI processes on different nodes (6 nodes total, with 8 cores per node) using mpirun -np 2 -bynode and then create 8 threads on each node. However, the threads do not execute in parallel and they follow a sequential execution?</p>
  
  <p>Parts of my code:</p>
  
  <pre><code>        MPI_Init(&amp;argc, &amp;argv);
          MPI_Comm_size(MPI_COMM_WORLD, &amp;numtasks);
          MPI_Comm_rank(MPI_COMM_WORLD, &amp;taskid);
          MPI_Get_processor_name(hostname, &amp;len);
          // more code between these..
          pthread_create(&amp;thread_id, NULL, &amp;sort, (void*) arrays[0]);
          pthread_create(&amp;thread_id2, NULL, &amp;sort, (void*) arrays[1]);
  </code></pre>