Index: Pi/C/Hybrid/Pi_Hybrid.c
===================================================================
--- Pi/C/Hybrid/Pi_Hybrid.c	(revision 124)
+++ Pi/C/Hybrid/Pi_Hybrid.c	(revision 125)
@@ -43,129 +43,132 @@
 #endif
 
 typedef struct compute_node {
-        LENGTH iterations;
-        int process;
+  LENGTH iterations;
+  int process;
 } node;
 
+typedef struct compute_result {
+  LENGTH inside;
+  long int useconds;
+} result;
+
 unsigned int rotl(unsigned int value, int shift) {
-    return (value << shift) | (value >> (sizeof(value) * CHAR_BIT - shift));
+  return (value << shift) | (value >> (sizeof(value) * CHAR_BIT - shift));
 }
- 
+
 unsigned int rotr(unsigned int value, int shift) {
-    return (value >> shift) | (value << (sizeof(value) * CHAR_BIT - shift));
+  return (value >> shift) | (value << (sizeof(value) * CHAR_BIT - shift));
 }
 
 LENGTH MainLoopGlobal(LENGTH iterations,unsigned int seed_w,unsigned int seed_z)
 {
-
+  
 #if defined TCONG
-   unsigned int jcong=seed_z;
+  unsigned int jcong=seed_z;
 #elif defined TSHR3
-   unsigned int jsr=seed_w;
+  unsigned int jsr=seed_w;
 #elif defined TMWC
-   unsigned int z=seed_z;
-   unsigned int w=seed_w;
+  unsigned int z=seed_z;
+  unsigned int w=seed_w;
 #elif defined TKISS
-   unsigned int jcong=seed_z;
-   unsigned int jsr=seed_w;
-   unsigned int z=seed_z;
-   unsigned int w=seed_w;
+  unsigned int jcong=seed_z;
+  unsigned int jsr=seed_w;
+  unsigned int z=seed_z;
+  unsigned int w=seed_w;
 #endif
    
-   LENGTH total=0;
-
-   for (LENGTH i=0;i<iterations;i++) {
-
+  LENGTH total=0;
+  
+  for (LENGTH i=0;i<iterations;i++) {
+    
 #if defined TINT32
-    #define THEONE 1073741824
-    #if defined TCONG
-        unsigned int x=CONG>>17 ;
-        unsigned int y=CONG>>17 ;
-    #elif defined TSHR3
-        unsigned int x=SHR3>>17 ;
-        unsigned int y=SHR3>>17 ;
-    #elif defined TMWC
-        unsigned int x=MWC>>17 ;
-        unsigned int y=MWC>>17 ;
-    #elif defined TKISS
-        unsigned int x=KISS>>17 ;
-        unsigned int y=KISS>>17 ;
-    #endif
+#define THEONE 1073741824
+#if defined TCONG
+    unsigned int x=CONG>>17 ;
+    unsigned int y=CONG>>17 ;
+#elif defined TSHR3
+    unsigned int x=SHR3>>17 ;
+    unsigned int y=SHR3>>17 ;
+#elif defined TMWC
+    unsigned int x=MWC>>17 ;
+    unsigned int y=MWC>>17 ;
+#elif defined TKISS
+    unsigned int x=KISS>>17 ;
+    unsigned int y=KISS>>17 ;
+#endif
 #elif defined TINT64
-    #define THEONE 4611686018427387904
-    #if defined TCONG
-        unsigned long x=(unsigned long)(CONG>>1) ;
-        unsigned long y=(unsigned long)(CONG>>1) ;
-    #elif defined TSHR3
-        unsigned long x=(unsigned long)(SHR3>>1) ;
-        unsigned long y=(unsigned long)(SHR3>>1) ;
-    #elif defined TMWC
-        unsigned long x=(unsigned long)(MWC>>1) ;
-        unsigned long y=(unsigned long)(MWC>>1) ;
-    #elif defined TKISS
-        unsigned long x=(unsigned long)(KISS>>1) ;
-        unsigned long y=(unsigned long)(KISS>>1) ;
-    #endif
+#define THEONE 4611686018427387904
+#if defined TCONG
+    unsigned long x=(unsigned long)(CONG>>1) ;
+    unsigned long y=(unsigned long)(CONG>>1) ;
+#elif defined TSHR3
+    unsigned long x=(unsigned long)(SHR3>>1) ;
+    unsigned long y=(unsigned long)(SHR3>>1) ;
+#elif defined TMWC
+    unsigned long x=(unsigned long)(MWC>>1) ;
+    unsigned long y=(unsigned long)(MWC>>1) ;
+#elif defined TKISS
+    unsigned long x=(unsigned long)(KISS>>1) ;
+    unsigned long y=(unsigned long)(KISS>>1) ;
+#endif
 #elif defined TFP32
-    #define THEONE 1.0f
-    #if defined TCONG
-        float x=CONGfp ;
-        float y=CONGfp ;
-    #elif defined TSHR3
-        float x=SHR3fp ;
-        float y=SHR3fp ;
-    #elif defined TMWC
-        float x=MWCfp ;
-        float y=MWCfp ;
-    #elif defined TKISS
-      float x=KISSfp ;
-      float y=KISSfp ;
-    #endif
+#define THEONE 1.0f
+#if defined TCONG
+    float x=CONGfp ;
+    float y=CONGfp ;
+#elif defined TSHR3
+    float x=SHR3fp ;
+    float y=SHR3fp ;
+#elif defined TMWC
+    float x=MWCfp ;
+    float y=MWCfp ;
+#elif defined TKISS
+    float x=KISSfp ;
+    float y=KISSfp ;
+#endif
 #elif defined TFP64
-    #define THEONE 1.0f
-    #if defined TCONG
-        double x=(double)CONGfp ;
-        double y=(double)CONGfp ;
-    #elif defined TSHR3
-        double x=(double)SHR3fp ;
-        double y=(double)SHR3fp ;
-    #elif defined TMWC
-        double x=(double)MWCfp ;
-        double y=(double)MWCfp ;
-    #elif defined TKISS
-        double x=(double)KISSfp ;
-        double y=(double)KISSfp ;
-    #endif
+#define THEONE 1.0f
+#if defined TCONG
+    double x=(double)CONGfp ;
+    double y=(double)CONGfp ;
+#elif defined TSHR3
+    double x=(double)SHR3fp ;
+    double y=(double)SHR3fp ;
+#elif defined TMWC
+    double x=(double)MWCfp ;
+    double y=(double)MWCfp ;
+#elif defined TKISS
+    double x=(double)KISSfp ;
+    double y=(double)KISSfp ;
 #endif
+#endif
 
-      // Matching test
-      unsigned long inside=((x*x+y*y) < THEONE) ? 1:0;
-      total+=inside;
-   }
-
-   return(total);
-
+    // Matching test
+    unsigned long inside=((x*x+y*y) < THEONE) ? 1:0;
+    total+=inside;
+  }
+  
+  return(total);
+  
 }
 
 int main(int argc, char *argv[]) {
-
+  
   unsigned int seed_z=362436069,seed_w=52128862,process=PROCESS;
   // Number of NP or OpenMP processes <1024
-  LENGTH iterations=ITERATIONS,insideMPI[1024],insideOpenMP[1024],
-    part_inside,part_iterations,insides;
+  LENGTH iterations=ITERATIONS,insideMPI[8192],insideOpenMP[1024],
+    part_inside=0,part_iterations,insides=0;
   int numtasks,rank,rc,tag=1,i;
   float pi;
   
   // Hostname supposed to be <128 characters
   char hostname[128];
-
+  
   gethostname(hostname, sizeof hostname);
-
-#ifdef TIME
+  
   struct timeval start,end;
   long int useconds;
-#endif
-
+  
   MPI_Status Stat;
   
   rc = MPI_Init(&argc,&argv);
@@ -175,28 +178,34 @@
   }
 
   MPI_Comm_size(MPI_COMM_WORLD,&numtasks);
