Permalink
Browse files

debugging

  • Loading branch information...
1 parent 1c63895 commit 084d4fb05f9fbb3b108bd9288e4edb7cde0651c8 @strassek strassek committed Jun 29, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 primes_mpi_pthread/prime.c
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
MPI_Comm_size(MPI_COMM_WORLD, &mpiSize);
MPI_Get_processor_name(processor_name, &namelen);
- fprintf(stderr, "Process %d started on host %s.\n", mpiRank, processor_name);
+ printf("Process %d started on host %s.\n", mpiRank, processor_name);
if (!mpiRank){
if (argc > 2){
@@ -119,7 +119,8 @@ int main(int argc, char *argv[])
if (!mpiRank){
- tPrimeCount++; //because we skip 2
+ FinalPrimeCount++; //because we skip 2
+ FinalPrimeCount += tPrimeCount;
for(i=1;i<mpiSize;i++){
MPI_Recv(&tPrimeCount, 1, MPI_INT, i, TAG_INIT, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
FinalPrimeCount += tPrimeCount;

0 comments on commit 084d4fb

Please sign in to comment.