Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 28 Nov 2016 20:27:38 +0000 (21:27 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 28 Nov 2016 20:27:38 +0000 (21:27 +0100)
50 files changed:
src/mc/Client.cpp
src/mc/ModelChecker.cpp
src/mc/PageStore.cpp
src/mc/mc_unw.cpp
src/xbt/memory_map.cpp
teshsuite/smpi/isp/umpire/CMakeLists.txt
teshsuite/smpi/isp/umpire/any_src-wait-deadlock2.c
teshsuite/smpi/isp/umpire/bcast-deadlock.c
teshsuite/smpi/isp/umpire/change-send-buffer-exhaustive.c
teshsuite/smpi/isp/umpire/change-send-buffer-type-exhaustive.c
teshsuite/smpi/isp/umpire/change-send-buffer.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/comm-bcast-deadlock.c
teshsuite/smpi/isp/umpire/comm-deadlock.c
teshsuite/smpi/isp/umpire/comm-dup-no-free.c
teshsuite/smpi/isp/umpire/comm-simple.c
teshsuite/smpi/isp/umpire/comm-split-no-free.c
teshsuite/smpi/isp/umpire/comm-translate-ranks.c
teshsuite/smpi/isp/umpire/deadlock-config.c
teshsuite/smpi/isp/umpire/errhandler-no-error.c
teshsuite/smpi/isp/umpire/errhandler-no-free.c
teshsuite/smpi/isp/umpire/group-no-error-exhaustive.c
teshsuite/smpi/isp/umpire/group-no-free-exhaustive.c
teshsuite/smpi/isp/umpire/hello.c
teshsuite/smpi/isp/umpire/lost-request-waitall.c
teshsuite/smpi/isp/umpire/no-error-interleaved-isend.c
teshsuite/smpi/isp/umpire/no-error-persistent-all-completions.c
teshsuite/smpi/isp/umpire/no-error-persistent-test.c
teshsuite/smpi/isp/umpire/no-error-persistent-testpartial.c
teshsuite/smpi/isp/umpire/no-error-persistent-waitpartial.c
teshsuite/smpi/isp/umpire/no-error-persistent.c
teshsuite/smpi/isp/umpire/no-error-vector-isend.c
teshsuite/smpi/isp/umpire/op-no-error.c
teshsuite/smpi/isp/umpire/op-no-free.c
teshsuite/smpi/isp/umpire/partial-recv-exhaustive.c
teshsuite/smpi/isp/umpire/partial-recv-persistent.c
teshsuite/smpi/isp/umpire/partial-recv-persistent2.c
teshsuite/smpi/isp/umpire/partial-recv-persistent3.c
teshsuite/smpi/isp/umpire/partial-recv-persistent4.c
teshsuite/smpi/isp/umpire/partial-recv.c
teshsuite/smpi/isp/umpire/pt2pt-byte-int-mismatch.c
teshsuite/smpi/isp/umpire/remote_group-no-error.c
teshsuite/smpi/isp/umpire/type-commit-twice.c
teshsuite/smpi/isp/umpire/type-no-error-exhaustive-with-isends.c
teshsuite/smpi/isp/umpire/type-no-error-exhaustive.c
teshsuite/smpi/isp/umpire/type-no-error.c
teshsuite/smpi/isp/umpire/type-no-free-exhaustive.c
teshsuite/smpi/isp/umpire/type-no-free.c

index e2f389d..e712aff 100644 (file)
@@ -73,7 +73,7 @@ Client* Client::initialize()
 #elif defined BSD
   ptrace(PT_TRACE_ME, 0, nullptr, 0);
 #else
-# error "ptrace not declared on this platform"
+# error "no ptrace equivalent coded for this platform"
 #endif
   if(errno != 0 || raise(SIGSTOP) != 0)
     xbt_die("Could not wait for the model-checker");
index 5d0e4af..1600748 100644 (file)
@@ -40,6 +40,12 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_ModelChecker, mc, "ModelChecker");
 
 using simgrid::mc::remote;
 
+#ifdef __linux__
+# define WAITPID_CHECKED_FLAGS __WALL
+#else
+# define WAITPID_CHECKED_FLAGS 0
+#endif
+
 // Hardcoded index for now:
 #define SOCKET_FD_INDEX 0
 #define SIGNAL_FD_INDEX 1