-
-    const int nitems=2;
-    int blocklengths[2] = {1,1};
-
+  MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+  
+  const int nitems=2;
+  int blocklengths[2] = {1,1};
+  
 #ifdef LONG
-    MPI_Datatype types[2] = {MPI_LONG, MPI_INT};
+  MPI_Datatype types_node[2] = {MPI_LONG, MPI_INT};
+  MPI_Datatype types_result[2] = {MPI_LONG, MPI_LONG};
 #else
-    MPI_Datatype types[2] = {MPI_INT, MPI_INT};
+  MPI_Datatype types_node[2] = {MPI_INT, MPI_INT};
+  MPI_Datatype types_result[2] = {MPI_INT, MPI_LONG};
 #endif
-
-    MPI_Datatype mpi_node_type;
-    MPI_Aint     offsets[2];
-
-    offsets[0] = offsetof(node, iterations);
-    offsets[1] = offsetof(node, process);
-
-    MPI_Type_create_struct(nitems, blocklengths, offsets, types, &mpi_node_type);
-    MPI_Type_commit(&mpi_node_type);
-
-    MPI_Comm_size(MPI_COMM_WORLD,&numtasks);
-    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
-
+  
+  MPI_Datatype mpi_node_type,mpi_result_type;
+  MPI_Aint     offsets[2],offsetsr[2];
+  
+  offsets[0] = offsetof(node, iterations);
+  offsets[1] = offsetof(node, process);
+  
+  MPI_Type_create_struct(nitems, blocklengths, offsets, types_node, &mpi_node_type);
+  MPI_Type_commit(&mpi_node_type);
+  
+  offsetsr[0] = offsetof(result, inside);
+  offsetsr[1] = offsetof(result, useconds);
+  
+  MPI_Type_create_struct(nitems, blocklengths, offsetsr, types_result, &mpi_result_type);
+  MPI_Type_commit(&mpi_result_type);
+  
   if (rank==0) {
     
     if (argc > 1) {
@@ -210,17 +219,17 @@
     }
     
     printf ("\n\tInformation about architecture:\n\n");
-
-    printf ("Sizeof int = %lld bytes.\n", (long long)sizeof(int));
-    printf ("Sizeof long = %lld bytes.\n", (long long)sizeof(long));
-    printf ("Sizeof long long = %lld bytes.\n", (long long)sizeof(long long));
     
-    printf ("Max int = %u\n", INT_MAX);
-    printf ("Max long = %ld\n", LONG_MAX);
-    printf ("Max long long = %lld\n\n", LLONG_MAX);
+    printf ("\tSizeof int = %lld bytes.\n", (long long)sizeof(int));
+    printf ("\tSizeof long = %lld bytes.\n", (long long)sizeof(long));
+    printf ("\tSizeof long long = %lld bytes.\n", (long long)sizeof(long long));
     
-    part_iterations=iterations/(numtasks*process)+1;
+    printf ("\tMax int = %u\n", INT_MAX);
+    printf ("\tMax long = %ld\n", LONG_MAX);
+    printf ("\tMax long long = %lld\n\n", LLONG_MAX);
     
+    part_iterations=(((iterations%numtasks)%process) == 0) ? iterations/numtasks/process:iterations/numtasks/process+1 ;
+    
     node send;
     send.iterations=part_iterations;
     send.process=process;
@@ -230,104 +239,99 @@
       rc = MPI_Send(&send, 1, mpi_node_type, i, tag, MPI_COMM_WORLD);
     }
     
