Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 10 Sep 2018 12:42:52 +0000 (14:42 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 10 Sep 2018 12:42:52 +0000 (14:42 +0200)
90 files changed:
doc/doxygen/options.doc
docs/source/app_s4u.rst
examples/s4u/async-waitall/s4u-async-waitall.cpp
src/kernel/context/ContextThread.hpp
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_global.cpp
teshsuite/smpi/isp/umpire/any_src-can-deadlock.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock10.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock10_mod.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock11.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock2.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock3.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock4.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock4_mod.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock5.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock5_mod.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock6.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock6_mod.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock7.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock8.c
teshsuite/smpi/isp/umpire/any_src-can-deadlock9.c
teshsuite/smpi/isp/umpire/any_src-deadlock.c
teshsuite/smpi/isp/umpire/any_src-wait-deadlock.c
teshsuite/smpi/isp/umpire/any_src-wait-deadlock2.c
teshsuite/smpi/isp/umpire/any_src-waitall-deadlock.c
teshsuite/smpi/isp/umpire/any_src-waitall-deadlock2.c
teshsuite/smpi/isp/umpire/any_src-waitall-deadlock3.c
teshsuite/smpi/isp/umpire/any_src-waitany-deadlock.c
teshsuite/smpi/isp/umpire/any_src-waitany-deadlock2.c
teshsuite/smpi/isp/umpire/basic-deadlock-cart_create.c
teshsuite/smpi/isp/umpire/basic-deadlock-cart_sub.c
teshsuite/smpi/isp/umpire/basic-deadlock-comm_create.c
teshsuite/smpi/isp/umpire/basic-deadlock-comm_dup.c
teshsuite/smpi/isp/umpire/basic-deadlock-comm_split.c
teshsuite/smpi/isp/umpire/basic-deadlock-graph_create.c
teshsuite/smpi/isp/umpire/basic-deadlock-intercomm_create.c
teshsuite/smpi/isp/umpire/basic-deadlock-intercomm_merge.c
teshsuite/smpi/isp/umpire/basic-deadlock.c
teshsuite/smpi/isp/umpire/bcast-deadlock.c
teshsuite/smpi/isp/umpire/collective-misorder-allreduce.c
teshsuite/smpi/isp/umpire/collective-misorder.c
teshsuite/smpi/isp/umpire/collective-misorder2.c
teshsuite/smpi/isp/umpire/complex-deadlock.c
teshsuite/smpi/isp/umpire/finalize-deadlock.c
teshsuite/smpi/isp/umpire/intercomm_create-deadlock.c
teshsuite/smpi/isp/umpire/intercomm_create-deadlock2.c
teshsuite/smpi/isp/umpire/intercomm_create-deadlock3.c
teshsuite/smpi/isp/umpire/intercomm_create-deadlock4.c
teshsuite/smpi/isp/umpire/intercomm_merge-deadlock.c
teshsuite/smpi/isp/umpire/irecv-deadlock.c
teshsuite/smpi/isp/umpire/irecv-isend-ok.c
teshsuite/smpi/isp/umpire/irecv-isend-ok2.c
teshsuite/smpi/isp/umpire/lost-request-waitall.c
teshsuite/smpi/isp/umpire/lost-request.c
teshsuite/smpi/isp/umpire/lost-request3.c
teshsuite/smpi/isp/umpire/no-error-any_src.c
teshsuite/smpi/isp/umpire/no-error-derived-comms.c
teshsuite/smpi/isp/umpire/no-error-test.c
teshsuite/smpi/isp/umpire/no-error-testall.c
teshsuite/smpi/isp/umpire/no-error-testany.c
teshsuite/smpi/isp/umpire/no-error-wait-any_src.c
teshsuite/smpi/isp/umpire/no-error-wait-any_src2.c
teshsuite/smpi/isp/umpire/no-error-wait-any_src3.c
teshsuite/smpi/isp/umpire/no-error-wait-any_src4.c
teshsuite/smpi/isp/umpire/no-error-wait.c
teshsuite/smpi/isp/umpire/no-error-wait2.c
teshsuite/smpi/isp/umpire/no-error-waitall-any_src.c
teshsuite/smpi/isp/umpire/no-error-waitall-any_src2.c
teshsuite/smpi/isp/umpire/no-error-waitall-any_src3.c
teshsuite/smpi/isp/umpire/no-error-waitall.c
teshsuite/smpi/isp/umpire/no-error-waitany-any_src.c
teshsuite/smpi/isp/umpire/no-error-waitany-any_src2.c
teshsuite/smpi/isp/umpire/no-error-waitany-any_src3.c
teshsuite/smpi/isp/umpire/no-error-waitany.c
teshsuite/smpi/isp/umpire/no-error-waitany2.c
teshsuite/smpi/isp/umpire/no-error.c
teshsuite/smpi/isp/umpire/no-error2.c
teshsuite/smpi/isp/umpire/no-error3-any_src.c
teshsuite/smpi/isp/umpire/no-error3.c
teshsuite/smpi/isp/umpire/no-error4-any_src.c
teshsuite/smpi/isp/umpire/no-error4.c
teshsuite/smpi/isp/umpire/persistent.c
teshsuite/smpi/isp/umpire/persistent2.c
teshsuite/smpi/isp/umpire/persistent3.c
teshsuite/smpi/isp/umpire/persistent4.c
teshsuite/smpi/isp/umpire/send-recv-ok.c
teshsuite/smpi/isp/umpire/sendrecv-deadlock.c
teshsuite/smpi/isp/umpire/wait-deadlock.c
teshsuite/smpi/isp/umpire/waitall-deadlock.c
teshsuite/smpi/isp/umpire/waitany-deadlock.c

index 209de0b..200b091 100644 (file)
@@ -1248,28 +1248,33 @@ at least one huge page:
 Then, you can pass the option --cfg=smpi/shared-malloc-hugepage:/home/huge
 to smpirun to actually activate the huge page support in shared mallocs.
 
-@subsection options_model_smpi_wtime smpi/wtime: Inject constant times for calls to MPI_Wtime
+@subsection options_model_smpi_wtime smpi/wtime: Inject constant times for calls to MPI_Wtime, gettimeofday and clock_gettime
 
-@b Default value: 0
-
-By setting this option, you can control the amount of time a process sleeps
-when MPI_Wtime() is called; this is important, because SimGrid normally only
-advances the time while communication is happening and thus,
-MPI_Wtime will not add to the time, resulting in a deadlock if used as a
-break-condition.
+@b Default value: 1ms
 
-Here is an example:
+This option controls the amount of (simulated) time spent in calls to
+MPI_Wtime(), gettimeofday() and clock_gettime(). If you set this value
+to 0, the simulated clock is not advanced in these calls, which leads
+to issue if your application contains such a loop:
 
 @code{.unparsed}
     while(MPI_Wtime() < some_time_bound) {
-        ...
+        /* some tests, with no communication nor computation */
     }
 @endcode
 
-If the time is never advanced, this loop will clearly never end as MPI_Wtime()
-always returns the same value. Hence, pass a (small) value to the smpi/wtime
-option to force a call to MPI_Wtime to advance the time as well.
-
+When the option smpi/wtime is set to 0, the time advances only on
+communications and computations, so the previous code results in an
+infinite loop: the current [simulated] time will never reach @c
+some_time_bound.  This infinite loop is avoided when that option is
+set to a small amount, as it is by default since SimGrid v3.21.
+
+Note that if your application does not contain any loop depending on
+the current time only, then setting this option to a non-zero value
+will slow down your simulations by a tiny bit: the simulation loop has
+to be broken and reset each time your code ask for the current time.
+If the simulation speed really matters to you, you can avoid this
+extra delay by setting smpi/wtime to 0.
 
 @section options_generic Configuring other aspects of SimGrid
 
index a5ae90e..9d20e2b 100644 (file)
@@ -41,8 +41,8 @@ completion of these activities.
 When **communicating**, data is not directly sent to other actors but
 posted onto a |Mailbox|_ that serves as a rendez-vous point between
 communicating actors. This means that you don't need to know who you
-are talking to, you just put your communication `Send` request in a
-mailbox, and it will be matched with a complementary `Receive`
+are talking to, you just put your communication `Put` request in a
+mailbox, and it will be matched with a complementary `Get`
 request.  Alternatively, actors can interact through **classical
 synchronization mechanisms** such as |Barrier|_, |Semaphore|_,
 |Mutex|_ and |ConditionVariable|_.
@@ -197,8 +197,8 @@ with
      
 .. literalinclude:: ../../examples/s4u/async-waitall/s4u-async-waitall.cpp
    :language: c++
-   :start-after: send-begin
-   :end-before: send-end
+   :start-after: put-begin
+   :end-before: put-end
    :dedent: 4
 
 
index 7c7c908..f49f7bf 100644 (file)
@@ -58,7 +58,7 @@ public:
       pending_comms.push_back(comm);
     }
 