@@ -91,7 +97,7 @@ void ModelChecker::start()
   int status;
 
   // The model-checked process SIGSTOP itself to signal it's ready:
-  pid_t res = waitpid(pid, &status, __WALL);
+  pid_t res = waitpid(pid, &status, WAITPID_CHECKED_FLAGS);
   if (res < 0 || !WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP)
     xbt_die("Could not wait model-checked process");
 
@@ -102,8 +108,14 @@ void ModelChecker::start()
 
   setup_ignore();
 
+#ifdef __linux__
   ptrace(PTRACE_SETOPTIONS, pid, nullptr, PTRACE_O_TRACEEXIT);
   ptrace(PTRACE_CONT, pid, 0, 0);
+#elif defined BSD
+  ptrace(PT_CONTINUE, pid, (caddr_t)1, 0);
+#else
+# error "no ptrace equivalent coded for this platform"
+#endif
 }
 
 static const std::pair<const char*, const char*> ignored_local_variables[] = {
@@ -393,6 +405,7 @@ void ModelChecker::handle_waitpid()
     if (pid == this->process().pid()) {
 
       // From PTRACE_O_TRACEEXIT:
+#ifdef __linux__
       if (status>>8 == (SIGTRAP | (PTRACE_EVENT_EXIT<<8))) {
         if (ptrace(PTRACE_GETEVENTMSG, this->process().pid(), 0, &status) == -1)
           xbt_die("Could not get exit status");
@@ -401,11 +414,18 @@ void ModelChecker::handle_waitpid()
           mc_model_checker->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
         }
       }
+#endif
 
       // We don't care about signals, just reinject them:
       if (WIFSTOPPED(status)) {
         XBT_DEBUG("Stopped with signal %i", (int) WSTOPSIG(status));
-        if (ptrace(PTRACE_CONT, this->process().pid(), 0, WSTOPSIG(status)) == -1)
+        errno = 0;
+#ifdef __linux__
+        ptrace(PTRACE_CONT, this->process().pid(), 0, WSTOPSIG(status));
+#elif defined BSD
+        ptrace(PT_CONTINUE, this->process().pid(), nullptr, WSTOPSIG(status));
+#endif
+        if (errno != 0)
           xbt_die("Could not PTRACE_CONT");
       }
 
index f8bb9bf..78f28e6 100644 (file)
@@ -8,6 +8,9 @@
 #include <string.h> // memcpy, memcmp
 
 #include <sys/mman.h>
+#ifdef __FreeBSD__
+# define MAP_POPULATE MAP_PREFAULT_READ
+#endif
 
 #include <xbt/base.h>
 #include <xbt/log.h>
@@ -71,12 +74,46 @@ void PageStore::resize(std::size_t size)
 {
   size_t old_bytesize = this->capacity_ << xbt_pagebits;
   size_t new_bytesize = size << xbt_pagebits;
+  void *new_memory;
 
   // Expand the memory region by moving it into another
   // virtual memory address if necessary:
-  void* new_memory = mremap(this->memory_, old_bytesize, new_bytesize, MREMAP_MAYMOVE);
+#if HAVE_MREMAP
+  new_memory = mremap(this->memory_, old_bytesize, new_bytesize, MREMAP_MAYMOVE);
   if (new_memory == MAP_FAILED)
     xbt_die("Could not mremap snapshot pages.");
+#else
+  if (new_bytesize > old_bytesize) {
+    // Grow: first try to add new space after current map
+    new_memory = mmap((char *)this->memory_ + old_bytesize,
+                      new_bytesize-old_bytesize,
+                      PROT_READ|PROT_WRITE,
+                      MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE,
+                      -1, 0);
+    if (new_memory == MAP_FAILED)
+      xbt_die("Could not mremap snapshot pages.");
+    // Check if expanding worked
+    if (new_memory != (char *)this->memory_ + old_bytesize) {
+      // New memory segment could not be put at the end of this->memory_,
+      // so cancel this one and try to rellocate everything and copy data
+      munmap(new_memory, new_bytesize-old_bytesize);
+      new_memory = mmap(nullptr,
+                        new_bytesize,
+                        PROT_READ|PROT_WRITE,
+                        MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE,
+                        -1, 0);
+      if (new_memory == MAP_FAILED)
+        xbt_die("Could not mremap snapshot pages.");
+      memcpy(new_memory, this->memory_, old_bytesize);
+      munmap(this->memory_, old_bytesize);
+    }
+  }
+  else {
+    // We don't have functions to shrink a mapping, so leave memory as
+    // it is for now
+    new_memory = this->memory_;
+  }
+#endif
 
   this->capacity_ = size;
   this->memory_ = new_memory;
index 5b620dc..a48ab17 100644 (file)
 #include <string.h>
 
 // On x86_64, libunwind unw_context_t has the same layout as ucontext_t:
+#include <sys/types.h>
 #include <sys/ucontext.h>
+#ifdef __FreeBSD__
+typedef register_t greg_t;
+#endif
 
 #include <libunwind.h>
 
@@ -93,6 +97,7 @@ void* UnwindContext::get_reg(unw_context_t* context, unw_regnum_t regnum) noexce
 #ifdef __x86_64
   mcontext_t* mcontext = &context->uc_mcontext;
   switch (regnum) {
+# ifdef __linux__
   case UNW_X86_64_RAX: return &mcontext->gregs[REG_RAX];
   case UNW_X86_64_RDX: return &mcontext->gregs[REG_RDX];
   case UNW_X86_64_RCX: return &mcontext->gregs[REG_RCX];
@@ -110,6 +115,27 @@ void* UnwindContext::get_reg(unw_context_t* context, unw_regnum_t regnum) noexce
   case UNW_X86_64_R14: return &mcontext->gregs[REG_R14];
   case UNW_X86_64_R15: return &mcontext->gregs[REG_R15];
   case UNW_X86_64_RIP: return &mcontext->gregs[REG_RIP];
+# elif defined __FreeBSD__
+  case UNW_X86_64_RAX: return &mcontext->mc_rax;
+  case UNW_X86_64_RDX: return &mcontext->mc_rdx;
+  case UNW_X86_64_RCX: return &mcontext->mc_rcx;
+  case UNW_X86_64_RBX: return &mcontext->mc_rbx;
+  case UNW_X86_64_RSI: return &mcontext->mc_rsi;
+  case UNW_X86_64_RDI: return &mcontext->mc_rdi;
+  case UNW_X86_64_RBP: return &mcontext->mc_rbp;
+  case UNW_X86_64_RSP: return &mcontext->mc_rsp;
+  case UNW_X86_64_R8:  return &mcontext->mc_r8;
+  case UNW_X86_64_R9:  return &mcontext->mc_r9;
+  case UNW_X86_64_R10: return &mcontext->mc_r10;
+  case UNW_X86_64_R11: return &mcontext->mc_r11;
+  case UNW_X86_64_R12: return &mcontext->mc_r12;
+  case UNW_X86_64_R13: return &mcontext->mc_r13;
+  case UNW_X86_64_R14: return &mcontext->mc_r14;
+  case UNW_X86_64_R15: return &mcontext->mc_r15;
+  case UNW_X86_64_RIP: return &mcontext->mc_rip;
+# else
+#  error "Unable to get register from ucontext, please add your case"
+# endif
   default: return nullptr;
   }
 #else
@@ -220,6 +246,7 @@ void UnwindContext::initialize(simgrid::mc::Process* process, unw_context_t* c)
   // Take a copy of the context for our own purpose:
   this->unwindContext_ = *c;
 #if SIMGRID_PROCESSOR_x86_64 || SIMGRID_PROCESSOR_i686
+# ifdef __linux__
   // On x86_64, ucontext_t contains a pointer to itself for FP registers.
   // We don't really need support for FR registers as they are caller saved
   // and probably never use those fields as libunwind-x86_64 does not read
@@ -229,6 +256,7 @@ void UnwindContext::initialize(simgrid::mc::Process* process, unw_context_t* c)
 
   // Let's ignore this and see what happens:
   this->unwindContext_.uc_mcontext.fpregs = nullptr;
+# endif
 #else
   // Do we need to do any fixup like this?
   #error Target CPU type is not handled.
index 61355f4..e55ae03 100644 (file)
@@ -209,15 +209,13 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     memreg.end_addr = vmentries[i].kve_end;
 
     /* Permissions */
-    memreg.prot = 0;
+    memreg.prot = PROT_NONE;
     if (vmentries[i].kve_protection & KVME_PROT_READ)
       memreg.prot |= PROT_READ;
     if (vmentries[i].kve_protection & KVME_PROT_WRITE)
       memreg.prot |= PROT_WRITE;
     if (vmentries[i].kve_protection & KVME_PROT_EXEC)
       memreg.prot |= PROT_EXEC;
-    if (memreg.prot == 0)
-      memreg.prot |= PROT_NONE;
 
     /* Private (copy-on-write) or shared? */
     if (vmentries[i].kve_flags & KVME_FLAG_COW)
@@ -235,16 +233,30 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     /* Inode */
     memreg.inode = vmentries[i].kve_vn_fileid;
 
-    /*
-     * Path. Linuxize result by giving an anonymous mapping a path from
-     * the previous mapping... provided previous is vnode and has a path.
-     */
+     /*
+      * Path. Linuxize result by giving an anonymous mapping a path from
+      * the previous mapping, provided previous is vnode and has a path,
+      * and mark the stack.
+      */
     if (vmentries[i].kve_path[0] != '\0')
       memreg.pathname = vmentries[i].kve_path;
     else if (vmentries[i].kve_type == KVME_TYPE_DEFAULT
            && vmentries[i-1].kve_type == KVME_TYPE_VNODE
         && vmentries[i-1].kve_path[0] != '\0')
       memreg.pathname = vmentries[i-1].kve_path;
+    else if (vmentries[i].kve_type == KVME_TYPE_DEFAULT
+        && vmentries[i].kve_flags & KVME_FLAG_GROWS_DOWN)
+      memreg.pathname = "[stack]";
+
+    /*
+     * One last dirty modification: remove write permission from shared
+     * libraries private clean pages. This is necessary because simgrid
+     * later identifies mappings based on the permissions that are expected
+     * when running the Linux kernel.
+     */
+    if (vmentries[i].kve_type == KVME_TYPE_VNODE
+        && ! (vmentries[i].kve_flags & KVME_FLAG_NEEDS_COPY))
+      memreg.prot &= ~PROT_WRITE;
 
     ret.push_back(std::move(memreg));
   }
index 3eda492..d881695 100644 (file)
@@ -208,7 +208,7 @@ if(enable_smpi AND enable_model-checking AND enable_smpi_ISP_testsuite)
   foreach (test ${umpire_tests_passing} ${umpire_tests_deadlock} ${umpire_tests_problematic} )
     add_executable(${test} ${test}.c)
     target_link_libraries(${test} simgrid)
-    set_source_files_properties(${test}.c PROPERTIES COMPILE_FLAGS "-Wno-error")
+    set_source_files_properties(${test}.c PROPERTIES COMPILE_FLAGS "-Wno-error -Wno-return-type")
     set(umpire_tesh ${umpire_tesh} ${test})
     set(files_to_clean ${files_to_clean} ${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh)
   endforeach(test)
index 40d3ccd..e3503a1 100644 (file)
@@ -40,7 +40,7 @@ main (int argc, char **argv)
 
       MPI_Irecv (buf1, buf_size, MPI_INT, 
                 MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &req);
-      printf("Proc 0:  Request number - %d\n",req);
+      printf("Proc 0:  Request number - %p\n",req);
       
       MPI_Send (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD);
        
@@ -49,7 +49,7 @@ main (int argc, char **argv)
       MPI_Send (buf0, buf_size, MPI_INT, 1, 0, MPI_COMM_WORLD);
 
       MPI_Wait (&req, &status);
-      printf("Proc 0:  Request number after wait test- %d\n",req);
+      printf("Proc 0:  Request number after wait test- %p\n",req);
     }
   else if (rank == 1)
     {
@@ -57,7 +57,7 @@ main (int argc, char **argv)
 
       MPI_Irecv (buf1, buf_size, MPI_INT, 
                 MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &req);
-      printf("Proc 1:  Request number - %d\n",req);
+      printf("Proc 1:  Request number - %p\n",req);
 
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
@@ -66,7 +66,7 @@ main (int argc, char **argv)
       MPI_Send (buf1, buf_size, MPI_INT, 0, 0, MPI_COMM_WORLD);
 
       MPI_Wait (&req, &status);
-      printf("Proc 1:  Request number after wait test- %d\n",req);
+      printf("Proc 1:  Request number after wait test- %p\n",req);
     }
 
   MPI_Barrier (MPI_COMM_WORLD);
index eb1d7ba..6798490 100644 (file)
@@ -10,7 +10,7 @@ int
 main (int argc, char **argv)
 {
   int rank;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf0[buf_size];
index 3b1945d..661ba0a 100644 (file)
@@ -24,7 +24,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int bbuf[(BUF_SIZE + MPI_BSEND_OVERHEAD) * 2 * NUM_BSEND_TYPES];
index 06735db..f95139a 100644 (file)
@@ -52,7 +52,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int i, j, k, basic_extent;
index 5a85ace..4d21ed5 100644 (file)
@@ -18,7 +18,7 @@ main (int argc, char **argv)
   int rank = -1;
   int tag1 = 0;
   int tag2 = 0;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf0[128];
index 5611247..66d774b 100644 (file)
@@ -18,7 +18,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int sbuf[buf_size];
index b5e0b5b..4cade73 100644 (file)
@@ -18,7 +18,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf0[buf_size];
index 403c493..a6da78d 100644 (file)
@@ -18,7 +18,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf0[buf_size];
index 8c1b86c..342e3b0 100644 (file)
@@ -17,7 +17,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   MPI_Comm inverted_comm;
index dcc2289..30b297e 100644 (file)
@@ -17,7 +17,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   MPI_Comm nc1;
index b497948..2042d21 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   MPI_Comm newcomm;
index 274769a..d5946a7 100644 (file)
@@ -17,7 +17,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   MPI_Comm newcomm;
@@ -45,7 +45,7 @@ main (int argc, char **argv)
 
     MPI_Comm_size (newcomm, &nsize);
     MPI_Comm_rank (newcomm, &nrank);
-    printf ("world task %d/%d/%d maps to new comm task %d/%d/%d\n",
+    printf ("world task %p/%d/%d maps to new comm task %p/%d/%d\n",
            comm, nprocs, rank, newcomm, nsize, nrank);
 
     if (nrank == 0)
@@ -55,7 +55,7 @@ main (int argc, char **argv)
 
     MPI_Bcast (&dat, 1, MPI_INT, 0, newcomm);
 
-    printf ("world task %d/%d/%d maps to new comm task %d/%d/%d --> %d\n",
+    printf ("world task %p/%d/%d maps to new comm task %p/%d/%d --> %d\n",
            comm, nprocs, rank, newcomm, nsize, nrank, dat);
   }
 
index cd9fb8a..bfcaaa5 100644 (file)
@@ -17,7 +17,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   MPI_Comm newcomm;
index f3d09bd..c6e54ca 100644 (file)
@@ -17,7 +17,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   MPI_Comm newcomm;
@@ -45,7 +45,7 @@ main (int argc, char **argv)
 
     MPI_Comm_size (newcomm, &nsize);
     MPI_Comm_rank (newcomm, &nrank);
-    printf ("world task %d/%d/%d maps to new comm task %d/%d/%d\n",
+    printf ("world task %p/%d/%d maps to new comm task %p/%d/%d\n",
            comm, nprocs, rank, newcomm, nsize, nrank);
   }
 
index 0b9b410..497c9d3 100644 (file)
@@ -5,6 +5,7 @@
 
 #define buf_size 32000
 
+int
 main (int argc, char **argv)
 {
   int nprocs = -1;
index fdb3053..10239d4 100644 (file)
@@ -41,7 +41,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   int i;
   char processor_name[128];
   int namelen = 128;
index 3870ad5..2d55368 100644 (file)
@@ -41,7 +41,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   int i;
   char processor_name[128];
   int namelen = 128;
index a2bdbd3..01e7b75 100644 (file)
@@ -22,7 +22,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int i;
index be2f596..d2c9a74 100644 (file)
@@ -22,7 +22,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int i;
index fa0e706..20832d3 100644 (file)
    hello.c -- simple hello world app
 
  */
-
+#include <stdio.h>
 #ifndef lint
 static char *rcsid = "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/hello.c,v 1.2 2000/12/04 19:09:46 bronis Exp $";
 #endif
 
 #include "mpi.h"
 
+int
 main (int argc, char **argv)
 {
   int nprocs = -1;
index cf7da83..4a6051b 100644 (file)
@@ -14,7 +14,7 @@ static char *rcsid =
 
 #define buf_size 128
 
-mydelay ()                     /* about 6 seconds */
+int mydelay ()                 /* about 6 seconds */
 {
   int i;
   int val;
@@ -32,7 +32,7 @@ main (int argc, char **argv)
   int rank = -1;
   int tag1 = 31;
   int tag2 = 32;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf0[buf_size];
index 762ce39..e40a9c4 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[buf_size];
index 03267e3..eb77c9c 100644 (file)
@@ -20,7 +20,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[BUF_SIZE * 2];
index 1fac72d..930178c 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[BUF_SIZE * 2];
index 9f0323e..fd2a82e 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[BUF_SIZE * 2];
index d64207b..1ff4276 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[BUF_SIZE * 2];
index 10f502d..8b157b3 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[BUF_SIZE * 2];
index e217177..0c1fc09 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[buf_size];
index 1cf7bb7..6f4cf31 100644 (file)
@@ -44,7 +44,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   int i;
   char processor_name[128];
   int namelen = 128;
index 21cd5ae..f611504 100644 (file)
@@ -44,7 +44,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   int i;
   char processor_name[128];
   int namelen = 128;
index f942daa..03bcddd 100644 (file)
@@ -27,7 +27,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int bbuf[(BUF_SIZE + MPI_BSEND_OVERHEAD) * 2 * NUM_BSEND_TYPES];
index c97dfb5..81fbd8a 100644 (file)
@@ -21,7 +21,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[BUF_SIZE * 2 + SLOP];
index 25786ea..336da22 100644 (file)
@@ -21,7 +21,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[BUF_SIZE * 2 + SLOP];
index 547ace9..ef15c1c 100644 (file)
@@ -21,7 +21,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[BUF_SIZE * 2 + SLOP];
index d63c5b5..1a7f292 100644 (file)
@@ -21,7 +21,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int buf[BUF_SIZE * 2 + SLOP];
index 669021d..59835fb 100644 (file)
@@ -39,11 +39,13 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
-  int i, basic_extent;
-  int blocklens[3], displs[3];
+  int i;
+  MPI_Aint basic_extent;
+  int blocklens[3];
+  MPI_Aint displs[3];
   MPI_Datatype structtypes[3]; 
   MPI_Datatype newtype[2]; 
   MPI_Request aReq[2];
@@ -79,13 +81,13 @@ main (int argc, char **argv)
   
   MPI_Type_extent (newtype[0], &basic_extent);
   if (basic_extent != sizeof (test_small_struct_t)) {
-    fprintf (stderr, "(%d): Unexpected extent for small struct\n");
+    fprintf (stderr, "(%d): Unexpected extent for small struct\n", rank);
     MPI_Abort (MPI_COMM_WORLD, 666);
   }
   
   MPI_Type_extent (newtype[1], &basic_extent);
   if (basic_extent != sizeof (test_big_struct_t)) {
-    fprintf (stderr, "(%d): Unexpected extent for big struct\n");
+    fprintf (stderr, "(%d): Unexpected extent for big struct\n", rank);
     MPI_Abort (MPI_COMM_WORLD, 666);
   }
 
index 36c71f5..13fbd55 100644 (file)
@@ -26,7 +26,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int bbuf[(BUF_SIZE + MPI_BSEND_OVERHEAD) * 2 * NUM_BSEND_TYPES];
index 0b01269..a93eff6 100644 (file)
@@ -21,7 +21,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int i;
index 4d25326..76debc3 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   MPI_Datatype newtype;
index b2ceace..8826ce2 100644 (file)
@@ -54,7 +54,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int i, j, k, basic_extent;
index 22e2eb2..6515ea2 100644 (file)
@@ -20,7 +20,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int i;
index 2cac143..35333a1 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   MPI_Datatype newtype, newtype2;
index a321842..7cd7c0c 100644 (file)
@@ -20,7 +20,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   int i;
index 19abfd9..f8dab6e 100644 (file)
@@ -19,7 +19,7 @@ main (int argc, char **argv)
 {
   int nprocs = -1;
   int rank = -1;
-  int comm = MPI_COMM_WORLD;
+  MPI_Comm comm = MPI_COMM_WORLD;
   char processor_name[128];
   int namelen = 128;
   MPI_Datatype newtype;