-#ifdef TIME
     gettimeofday(&start,(struct timezone *)0);
-#endif
     
 #pragma omp parallel for
-  for (int i=0 ; i<process; i++) {
-    insideOpenMP[i]=MainLoopGlobal(part_iterations,
-				   rotr(seed_w,process),
-				   rotl(seed_z,process));
-    printf("\t(%s,%i) found %lld for process %i\n",hostname,0,
-	   (long long)insideOpenMP[i],i);
-  }
-  printf("\n");
-
-  insides=0;
-  for (int i=0 ; i<process; i++) {
-    insides+=insideOpenMP[i];
-  }
-
-#ifdef TIME
+    for (int i=0 ; i<process; i++) {
+      insideOpenMP[i]=MainLoopGlobal(part_iterations,
+				     rotr(seed_w,i),
+				     rotl(seed_z,i));
+      /*
+	printf("\t(%s,%i) found %lld for process %i\n",hostname,0,
+	(long long)insideOpenMP[i],i); */
+    }
+    /*
+      printf("\n");
+    */
+    
+    insides=0;
+    for (int i=0 ; i<process; i++) {
+      insides+=insideOpenMP[i];
+    }
+    
     gettimeofday(&end,(struct timezone *)0);
     useconds=(end.tv_sec-start.tv_sec)*1000000+end.tv_usec-start.tv_usec;
     