-    /* Start sending messages to let the workers know that they should stop */ // sphinx-doc: send-begin
+    /* Start sending messages to let the workers know that they should stop */ // sphinx-doc: put-begin
     for (int i = 0; i < receivers_count; i++) {
       XBT_INFO("Send 'finalize' to 'receiver-%d'", i);
       simgrid::s4u::CommPtr comm = mboxes[i]->put_async(new std::string("finalize"), 0);
@@ -68,7 +68,7 @@ public:
 
     /* Now that all message exchanges were initiated, wait for their completion in one single call */
     simgrid::s4u::Comm::wait_all(&pending_comms);
-    // sphinx-doc: send-end
+    // sphinx-doc: put-end
 
     XBT_INFO("Goodbye now!");
   }
index 48a9d1a..cd83102 100644 (file)
@@ -16,7 +16,7 @@ namespace simgrid {
 namespace kernel {
 namespace context {
 
-class ThreadContext : public AttachContext {
+class XBT_PUBLIC ThreadContext : public AttachContext {
 public:
   ThreadContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process, bool maestro);
   ~ThreadContext() override;
@@ -46,7 +46,7 @@ private:
   static void* wrapper(void *param);
 };
 
-class SerialThreadContext : public ThreadContext {
+class XBT_PUBLIC SerialThreadContext : public ThreadContext {
 public:
   SerialThreadContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process, bool maestro)
       : ThreadContext(std::move(code), cleanup_func, process, maestro)
index 85191c7..3ebf408 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_bench, smpi, "Logging specific to SMPI (benchmarking)");
 
+static simgrid::config::Flag<double>
+    smpi_wtime_sleep("smpi/wtime",
+                     "Minimum time to inject inside a call to MPI_Wtime(), gettimeofday() and clock_gettime()",
+                     1e-6 /* Documented to be 1ms */);
+
 double smpi_cpu_threshold = -1;
 double smpi_host_speed;
 
@@ -35,6 +40,7 @@ SharedMallocType smpi_cfg_shared_malloc = SharedMallocType::GLOBAL;
 double smpi_total_benched_time = 0;
 
 extern "C" XBT_PUBLIC void smpi_execute_flops_(double* flops);
+
 void smpi_execute_flops_(double *flops)
 {
   smpi_execute_flops(*flops);
@@ -177,7 +183,7 @@ void smpi_bench_end()
   smpi_total_benched_time += xbt_os_timer_elapsed(timer);
 }
 
-/* Private sleep function used by smpi_sleep() and smpi_usleep() */
+/* Private sleep function used by smpi_sleep(), smpi_usleep() and friends */
 static unsigned int private_sleep(double secs)
 {
   smpi_bench_end();
@@ -232,6 +238,8 @@ int smpi_gettimeofday(struct timeval* tv, struct timezone* tz)
     tv->tv_usec = static_cast<suseconds_t>((now - tv->tv_sec) * 1e6);
 #endif
   }
+  if (smpi_wtime_sleep > 0)
+    simcall_process_sleep(smpi_wtime_sleep);
   smpi_bench_begin();
   return 0;
 }
@@ -248,11 +256,28 @@ int smpi_clock_gettime(clockid_t clk_id, struct timespec* tp)
     tp->tv_sec = static_cast<time_t>(now);
     tp->tv_nsec = static_cast<long int>((now - tp->tv_sec) * 1e9);
   }
+  if (smpi_wtime_sleep > 0)
+    simcall_process_sleep(smpi_wtime_sleep);
   smpi_bench_begin();
   return 0;
 }
 #endif
 