-      printf("\tOn %s with %i find %lld inside in %lu useconds.\n",
-	     hostname,rank,(long long)insides,useconds);
-#else
-      printf("\tOn %s with %i find %lld inside\n",hostname,rank,
-	     (long long)insides);
+    printf("\tOn %s with rank #%i find %lld inside in %lu useconds.\n",
+	   hostname,rank,(long long)insides,useconds);
+    
+    // Join part of code
+    for (i=1;i<numtasks;i++) {
       
-#endif
+      result recv;
       
-    // Join part of code
-      for (i=1;i<numtasks;i++) {
-#ifdef LONG
-	rc = MPI_Recv(&insideMPI[i], 1, MPI_LONG_LONG, i, tag, MPI_COMM_WORLD,&Stat);
-#else
-	rc = MPI_Recv(&insideMPI[i], 1, MPI_INT, i, tag, MPI_COMM_WORLD,&Stat);
-#endif
-	printf("\tReceive %lu inside from rank %i\n",(unsigned long)insideMPI[i],i);
-	insides+=insideMPI[i];
-      }
+      rc = MPI_Recv(&recv, 1, mpi_result_type, i, tag, MPI_COMM_WORLD,&Stat);
       
-      pi=4.*(float)insides/(float)((iterations/numtasks)*numtasks);
+      insideMPI[i]=recv.inside;
+      useconds=recv.useconds;
       
-      printf("\n\tPi=%.40f\n\twith error %.40f\n\twith %lld iterations\n\n",pi,
-	     fabs(pi-4*atan(1.))/pi,(long long)iterations);
-
+      printf("\tReceive from rank #%i, find %lld inside in %lu useconds\n",i,(long long)insideMPI[i],useconds);
+    
+      insides+=insideMPI[i];
+    }
+    
+    pi=4.*(float)insides/(float)(part_iterations*numtasks*process);
+    
+    printf("\n\tPi=%.40f\n\twith error %.40f\n\twith %lld iterations\n\n",pi,
+	   fabs(pi-4*atan(1.))/pi,(long long)(part_iterations*numtasks*process));
+    
   }
   else
     {
       // Receive information from master
-     
+      
       node recv;
-
+      
       rc = MPI_Recv(&recv, 1, mpi_node_type, 0, tag, MPI_COMM_WORLD,&Stat);
-      
+      /*   
       printf("\t(%s,%i) receive from master %lld with %i process\n",
-             hostname,rank,(long long)recv.iterations,recv.process);
+      hostname,rank,(long long)recv.iterations,recv.process);
+      */
       
-#ifdef TIME
       gettimeofday(&start,(struct timezone *)0);
-#endif
-
+      
 #pragma omp parallel for
-  for (int i=0 ; i<recv.process; i++) {
-      insideOpenMP[i]=MainLoopGlobal(recv.iterations,rotr(seed_w,rank+process),rotl(seed_z,rank+process));
-      printf("\t(%s,%i) found %lld for process %i\n",hostname,rank,
-	     (long long)insideOpenMP[i],i);
-  }
-  printf("\n");
-
-  part_inside=0;
-  for (int i=0 ; i<recv.process; i++) {
-    part_inside+=insideOpenMP[i];
-  }
+      for (int i=0 ; i<recv.process; i++) {
+	insideOpenMP[i]=MainLoopGlobal(recv.iterations,rotr(seed_w,rank+i),rotl(seed_z,rank-i));
+	/*
+	  printf("\t(%s,%i) found %lld for process %i\n",hostname,rank,
+	  (long long)insideOpenMP[i],i);
+	*/
+      }
       
-#ifdef TIME
+      /* printf("\n"); */
+      
+      for (int i=0 ; i<recv.process; i++) {
+	part_inside+=insideOpenMP[i];
+      }
+      
       gettimeofday(&end,(struct timezone *)0);
       useconds=(end.tv_sec-start.tv_sec)*1000000+end.tv_usec-start.tv_usec;
+      /*
+	printf("\tOn %s rank %i find %lld inside in %lu useconds.\n",
+	hostname,rank,(long long)part_inside,useconds);
+      */
+      result send;
+      send.inside=part_inside;
+      send.useconds=useconds;
       
-      printf("\tOn %s rank %i find %lld inside in %lu useconds.\n",
-	     hostname,rank,(long long)part_inside,useconds);
-#else
-      printf("\tOn %s rank %i find %lld inside\n",hostname,rank,
-	     (long long)part_inside);
+      rc = MPI_Send(&send, 1, mpi_result_type, 0, tag, MPI_COMM_WORLD);
       
-#endif
-
-#ifdef LONG
-      rc = MPI_Send(&part_inside, 1, MPI_LONG_LONG, 0, tag, MPI_COMM_WORLD);
-#else
-      rc = MPI_Send(&part_inside, 1, MPI_INT, 0, tag, MPI_COMM_WORLD);
-#endif
-
     }
   
   MPI_Type_free(&mpi_node_type);
-
+  MPI_Type_free(&mpi_result_type);
+  
   MPI_Finalize();
   
 }
Index: Pi/C/Hybrid/Pi_aHybrid.c
===================================================================
--- Pi/C/Hybrid/Pi_aHybrid.c	(revision 124)
+++ Pi/C/Hybrid/Pi_aHybrid.c	(revision 125)
@@ -43,129 +43,131 @@
 #endif
 
 typedef struct compute_node {
-        LENGTH iterations;
-        int process;
+  LENGTH iterations;
+  int process;
 } node;
 
+typedef struct compute_result {
+  LENGTH inside;
+  long int useconds;
+} result;
+
 unsigned int rotl(unsigned int value, int shift) {
-    return (value << shift) | (value >> (sizeof(value) * CHAR_BIT - shift));
+  return (value << shift) | (value >> (sizeof(value) * CHAR_BIT - shift));
 }
  
 unsigned int rotr(unsigned int value, int shift) {
-    return (value >> shift) | (value << (sizeof(value) * CHAR_BIT - shift));
+  return (value >> shift) | (value << (sizeof(value) * CHAR_BIT - shift));
 }
 
 LENGTH MainLoopGlobal(LENGTH iterations,unsigned int seed_w,unsigned int seed_z)
 {
-
+  
 #if defined TCONG
-   unsigned int jcong=seed_z;
+  unsigned int jcong=seed_z;
 #elif defined TSHR3
-   unsigned int jsr=seed_w;
+  unsigned int jsr=seed_w;
 #elif defined TMWC
-   unsigned int z=seed_z;
-   unsigned int w=seed_w;
+  unsigned int z=seed_z;
+  unsigned int w=seed_w;
 #elif defined TKISS
-   unsigned int jcong=seed_z;
-   unsigned int jsr=seed_w;
-   unsigned int z=seed_z;
-   unsigned int w=seed_w;
+  unsigned int jcong=seed_z;
+  unsigned int jsr=seed_w;
+  unsigned int z=seed_z;
+  unsigned int w=seed_w;
 #endif
    
-   LENGTH total=0;
+  LENGTH total=0;
+  
+  for (LENGTH i=0;i<iterations;i++) {
 
-   for (LENGTH i=0;i<iterations;i++) {
-
 #if defined TINT32
-    #define THEONE 1073741824
-    #if defined TCONG
-        unsigned int x=CONG>>17 ;
-        unsigned int y=CONG>>17 ;
-    #elif defined TSHR3
-        unsigned int x=SHR3>>17 ;
-        unsigned int y=SHR3>>17 ;
-    #elif defined TMWC
-        unsigned int x=MWC>>17 ;
-        unsigned int y=MWC>>17 ;
-    #elif defined TKISS
-        unsigned int x=KISS>>17 ;
-        unsigned int y=KISS>>17 ;
-    #endif
+#define THEONE 1073741824
+#if defined TCONG
+    unsigned int x=CONG>>17 ;
+    unsigned int y=CONG>>17 ;
+#elif defined TSHR3
+    unsigned int x=SHR3>>17 ;
+    unsigned int y=SHR3>>17 ;
+#elif defined TMWC
+    unsigned int x=MWC>>17 ;
+    unsigned int y=MWC>>17 ;
+#elif defined TKISS
+    unsigned int x=KISS>>17 ;
+    unsigned int y=KISS>>17 ;
+#endif
 #elif defined TINT64
-    #define THEONE 4611686018427387904
-    #if defined TCONG
-        unsigned long x=(unsigned long)(CONG>>1) ;
-        unsigned long y=(unsigned long)(CONG>>1) ;
-    #elif defined TSHR3
-        unsigned long x=(unsigned long)(SHR3>>1) ;
-        unsigned long y=(unsigned long)(SHR3>>1) ;
-    #elif defined TMWC
-        unsigned long x=(unsigned long)(MWC>>1) ;
-        unsigned long y=(unsigned long)(MWC>>1) ;
-    #elif defined TKISS
-        unsigned long x=(unsigned long)(KISS>>1) ;
-        unsigned long y=(unsigned long)(KISS>>1) ;
-    #endif
+#define THEONE 4611686018427387904
+#if defined TCONG
+    unsigned long x=(unsigned long)(CONG>>1) ;
+    unsigned long y=(unsigned long)(CONG>>1) ;
+#elif defined TSHR3
+    unsigned long x=(unsigned long)(SHR3>>1) ;
+    unsigned long y=(unsigned long)(SHR3>>1) ;
+#elif defined TMWC
+    unsigned long x=(unsigned long)(MWC>>1) ;
+    unsigned long y=(unsigned long)(MWC>>1) ;
+#elif defined TKISS
+    unsigned long x=(unsigned long)(KISS>>1) ;
+    unsigned long y=(unsigned long)(KISS>>1) ;
+#endif
 #elif defined TFP32
-    #define THEONE 1.0f
-    #if defined TCONG
-        float x=CONGfp ;
-        float y=CONGfp ;
-    #elif defined TSHR3
-        float x=SHR3fp ;
-        float y=SHR3fp ;
-    #elif defined TMWC
-        float x=MWCfp ;
-        float y=MWCfp ;
-    #elif defined TKISS
-      float x=KISSfp ;
-      float y=KISSfp ;
-    #endif
+#define THEONE 1.0f
+#if defined TCONG
+    float x=CONGfp ;
+    float y=CONGfp ;
+#elif defined TSHR3
+    float x=SHR3fp ;
+    float y=SHR3fp ;
+#elif defined TMWC
+    float x=MWCfp ;
+    float y=MWCfp ;
+#elif defined TKISS
+    float x=KISSfp ;
+    float y=KISSfp ;
+#endif
 #elif defined TFP64
-    #define THEONE 1.0f
-    #if defined TCONG
-        double x=(double)CONGfp ;
-        double y=(double)CONGfp ;
-    #elif defined TSHR3
-        double x=(double)SHR3fp ;
-        double y=(double)SHR3fp ;
-    #elif defined TMWC
-        double x=(double)MWCfp ;
-        double y=(double)MWCfp ;
-    #elif defined TKISS
-        double x=(double)KISSfp ;
-        double y=(double)KISSfp ;
-    #endif
+#define THEONE 1.0f
+#if defined TCONG
+    double x=(double)CONGfp ;
+    double y=(double)CONGfp ;
+#elif defined TSHR3
+    double x=(double)SHR3fp ;
+    double y=(double)SHR3fp ;
+#elif defined TMWC
+    double x=(double)MWCfp ;
+    double y=(double)MWCfp ;
+#elif defined TKISS
+    double x=(double)KISSfp ;
+    double y=(double)KISSfp ;
 #endif
-
-      // Matching test
-      unsigned long inside=((x*x+y*y) < THEONE) ? 1:0;
-      total+=inside;
-   }
-
-   return(total);
-
+#endif
+    
+    // Matching test
+    unsigned long inside=((x*x+y*y) < THEONE) ? 1:0;
+    total+=inside;
+  }
+  
+  return(total);
 }
 
 int main(int argc, char *argv[]) {
 
   unsigned int seed_z=362436069,seed_w=52128862,process=PROCESS;
   // Number of NP or OpenMP processes <1024
-  LENGTH iterations=ITERATIONS,insideMPI[1024],insideOpenMP[1024],
-    part_inside,part_iterations,insides;
+  LENGTH iterations=ITERATIONS,insideMPI[8192],insideOpenMP[1024],
+    part_inside=0,part_iterations,insides=0;
   int numtasks,rank,rc,tag=1,i;
   float pi;
   
   // Hostname supposed to be <128 characters
   char hostname[128];
-
+  
   gethostname(hostname, sizeof hostname);
-
-#ifdef TIME
+  
   struct timeval start,end;
   long int useconds;
-#endif
-
+  
   MPI_Status Stat;
   MPI_Request RequestSend,RequestRecv,RequestSend2,RequestRecv2;
   
@@ -174,29 +176,36 @@
     printf ("Error starting MPI program. Terminating.\n");
     MPI_Abort(MPI_COMM_WORLD, rc);
   }