+double smpi_mpi_wtime()
+{
+  double time;
+  if (smpi_process()->initialized() && not smpi_process()->finalized() && not smpi_process()->sampling()) {
+    smpi_bench_end();
+    time = SIMIX_get_clock();
+    if (smpi_wtime_sleep > 0)
+      simcall_process_sleep(smpi_wtime_sleep);
+    smpi_bench_begin();
+  } else {
+    time = SIMIX_get_clock();
+  }
+  return time;
+}
+
 extern double sg_surf_precision;
 unsigned long long smpi_rastro_resolution ()
 {
index e75aef9..aaef32d 100644 (file)
@@ -95,8 +95,6 @@ MPI_Errhandler *MPI_ERRHANDLER_NULL = nullptr;
 // No instance gets manually created; check also the smpirun.in script as
 // this default name is used there as well (when the <actor> tag is generated).
 static const std::string smpi_default_instance_name("smpirun");
-static simgrid::config::Flag<double> smpi_wtime_sleep(
-  "smpi/wtime", "Minimum time to inject inside a call to MPI_Wtime", 0.0);
 static simgrid::config::Flag<double> smpi_init_sleep(
   "smpi/init", "Time to inject inside a call to MPI_Init", 0.0);
 
@@ -745,24 +743,3 @@ void smpi_mpi_init() {
   if(smpi_init_sleep > 0)
     simcall_process_sleep(smpi_init_sleep);
 }
-
-double smpi_mpi_wtime(){
-  double time;
-  if (smpi_process()->initialized() != 0 && smpi_process()->finalized() == 0 && smpi_process()->sampling() == 0) {
-    smpi_bench_end();
-    time = SIMIX_get_clock();
-    // to avoid deadlocks if used as a break condition, such as
-    //     while (MPI_Wtime(...) < time_limit) {
-    //       ....
-    //     }
-    // because the time will not normally advance when only calls to MPI_Wtime
-    // are made -> deadlock (MPI_Wtime never reaches the time limit)
-    if(smpi_wtime_sleep > 0)
-      simcall_process_sleep(smpi_wtime_sleep);
-    smpi_bench_begin();
-  } else {
-    time = SIMIX_get_clock();
-  }
-  return time;
-}
-
index 8f14987..d21fe8b 100644 (file)
@@ -46,7 +46,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -54,7 +54,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 1d09059..f2cf3aa 100644 (file)
@@ -54,7 +54,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
     //  sleep (30);
 
@@ -66,7 +66,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
      // sleep (60);
 
index 67cef7d..b80362f 100644 (file)
@@ -54,7 +54,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
     //  sleep (30);
 
@@ -66,7 +66,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
      // sleep (60);
 
index 63058b1..a81e4d6 100644 (file)
@@ -54,7 +54,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       //sleep (30);
 
@@ -66,7 +66,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       //sleep (60);
 
index 562af09..d73cdb1 100644 (file)
@@ -46,7 +46,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
      // sleep (60);
 
@@ -56,7 +56,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 889cf38..248d208 100644 (file)
@@ -46,7 +46,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -54,7 +54,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       //sleep (60);
 
index a68a158..1f9e86d 100644 (file)
@@ -51,7 +51,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -61,7 +61,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 0d3adfc..0ba01ea 100644 (file)
@@ -51,7 +51,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -61,7 +61,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 1f4c0cd..95390f7 100644 (file)
@@ -55,7 +55,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -65,7 +65,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
      // sleep (30);
 
index b43b516..fe8be22 100644 (file)
@@ -55,7 +55,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -65,7 +65,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
      // sleep (30);
 
index bc9bef9..67f15aa 100644 (file)
@@ -55,7 +55,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
  //     sleep (30);
 
@@ -67,7 +67,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 3dc1c19..6c6965f 100644 (file)
@@ -55,7 +55,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
  //     sleep (30);
 
@@ -67,7 +67,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 2cf5d54..3d3364c 100644 (file)
@@ -53,7 +53,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -63,7 +63,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 0d22808..14c4831 100644 (file)
@@ -56,7 +56,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
   //    sleep (30);
 
@@ -68,7 +68,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index b484939..3e08adf 100644 (file)
@@ -56,7 +56,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -66,7 +66,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
      // sleep (30);
 
index e6b990f..8841969 100644 (file)
@@ -41,8 +41,8 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
-      memset (buf1, 1, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
index 1b91f58..c3f864c 100644 (file)
@@ -35,7 +35,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Irecv (buf1, buf_size, MPI_INT,
                 MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &req);
@@ -46,7 +46,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Irecv (buf0, buf_size, MPI_INT,
                 MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &req);
index bb3eda6..1ab9cf9 100644 (file)
@@ -35,7 +35,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Irecv (buf1, buf_size, MPI_INT,
                 MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &req);
@@ -52,7 +52,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Irecv (buf1, buf_size, MPI_INT,
                 MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &req);
index 5e2dc29..e267da2 100644 (file)
@@ -51,7 +51,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -61,7 +61,7 @@ main (int argc, char **argv)
     {
       MPI_Recv (buf0, buf_size, MPI_INT, 0, 2, MPI_COMM_WORLD, statuses);
 
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 4619532..7fd9113 100644 (file)
@@ -49,7 +49,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
index 7fcd71d..e0bb126 100644 (file)
@@ -49,7 +49,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Isend (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &reqs[0]);
 
index 008c740..50509a6 100644 (file)
@@ -50,7 +50,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Recv (buf1, buf_size, MPI_INT, 0, 1, MPI_COMM_WORLD, &status);
 
index 8b34559..c6b2e60 100644 (file)
@@ -50,7 +50,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Isend (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &reqs[0]);
 
index 145f900..61a7d12 100644 (file)
@@ -51,14 +51,14 @@ main (int argc, char **argv)
 
       if (dnprocs > 1) {
        if (drank == 0) {
-         memset (buf0, 0, buf_size);
+         memset (buf0, 0, buf_size*sizeof(int));
 
          MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, comm, &status);
        
          MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
        }
        else if (drank == 1) {
-         memset (buf1, 1, buf_size);
+         memset (buf1, 1, buf_size*sizeof(int));
 
          MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
 
index 0e15d1f..902fad2 100644 (file)
@@ -64,14 +64,14 @@ main (int argc, char **argv)
 
       if (dnprocs > 1) {
        if (drank == 0) {
-         memset (buf0, 0, buf_size);
+         memset (buf0, 0, buf_size*sizeof(int));
 
          MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, comm, &status);
        
          MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
        }
        else if (drank == 1) {
-         memset (buf1, 1, buf_size);
+         memset (buf1, 1, buf_size*sizeof(int));
 
          MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
 
index 0c75f1f..0bcb22d 100644 (file)
@@ -56,14 +56,14 @@ main (int argc, char **argv)
 
       if (dnprocs > 1) {
        if (drank == 0) {
-         memset (buf0, 0, buf_size);
+         memset (buf0, 0, buf_size*sizeof(int));
 
          MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, comm, &status);
        
          MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
        }
        else if (drank == 1) {
-         memset (buf1, 1, buf_size);
+         memset (buf1, 1, buf_size*sizeof(int));
 
          MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
 
index c115c5a..a4a8b7c 100644 (file)
@@ -36,14 +36,14 @@ main (int argc, char **argv)
     MPI_Comm_dup (MPI_COMM_WORLD, &comm);
 
     if (rank == 0) {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, comm, &status);
 
       MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
     }
     else if (rank == 1) {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
 
index 17ce7e5..e6551cb 100644 (file)
@@ -42,14 +42,14 @@ main (int argc, char **argv)
 
       if (dnprocs > 1) {
        if (drank == 0) {
-         memset (buf0, 0, buf_size);
+         memset (buf0, 0, buf_size*sizeof(int));
 
          MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, comm, &status);
        
          MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
        }
        else if (drank == 1) {
-         memset (buf1, 1, buf_size);
+         memset (buf1, 1, buf_size*sizeof(int));
 
          MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
 
index c800ba6..fe3df2b 100644 (file)
@@ -48,14 +48,14 @@ main (int argc, char **argv)
 
       if (dnprocs > 1) {
        if (drank == 0) {
-         memset (buf0, 0, buf_size);
+         memset (buf0, 0, buf_size*sizeof(int));
 
          MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, comm, &status);
        
          MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
        }
        else if (drank == 1) {
-         memset (buf1, 1, buf_size);
+         memset (buf1, 1, buf_size*sizeof(int));
 
          MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
 
index f3a345e..c04617d 100644 (file)
@@ -54,14 +54,14 @@ main (int argc, char **argv)
 
        if (rnprocs > drank) {
          if (rank % 2) {
-           memset (buf1, 1, buf_size);
+           memset (buf1, 1, buf_size*sizeof(int));
 
            MPI_Recv (buf0, buf_size, MPI_INT, drank, 0, intercomm, &status);
 
            MPI_Send (buf1, buf_size, MPI_INT, drank, 0, intercomm);
          }
          else {
-           memset (buf0, 0, buf_size);
+           memset (buf0, 0, buf_size*sizeof(int));
        
            MPI_Recv (buf1, buf_size, MPI_INT, drank, 0, intercomm, &status);
        
index 587569c..6054a7d 100644 (file)
@@ -64,14 +64,14 @@ main (int argc, char **argv)
 
        if (dnprocs > 1) {
          if (drank == 0) {
-           memset (buf0, 0, buf_size);
+           memset (buf0, 0, buf_size*sizeof(int));
        
            MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, comm, &status);
        
            MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
          }
          else if (drank == 1) {
-           memset (buf1, 1, buf_size);
+           memset (buf1, 1, buf_size*sizeof(int));
 
            MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
 
index 60a3f6b..b9a5840 100644 (file)
@@ -34,7 +34,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &status);
 
@@ -42,7 +42,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
 
index 6798490..6b90e86 100644 (file)
@@ -24,13 +24,13 @@ main (int argc, char **argv)
   fflush (stdout);
 
   if (rank == 0) {
-    memset (buf0, 0, buf_size);
+    memset (buf0, 0, buf_size*sizeof(int));
     MPI_Bcast (buf0, buf_size, MPI_INT, 1, MPI_COMM_WORLD);    
     MPI_Bcast (buf0, buf_size, MPI_INT, 0, MPI_COMM_WORLD);    
   }
   else {
     if (rank == 1)
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
     MPI_Bcast (buf0, buf_size, MPI_INT, 0, MPI_COMM_WORLD);    
     MPI_Bcast (buf0, buf_size, MPI_INT, 1, MPI_COMM_WORLD);    
index 66d774b..67fc379 100644 (file)
@@ -32,8 +32,8 @@ main (int argc, char **argv)
   printf ("(%d) is alive on %s\n", rank, processor_name);
   fflush (stdout);
 
-  memset (sbuf, 0, buf_size);
-  memset (rbuf, 1, buf_size);
+  memset (sbuf, 0, buf_size*sizeof(int));
+  memset (rbuf, 1, buf_size*sizeof(int));
 
   MPI_Barrier (comm);
 
index 4cade73..ab6f32c 100644 (file)
@@ -32,8 +32,8 @@ main (int argc, char **argv)
   printf ("(%d) is alive on %s\n", rank, processor_name);
   fflush (stdout);
 
-  memset (buf0, 0, buf_size);
-  memset (buf1, 1, buf_size);
+  memset (buf0, 0, buf_size*sizeof(int));
+  memset (buf1, 1, buf_size*sizeof(int));
 
   MPI_Barrier (comm);
   MPI_Barrier (comm);
index a6da78d..69e7790 100644 (file)
@@ -32,8 +32,8 @@ main (int argc, char **argv)
   printf ("(%d) is alive on %s\n", rank, processor_name);
   fflush (stdout);
 
-  memset (buf0, 0, buf_size);
-  memset (buf1, 1, buf_size);
+  memset (buf0, 0, buf_size*sizeof(int));
+  memset (buf1, 1, buf_size*sizeof(int));
 
   MPI_Barrier (comm);
   MPI_Barrier (comm);
index 6981e60..47c383a 100644 (file)
@@ -35,7 +35,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       zero_to_two = 1;
 
@@ -47,7 +47,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
 
index 80bc5b3..2e3278e 100644 (file)
@@ -39,7 +39,7 @@ main (int argc, char **argv)
   else if ((rank == 1) && (its_raining))
     {
       /* This code is never executed... */
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 5f05b58..9165e0d 100644 (file)
@@ -56,7 +56,7 @@ main (int argc, char **argv)
 
       if (tnprocs > 1) {
        if (trank == 0) {       
-         memset (buf0, 0, buf_size);
+         memset (buf0, 0, buf_size*sizeof(int));
        
          MPI_Send (buf0, buf_size, MPI_INT, 1, 0, temp);
        }
@@ -74,14 +74,14 @@ main (int argc, char **argv)
 
        if (rnprocs > drank) {
          if (rank % 2) {
-           memset (buf1, 1, buf_size);
+           memset (buf1, 1, buf_size*sizeof(int));
 
            MPI_Recv (buf0, buf_size, MPI_INT, drank, 0, intercomm, &status);
 
            MPI_Send (buf1, buf_size, MPI_INT, drank, 0, intercomm);
          }
          else {
-           memset (buf0, 0, buf_size);
+           memset (buf0, 0, buf_size*sizeof(int));
        
            MPI_Send (buf0, buf_size, MPI_INT, drank, 0, intercomm);
        
index 3dbfc76..fe6411e 100644 (file)
@@ -56,7 +56,7 @@ main (int argc, char **argv)
                            INTERCOMM_CREATE_TAG, &intercomm);
 
       if ((trank == 0) && !(rank % 2)) {
-       memset (buf0, 0, buf_size);
+       memset (buf0, 0, buf_size*sizeof(int));
        
        MPI_Send (buf0, buf_size, MPI_INT, 1, 0, temp);
       }
@@ -73,14 +73,14 @@ main (int argc, char **argv)
 
        if (rnprocs > drank) {
          if (rank % 2) {
-           memset (buf1, 1, buf_size);
+           memset (buf1, 1, buf_size*sizeof(int));
 
            MPI_Recv (buf0, buf_size, MPI_INT, drank, 0, intercomm, &status);
 
            MPI_Send (buf1, buf_size, MPI_INT, drank, 0, intercomm);
          }
          else {
-           memset (buf0, 0, buf_size);
+           memset (buf0, 0, buf_size*sizeof(int));
        
            MPI_Send (buf0, buf_size, MPI_INT, drank, 0, intercomm);
        
index 908b887..663ded7 100644 (file)
@@ -55,7 +55,7 @@ main (int argc, char **argv)
                            INTERCOMM_CREATE_TAG, &intercomm);
 
       if (rank == 0) {
-       memset (buf0, 0, buf_size);
+       memset (buf0, 0, buf_size*sizeof(int));
        
        MPI_Send (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD);
       }
@@ -69,14 +69,14 @@ main (int argc, char **argv)
 
        if (rnprocs > drank) {
          if (rank % 2) {
-           memset (buf1, 1, buf_size);
+           memset (buf1, 1, buf_size*sizeof(int));
 
            MPI_Recv (buf0, buf_size, MPI_INT, drank, 0, intercomm, &status);
 
            MPI_Send (buf1, buf_size, MPI_INT, drank, 0, intercomm);
          }
          else {
-           memset (buf0, 0, buf_size);
+           memset (buf0, 0, buf_size*sizeof(int));
        
            MPI_Send (buf0, buf_size, MPI_INT, drank, 0, intercomm);
        
index c84e94f..25a53b5 100644 (file)
@@ -58,12 +58,12 @@ main (int argc, char **argv)
                            INTERCOMM_CREATE_TAG, &intercomm);
 
       if (rank == 2) {
-       memset (buf0, 0, buf_size);
+       memset (buf0, 0, buf_size*sizeof(int));
        
        MPI_Send (buf0, buf_size, MPI_INT, rleader, 0, MPI_COMM_WORLD);
       }
       else if (rank == 1) {
-       memset (buf0, 0, buf_size);
+       memset (buf0, 0, buf_size*sizeof(int));
        
        MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
       }
@@ -77,14 +77,14 @@ main (int argc, char **argv)
 
        if (rnprocs > drank) {
          if (rank % 2) {
-           memset (buf1, 1, buf_size);
+           memset (buf1, 1, buf_size*sizeof(int));
 
            MPI_Recv (buf0, buf_size, MPI_INT, drank, 0, intercomm, &status);
 
            MPI_Send (buf1, buf_size, MPI_INT, drank, 0, intercomm);
          }
          else {
-           memset (buf0, 0, buf_size);
+           memset (buf0, 0, buf_size*sizeof(int));
        
            MPI_Send (buf0, buf_size, MPI_INT, drank, 0, intercomm);
        
index f6dfc56..aeb4993 100644 (file)
@@ -79,14 +79,14 @@ main (int argc, char **argv)
 
              if (dnprocs > 1) {
                if (drank == 1) {
-                 memset (buf1, 1, buf_size);
+                 memset (buf1, 1, buf_size*sizeof(int));
 
                  MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm, &status);
 
                  MPI_Send (buf1, buf_size, MPI_INT, 0, 0, comm);
                }
                else if (drank == 0) {
-                 memset (buf0, 0, buf_size);
+                 memset (buf0, 0, buf_size*sizeof(int));
        
                  MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
        
@@ -102,14 +102,14 @@ main (int argc, char **argv)
 
              if (dnprocs > 1) {
                if (drank == 1) {
-                 memset (buf1, 1, buf_size);
+                 memset (buf1, 1, buf_size*sizeof(int));
 
                  MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, comm2, &status);
 
                  MPI_Send (buf1, buf_size, MPI_INT, 0, 0, comm2);
                }
                else if (drank == 0) {
-                 memset (buf0, 0, buf_size);
+                 memset (buf0, 0, buf_size*sizeof(int));
        
                  MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm2);
        
index a4ab3d0..d9a51a1 100644 (file)
@@ -36,7 +36,7 @@ main (int argc, char **argv)
     {
       int dest = (rank == nprocs - 1) ? (0) : (rank + 1);
       int src = (rank == 0) ? (nprocs - 1) : (rank - 1);
-      memset (buf0, rank, buf_size);
+      memset (buf0, rank, buf_size*sizeof(int));
       MPI_Irecv (buf0, buf_size, MPI_INT, src, 0, MPI_COMM_WORLD, &req);
       MPI_Wait(&req,&status);
       MPI_Send (buf0, buf_size, MPI_INT, dest, 0, MPI_COMM_WORLD);
index a0a2bd4..6852086 100644 (file)
@@ -38,8 +38,8 @@ main (int argc, char **argv)
     {
       int dest = (rank == nprocs - 1) ? (0) : (rank + 1);
       int src = (rank == 0) ? (nprocs - 1) : (rank - 1);
-      memset (buf0, rank, buf_size);
-      memset (buf1, rank, buf_size);
+      memset (buf0, rank, buf_size*sizeof(int));
+      memset (buf1, rank, buf_size*sizeof(int));
       MPI_Irecv (buf0, buf_size, MPI_INT, src, 0, MPI_COMM_WORLD, &req1);
       MPI_Isend (buf1, buf_size, MPI_INT, dest, 0, MPI_COMM_WORLD, &req2);
       MPI_Wait(&req2,&status);
index b5f60b2..1b8d511 100644 (file)
@@ -40,8 +40,8 @@ main (int argc, char **argv)
     {
       int dest = (rank == nprocs - 1) ? (0) : (rank + 1);
       int src = (rank == 0) ? (nprocs - 1) : (rank - 1);
-      memset (buf0, rank, buf_size);
-      memset (buf1, rank, buf_size);
+      memset (buf0, rank, buf_size*sizeof(int));
+      memset (buf1, rank, buf_size*sizeof(int));
 
       for (i = 0; i < req_count; i++) {
        MPI_Irecv (buf0, buf_size, MPI_INT, src, 0, MPI_COMM_WORLD, &req1);
index 9eee182..58976d3 100644 (file)
@@ -50,8 +50,8 @@ main (int argc, char **argv)
   printf ("(%d) is alive on %s\n", rank, processor_name);
   fflush (stdout);
 
-  memset (buf0, 0, buf_size);
-  memset (buf1, 1, buf_size);
+  memset (buf0, 0, buf_size*sizeof(int));
+  memset (buf1, 1, buf_size*sizeof(int));
 
   /* 0 sends 1 two messages, but the request gets overwritten */
   switch (rank)
index 8baabb5..840c5db 100644 (file)
@@ -47,8 +47,8 @@ main (int argc, char **argv)
   printf ("(%d) is alive on %s\n", rank, processor_name);
   fflush (stdout);
 
-  memset (buf0, 1, buf_size);
-  memset (buf1, 2, buf_size);
+  memset (buf0, 1, buf_size*sizeof(int));
+  memset (buf1, 2, buf_size*sizeof(int));
 
   MPI_Barrier(MPI_COMM_WORLD);
 
index 3be717c..ef8b4dd 100644 (file)
@@ -51,7 +51,7 @@ main (int argc, char **argv)
     {
     case 0:
       for (i = 0; i < ITERATIONS; i++) {
-       memset (buf, 1, buf_size * REQS_PER_ITERATION);
+       memset (buf, 1, buf_size*sizeof(int) * REQS_PER_ITERATION);
 
        for (j = 0; j < REQS_PER_ITERATION; j++) {
          MPI_Isend (&buf[j*buf_size], buf_size, MPI_INT,
@@ -65,7 +65,7 @@ main (int argc, char **argv)
 
     case 1:
       for (i = 0; i < ITERATIONS; i++) {
-       memset (buf, 2, buf_size * REQS_PER_ITERATION);
+       memset (buf, 2, buf_size*sizeof(int) * REQS_PER_ITERATION);
 
        for (j = 0; j < REQS_PER_ITERATION; j++) {
          MPI_Irecv (&buf[j*buf_size], buf_size, MPI_INT,
index 3d408f6..107b0fc 100644 (file)
@@ -39,7 +39,7 @@ main (int argc, char **argv)
       }
     }
     else {
-      memset (buf, 1, buf_size);
+      memset (buf, 1, buf_size*sizeof(int));
 
       MPI_Send (buf, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index 4f64a27..daef65f 100644 (file)
@@ -233,7 +233,7 @@ main (int argc, char **argv)
          }
        }
        else {
-         memset (buf, 1, buf_size);
+         memset (buf, 1, buf_size*sizeof(int));
 
          MPI_Send (buf, buf_size, MPI_INT, 0, 0, dcomms[i]);
        }
@@ -249,7 +249,7 @@ main (int argc, char **argv)
     }
     else if ((rank % 3) == 2) {
       for (j = 0; j < intersize; j++) {
-       memset (buf, 1, buf_size);
+       memset (buf, 1, buf_size*sizeof(int));
 
        MPI_Send (buf, buf_size, MPI_INT, j, 0, intercomm);
       }
@@ -273,7 +273,7 @@ main (int argc, char **argv)
          }
        }
        else {
-         memset (buf, 1, buf_size);
+         memset (buf, 1, buf_size*sizeof(int));
 
          MPI_Send (buf, buf_size, MPI_INT, 0, 0, dcomms[i]);
        }
@@ -290,7 +290,7 @@ main (int argc, char **argv)
     }
     else if ((rank % 3) == 2) {
       for (j = 0; j < intersize; j++) {
-       memset (buf, 1, buf_size);
+       memset (buf, 1, buf_size*sizeof(int));
 
        MPI_Send (buf, buf_size, MPI_INT, j, 0, intercomm);
       }
index 05b03c8..8622177 100644 (file)
@@ -35,7 +35,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Irecv (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &req);
 
@@ -46,7 +46,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Irecv (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &req);
 
index 3f497c5..9d8c31d 100644 (file)
@@ -47,7 +47,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Isend (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &reqs[0]);
 
index f7924fd..01acc80 100644 (file)
@@ -56,7 +56,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       for (i = 3; i > 0; i--) {
        MPI_Recv (&flipbit, 1, MPI_INT, 0, i, MPI_COMM_WORLD, &status);
index 0ab83aa..ee2e2ae 100644 (file)
@@ -34,7 +34,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Irecv (buf1, buf_size, MPI_INT,
                 MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &req);
@@ -45,7 +45,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Irecv (buf0, buf_size, MPI_INT,
                 MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &req);
index 59ed5d0..de167a3 100644 (file)
@@ -43,8 +43,8 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
-      memset (buf1, 1, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
index 7d17a6c..eedca26 100644 (file)
@@ -41,7 +41,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
        MPI_Irecv (buf1, buf_size, MPI_INT,
                 MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &req);
index d76749f..52b39a1 100644 (file)
@@ -49,7 +49,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Isend (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &reqs[0]);
 
index 0f9d331..057523c 100644 (file)
@@ -34,7 +34,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Irecv (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &req);
 
@@ -44,7 +44,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Irecv (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &req);
 
index 2318a95..1744416 100644 (file)
@@ -36,7 +36,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Irecv (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &req);
 
@@ -48,7 +48,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Irecv (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &req);
 
index 2c7f144..d3125b3 100644 (file)
@@ -57,7 +57,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -65,7 +65,7 @@ main (int argc, char **argv)
     }
   else if (rank == 2)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
index 56c7e6c..b886746 100644 (file)
@@ -47,7 +47,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
index 835d2a5..53e9785 100644 (file)
@@ -49,7 +49,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Isend (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &reqs[0]);
 
index b1def37..d341c7e 100644 (file)
@@ -47,7 +47,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Isend (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &reqs[0]);
 
index d8a7e89..dcfc430 100644 (file)
@@ -56,7 +56,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       for (i = 3; i > 0; i--) {
        MPI_Recv (&flipbit, 1, MPI_INT,
index 4a64b34..f4b58f0 100644 (file)
@@ -61,7 +61,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -71,7 +71,7 @@ main (int argc, char **argv)
     {
       MPI_Recv (buf0, buf_size, MPI_INT, 0, 2, MPI_COMM_WORLD, &status);
 
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
index a9e522b..21defbc 100644 (file)
@@ -50,7 +50,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Isend (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &reqs[0]);
 
index 20ff43c..6f90c53 100644 (file)
@@ -53,7 +53,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       for (i = 3; i > 0; i--) {
        MPI_Recv (&flipbit, 1, MPI_INT, 0, i, MPI_COMM_WORLD, &status);
index 7de46f9..fad99ca 100644 (file)
@@ -66,7 +66,7 @@ printf ("Done = %d\n", done);
     }
   else if (rank == 1)
     {
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       for (i = 3; i >= 0; i--) {
        MPI_Recv (&flipbit, 1, MPI_INT, 0, i, MPI_COMM_WORLD, &status);
index a78e7fe..0891d52 100644 (file)
@@ -34,7 +34,7 @@ main (int argc, char **argv)
     {
       if (rank == 0)
        {
-         memset (buf0, 0, buf_size);
+         memset (buf0, 0, buf_size*sizeof(int));
 
          MPI_Sendrecv (buf0, buf_size, MPI_INT, 1, 0,
                        buf1, buf_size, MPI_INT, 1, 0,
@@ -52,7 +52,7 @@ main (int argc, char **argv)
        {
          if (rank == 1)
            {
-             memset (buf1, 1, buf_size);
+             memset (buf1, 1, buf_size*sizeof(int));
 
              MPI_Sendrecv (buf1, buf_size, MPI_INT, 0, 0,
                            buf0, buf_size, MPI_INT, 0, 0,
index 659c1c2..a323019 100644 (file)
@@ -31,17 +31,17 @@ main (int argc, char **argv)
   src = (rank + 1) % nprocs;
   dest = (rank - 1 + nprocs) % nprocs;
 
-  memset (buf0, 0, buf_size);
+  memset (buf0, 0, buf_size*sizeof(int));
 
   MPI_Sendrecv (buf0, buf_size, MPI_INT, dest, 0,
                buf1, buf_size, MPI_INT, src, 0, MPI_COMM_WORLD, &status);
 
-  memset (buf1, 1, buf_size);
+  memset (buf1, 1, buf_size*sizeof(int));
 
   MPI_Sendrecv (buf1, buf_size, MPI_INT, src, 0,
                buf0, buf_size, MPI_INT, dest, 0, MPI_COMM_WORLD, &status);
 
-  memset (buf0, 0, buf_size);
+  memset (buf0, 0, buf_size*sizeof(int));
 
   MPI_Sendrecv (buf0, buf_size, MPI_INT, dest, 0,
                buf1, buf_size, MPI_INT, src, 0, MPI_COMM_WORLD, &status);
index c3ba9bb..3562abd 100644 (file)
@@ -33,14 +33,14 @@ main (int argc, char **argv)
   }
   else {
     if (rank == 0) {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Sendrecv (buf0, buf_size, MPI_INT, 1, 0,
                    buf1, buf_size, MPI_INT, MPI_ANY_SOURCE, 0,
                    MPI_COMM_WORLD, &status);
     }
     else if (rank == 1) {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv (buf0, buf_size, MPI_INT,
                MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &status);
index 30e6e11..2ed4e13 100644 (file)
@@ -33,14 +33,14 @@ main (int argc, char **argv)
   }
   else {
     if (rank == 0) {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Sendrecv (buf0, buf_size, MPI_INT, 1, 0,
                    buf1, buf_size, MPI_INT, 1, 0,
                    MPI_COMM_WORLD, &status);
     }
     else if (rank == 1) {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
 
index ecadd93..c0ab9fc 100644 (file)
@@ -36,7 +36,7 @@ main (int argc, char **argv)
   }
   else {
     if (rank == 0) {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send_init (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Recv_init (buf1, buf_size, MPI_INT,
@@ -47,13 +47,13 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
       MPI_Waitall (2, aReq, aStatus);
     }
     else if (rank == 1) {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv_init (buf0, buf_size, MPI_INT,
                     MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &aReq[0]);
@@ -64,7 +64,7 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf1, 0, buf_size);
+      memset (buf1, 0, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
       MPI_Waitall (2, aReq, aStatus);
index c962cca..a1a2593 100644 (file)
@@ -36,7 +36,7 @@ main (int argc, char **argv)
   }
   else {
     if (rank == 0) {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send_init (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Recv_init (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -46,14 +46,14 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
       MPI_Waitall (2, aReq, aStatus);
     }
     else if (rank == 1) {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv_init (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Send_init (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -63,7 +63,7 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf1, 0, buf_size);
+      memset (buf1, 0, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
index ea4c12b..49c2795 100644 (file)
@@ -38,7 +38,7 @@ main (int argc, char **argv)
   }
   else {
     if (rank == 0) {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send_init (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Recv_init (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -48,7 +48,7 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
@@ -59,7 +59,7 @@ main (int argc, char **argv)
       MPI_Waitall (2, aReq, aStatus);
     }
     else if (rank == 1) {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv_init (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Send_init (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -69,7 +69,7 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf1, 0, buf_size);
+      memset (buf1, 0, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
index 6b34a58..9dd14e7 100644 (file)
@@ -37,7 +37,7 @@ main (int argc, char **argv)
   }
   else {
     if (rank == 0) {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send_init (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Recv_init (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -47,11 +47,11 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       /* activate a request twice */
       MPI_Start (&aReq[0]);
@@ -59,7 +59,7 @@ main (int argc, char **argv)
       MPI_Waitall (2, aReq, aStatus);
     }
     else if (rank == 1) {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv_init (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Send_init (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -69,7 +69,7 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf1, 0, buf_size);
+      memset (buf1, 0, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
index 100d58a..569f274 100644 (file)
@@ -39,7 +39,7 @@ main (int argc, char **argv)
   }
   else {
     if (rank == 0) {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send_init (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Recv_init (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -49,7 +49,7 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
@@ -60,7 +60,7 @@ main (int argc, char **argv)
       MPI_Waitall (2, aReq, aStatus);
     }
     else if (rank == 1) {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv_init (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Send_init (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -70,7 +70,7 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf1, 0, buf_size);
+      memset (buf1, 0, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
index 131a823..c3f82aa 100644 (file)
@@ -40,7 +40,7 @@ main (int argc, char **argv)
   }
   else {
     if (rank == 0) {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Send_init (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Recv_init (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -50,14 +50,14 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
       MPI_Waitall (2, aReq, aStatus);
     }
     else if (rank == 1) {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Recv_init (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[0]);
       MPI_Send_init (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &aReq[1]);
@@ -67,7 +67,7 @@ main (int argc, char **argv)
 
       MPI_Waitall (2, aReq, aStatus);
 
-      memset (buf1, 0, buf_size);
+      memset (buf1, 0, buf_size*sizeof(int));
 
       MPI_Startall (2, aReq);
 
index c85f143..e4325fb 100644 (file)
@@ -32,14 +32,14 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
       MPI_Send (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD);
       MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &status);
     }
   else if (rank == 1)
     {
       MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
     }
 
index 1f8f98f..8c91f27 100644 (file)
@@ -36,7 +36,7 @@ main (int argc, char **argv)
     {
       if (rank == 0)
        {
-         memset (buf0, 0, buf_size);
+         memset (buf0, 0, buf_size*sizeof(int));
 
          MPI_Sendrecv (buf0, buf_size, MPI_INT, 1, 0,
                        buf1, buf_size, MPI_INT, 1, 0,
@@ -46,7 +46,7 @@ main (int argc, char **argv)
        }
       else if (rank == 1)
        {
-         memset (buf1, 1, buf_size);
+         memset (buf1, 1, buf_size*sizeof(int));
 
          MPI_Recv (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
 
@@ -56,7 +56,7 @@ main (int argc, char **argv)
        }
       else if (rank == 2)
        {
-         memset (buf1, 1, buf_size);
+         memset (buf1, 1, buf_size*sizeof(int));
 
          MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
index e528524..288be7c 100644 (file)
@@ -34,7 +34,7 @@ main (int argc, char **argv)
     }
   else if (rank == 0)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Irecv (buf1, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD, &req);
 
@@ -44,7 +44,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf1, 1, buf_size);
+      memset (buf1, 1, buf_size*sizeof(int));
 
       MPI_Irecv (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &req);
 
index 5cf0a88..be2a1e0 100644 (file)
@@ -47,7 +47,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 0, buf_size);
+      memset (buf0, 0, buf_size*sizeof(int));
 
       MPI_Isend (buf0, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &reqs[0]);
 
index 76dcb1b..403ffb1 100644 (file)
@@ -54,7 +54,7 @@ main (int argc, char **argv)
     }
   else if (rank == 1)
     {
-      memset (buf0, 1, buf_size);
+      memset (buf0, 1, buf_size*sizeof(int));
 
       for (i = 3; i > 0; i--) {
        MPI_Recv (&flipbit, 1, MPI_INT, 0, i, MPI_COMM_WORLD, &status);