-
+  
   MPI_Comm_size(MPI_COMM_WORLD,&numtasks);
-
-    const int nitems=2;
-    int blocklengths[2] = {1,1};
-
+  MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+  
+  const int nitems=2;
+  int blocklengths[2] = {1,1};
+  
 #ifdef LONG
-    MPI_Datatype types[2] = {MPI_LONG, MPI_INT};
+  MPI_Datatype types_node[2] = {MPI_LONG, MPI_INT};
+  MPI_Datatype types_result[2] = {MPI_LONG, MPI_LONG};
 #else
-    MPI_Datatype types[2] = {MPI_INT, MPI_INT};
+  MPI_Datatype types_node[2] = {MPI_INT, MPI_INT};
+  MPI_Datatype types_result[2] = {MPI_INT, MPI_LONG};
 #endif
+  
+  MPI_Datatype mpi_node_type,mpi_result_type;
+  MPI_Aint     offsets[2],offsetsr[2];
 
-    MPI_Datatype mpi_node_type;
-    MPI_Aint     offsets[2];
-
-    offsets[0] = offsetof(node, iterations);
-    offsets[1] = offsetof(node, process);
-
-    MPI_Type_create_struct(nitems, blocklengths, offsets, types, &mpi_node_type);
-    MPI_Type_commit(&mpi_node_type);
-
-    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
-
+  offsets[0] = offsetof(node, iterations);
+  offsets[1] = offsetof(node, process);
+  
+  MPI_Type_create_struct(nitems, blocklengths, offsets, types_node, &mpi_node_type);
+  MPI_Type_commit(&mpi_node_type);
+  
+  offsetsr[0] = offsetof(result, inside);
+  offsetsr[1] = offsetof(result, useconds);
+  
+  MPI_Type_create_struct(nitems, blocklengths, offsetsr, types_result, &mpi_result_type);
+  MPI_Type_commit(&mpi_result_type);
+  
   if (rank==0) {
     
     if (argc > 1) {
@@ -210,130 +219,120 @@
     }
     
     printf ("\n\tInformation about architecture:\n\n");
-
-    printf ("Sizeof int = %lld bytes.\n", (long long)sizeof(int));
-    printf ("Sizeof long = %lld bytes.\n", (long long)sizeof(long));
-    printf ("Sizeof long long = %lld bytes.\n", (long long)sizeof(long long));
     
-    printf ("Max int = %u\n", INT_MAX);
-    printf ("Max long = %ld\n", LONG_MAX);
-    printf ("Max long long = %lld\n\n", LLONG_MAX);
+    printf ("\tSizeof int = %lld bytes.\n", (long long)sizeof(int));
+    printf ("\tSizeof long = %lld bytes.\n", (long long)sizeof(long));
+    printf ("\tSizeof long long = %lld bytes.\n", (long long)sizeof(long long));
     
-    part_iterations=iterations/(numtasks*process)+1;
+    printf ("\tMax int = %u\n", INT_MAX);
+    printf ("\tMax long = %ld\n", LONG_MAX);
+    printf ("\tMax long long = %lld\n\n", LLONG_MAX);
     
+    part_iterations=(((iterations%numtasks)%process) == 0) ? iterations/numtasks/process:iterations/numtasks/process+1 ;
+    
     node send;
     send.iterations=part_iterations;
     send.process=process;
-
+    
     // Split part of code
     for (i=1;i<numtasks;i++) {      
       rc = MPI_Isend(&send, 1, mpi_node_type, i, tag, MPI_COMM_WORLD, &RequestSend);
     }
     MPI_Wait(&RequestSend,&Stat);
     
-#ifdef TIME
     gettimeofday(&start,(struct timezone *)0);
-#endif
     
 #pragma omp parallel for
-  for (int i=0 ; i<process; i++) {
-    insideOpenMP[i]=MainLoopGlobal(part_iterations,
-				   rotr(seed_w,process),
-				   rotl(seed_z,process));
-    printf("\t(%s,%i) found %lld for process %i\n",hostname,0,
-	   (long long)insideOpenMP[i],i);
-  }
-  printf("\n");
-
-  insides=0;
-  for (int i=0 ; i<process; i++) {
-    insides+=insideOpenMP[i];
-  }
-
-#ifdef TIME
+    for (int i=0 ; i<process; i++) {
+      insideOpenMP[i]=MainLoopGlobal(part_iterations,
+				     rotr(seed_w,i),
+				     rotl(seed_z,i));
+      /*
+	printf("\t(%s,%i) found %lld for process %i\n",hostname,0,
+	(long long)insideOpenMP[i],i); */
+    }
+    /* printf("\n"); */
+    
+    for (int i=0 ; i<process; i++) {
+      insides+=insideOpenMP[i];
+    }
+    
     gettimeofday(&end,(struct timezone *)0);
     useconds=(end.tv_sec-start.tv_sec)*1000000+end.tv_usec-start.tv_usec;
     
-      printf("\tOn %s with %i find %lld inside in %lu useconds.\n",
-	     hostname,rank,(long long)insides,useconds);
-#else
-      printf("\tOn %s with %i find %lld inside\n",hostname,rank,
-	     (long long)insides);
+    printf("\tOn %s with rank #%i find %lld inside in %lu useconds.\n",
+	   hostname,rank,(long long)insides,useconds);
+    
+    // Join part of code
+    for (i=1;i<numtasks;i++) {
       
-#endif
+      result recv;
       
-    // Join part of code
-      for (i=1;i<numtasks;i++) {
-#ifdef LONG
-	rc = MPI_Irecv(&insideMPI[i], 1, MPI_LONG_LONG, i, tag, 
-		       MPI_COMM_WORLD, &RequestRecv2);
-#else
-	rc = MPI_Irecv(&insideMPI[i], 1, MPI_INT, i, tag, 
-		       MPI_COMM_WORLD, &RequestRecv2);
-#endif
-	MPI_Wait(&RequestRecv2,&Stat);
-	printf("\tReceive %lu inside from rank %i\n",(unsigned long)insideMPI[i],i);
-	insides+=insideMPI[i];
-      }
+      rc = MPI_Irecv(&recv,1,mpi_result_type,i,tag,MPI_COMM_WORLD,&RequestRecv2);
+      MPI_Wait(&RequestRecv2,&Stat);
       
-      pi=4.*(float)insides/(float)((iterations/numtasks)*numtasks);
+      insideMPI[i]=recv.inside;
+      useconds=recv.useconds;
       
-      printf("\n\tPi=%.40f\n\twith error %.40f\n\twith %lld iterations\n\n",pi,
-	     fabs(pi-4*atan(1.))/pi,(long long)iterations);
-
+      printf("\tReceive from rank #%i, find %lld inside in %lu useconds\n",i,(long long)insideMPI[i],useconds);
+      
+      insides+=insideMPI[i];
+    }
+    
+    pi=4.*(float)insides/(float)(part_iterations*numtasks*process);
+    
+    printf("\n\tPi=%.40f\n\twith error %.40f\n\twith %lld iterations\n\n",pi,
+	   fabs(pi-4*atan(1.))/pi,(long long)(part_iterations*numtasks*process));
+    
   }
   else
     {
       // Receive information from master
-     
+      
       node recv;
-
-      rc = MPI_Irecv(&recv, 1, mpi_node_type, 0, tag, MPI_COMM_WORLD, &RequestRecv);
+      
+      rc = MPI_Irecv(&recv,1,mpi_node_type,0,tag,MPI_COMM_WORLD,&RequestRecv);
       MPI_Wait(&RequestRecv,&Stat);
+      /*
+	printf("\t(%s,%i) receive from master %lld with %i process\n",
+	hostname,rank,(long long)recv.iterations,recv.process);
+      */
       
-      printf("\t(%s,%i) receive from master %lld with %i process\n",
-             hostname,rank,(long long)recv.iterations,recv.process);
-      
-#ifdef TIME
       gettimeofday(&start,(struct timezone *)0);
-#endif
-
+      
 #pragma omp parallel for
-  for (int i=0 ; i<recv.process; i++) {
-      insideOpenMP[i]=MainLoopGlobal(recv.iterations,rotr(seed_w,rank+process),rotl(seed_z,rank+process));
-      printf("\t(%s,%i) found %lld for process %i\n",hostname,rank,
-	     (long long)insideOpenMP[i],i);
-  }
-  printf("\n");
-
-  part_inside=0;
-  for (int i=0 ; i<recv.process; i++) {
-    part_inside+=insideOpenMP[i];
-  }
+      for (int i=0 ; i<recv.process; i++) {
+	insideOpenMP[i]=MainLoopGlobal(recv.iterations,rotr(seed_w,rank+i),rotl(seed_z,rank-i));
+	/*
+	  printf("\t(%s,%i) found %lld for process %i\n",hostname,rank,
+	  (long long)insideOpenMP[i],i);
+	*/
+      }
+      /* printf("\n"); */
       
-#ifdef TIME
+      for (int i=0 ; i<recv.process; i++) {
+	part_inside+=insideOpenMP[i];
+      }
+      
       gettimeofday(&end,(struct timezone *)0);
       useconds=(end.tv_sec-start.tv_sec)*1000000+end.tv_usec-start.tv_usec;
       
+      /* 
       printf("\tOn %s rank %i find %lld inside in %lu useconds.\n",
 	     hostname,rank,(long long)part_inside,useconds);
-#else
-      printf("\tOn %s rank %i find %lld inside\n",hostname,rank,
-	     (long long)part_inside);
+      */
       
-#endif
-
-#ifdef LONG
-      rc = MPI_Isend(&part_inside, 1, MPI_LONG_LONG, 0, tag, MPI_COMM_WORLD, &RequestSend2);
-#else
-      rc = MPI_Isend(&part_inside, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &RequestSend2);
-#endif
-
+      result send;
+      send.inside=part_inside;
+      send.useconds=useconds;
+      
+      rc = MPI_Isend(&send, 1, mpi_result_type, 0, tag, MPI_COMM_WORLD, &RequestSend2);
+      
       MPI_Wait(&RequestSend2, &Stat);
     }
   
   MPI_Type_free(&mpi_node_type);
-
-  MPI_Finalize();
+  MPI_Type_free(&mpi_result_type);
   
+  MPI_Finalize();
 }
Index: Pi/C/Hybrid/Makefile
===================================================================
--- Pi/C/Hybrid/Makefile	(revision 124)
+++ Pi/C/Hybrid/Makefile	(revision 125)
@@ -5,7 +5,7 @@
 SOURCE=Pi_Hybrid.c Pi_aHybrid.c
 
 CC=mpicc.openmpi
-CFLAGS=-Wall -O3 -std=c99 -fopenmp 
+CFLAGS=-Wall -Wno-sequence-point -O3 -std=c99 -fopenmp 
 LIBRARY=-lm
 
 all: $(SOURCE)
@@ -14,7 +14,7 @@
 .PHONY: clean check mrproper
 
 mrproper: $(SOURCE)
-	rm -rf $(foreach TVAR,$(TVARS),$(foreach TRND,$(MARSAGLIA),$(<:.c=)_$(TVAR)_$(TRND) ) )
+	$(foreach SRC,$(SOURCE),$(foreach TVAR,$(COMPUTING),$(foreach TRND,$(MARSAGLIA),rm $(SRC:.c=)_$(TVAR)_$(TRND); ) ) )
 	find . -name "*~" -exec rm {} \;
 
 clean:
