build_hurd
authorDebian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>
Fri, 14 Nov 2014 16:57:11 +0000 (16:57 +0000)
committerJulien Cristau <jcristau@debian.org>
Fri, 14 Nov 2014 16:57:11 +0000 (16:57 +0000)
Gbp-Pq: Name build_hurd

14 files changed:
ompi/runtime/ompi_mpi_abort.c
ompi/runtime/ompi_mpi_finalize.c
opal/mca/base/mca_base_component_find.c
opal/mca/base/mca_base_param.c
opal/mca/memory/linux/configure.m4
opal/mca/pstat/darwin/configure.m4
opal/mca/shmem/mmap/shmem_mmap_module.c
opal/mca/shmem/posix/shmem_posix_common_utils.h
opal/mca/shmem/sysv/shmem_sysv_module.c
opal/mca/sysinfo/darwin/configure.m4
opal/util/stacktrace.c
orte/mca/odls/base/odls_base_default_fns.c
orte/orted/orted_main.c
orte/util/context_fns.c

index 766dd1b165bfa0ba18c7defedd8428eb26eb1159..69bd8923058fda2a74036185e7d3d8c6ff7a380b 100644 (file)
@@ -53,10 +53,11 @@ ompi_mpi_abort(struct ompi_communicator_t* comm,
                bool kill_remote_of_intercomm)
 {
     int count = 0, i;
-    char *msg, *host, hostname[MAXHOSTNAMELEN];
+    char *msg, *host = NULL;
     pid_t pid = 0;
     orte_process_name_t *abort_procs;
     orte_std_cntr_t nabort_procs;
+    bool free_host = false;
 
     /* Protection for recursive invocation */
     if (have_been_invoked) {
@@ -70,8 +71,12 @@ ompi_mpi_abort(struct ompi_communicator_t* comm,
     if (orte_initialized) {
         host = orte_process_info.nodename;
     } else {
-        gethostname(hostname, sizeof(hostname));
-        host = hostname;
+        size_t host_length = 128;
+        do {
+            host_length *= 2;
+            host = realloc(host, host_length);
+        } while ((gethostname(host, host_length) == -1) && (errno == ENAMETOOLONG));
+        free_host = true;
     }
     pid = getpid();
 
index e65030cf3ba9109e491d5e3604bd84841a8b22cd..7365a7634179aea56711e88268e1f859a963357c 100644 (file)
@@ -101,13 +101,18 @@ int ompi_mpi_finalize(void)
         /* Note that if we're already finalized, we cannot raise an
            MPI exception.  The best that we can do is write something
            to stderr. */
-        char hostname[MAXHOSTNAMELEN];
+        char *hostname = NULL;
+        size_t hostname_length = 128;
         pid_t pid = getpid();
-        gethostname(hostname, sizeof(hostname));
+        do {
+            hostname_length *= 2;
+            hostname = realloc(hostname, hostname_length);
+        } while ((gethostname(hostname, hostname_length) == -1) && (errno == ENAMETOOLONG));
 
         orte_show_help("help-mpi-runtime.txt",
                        "mpi_finalize:invoked_multiple_times",
                        true, hostname, pid);
+        free(hostname);
         return MPI_ERR_OTHER;
     }
 
index b225901132d65a9bbb967e8121c245416fcaeb1b..4566a2678b3f7b59075d851bdc99c28ac88892a6 100644 (file)
@@ -208,11 +208,16 @@ int mca_base_component_find(const char *directory, const char *type,
         }
 
         if (opal_list_get_end(found_components) == item) {
-            char h[MAXHOSTNAMELEN];
-            gethostname(h, sizeof(h));
+            char *h = NULL;
+            size_t h_length = 128;
+            do {
+                h_length *= 2;
+                h = realloc(h, h_length);
+            } while ((gethostname(h, h_length) == -1) && (errno == ENAMETOOLONG));
             opal_show_help("help-mca-base.txt", 
                            "find-available:not-valid", true,
                            h, type, requested_component_names[i]);
+            free(h);
             return OPAL_ERR_NOT_FOUND;
         }
     }
index 2bcfa7bf5c4b98c53a19c98d52f2071f694387ce..e98a2f59f7142effc6310d6bdaeb6b91e0519a28 100644 (file)
@@ -186,8 +186,14 @@ int mca_base_param_recache_files(bool rel_path_search)
     home = (char*)opal_home_directory();
     
     if(NULL == cwd) {
+#if !defined(MAXPATHLEN) && defined(__GLIBC__)
+        cwd = get_current_dir_name();
+        if( NULL == cwd)
+#else
         cwd = (char *) malloc(sizeof(char) * MAXPATHLEN);
-        if( NULL == (cwd = getcwd(cwd, MAXPATHLEN) )) {
+        if( NULL == (cwd = getcwd(cwd, MAXPATHLEN) ))
+#endif
+        {
             opal_output(0, "Error: Unable to get the current working directory\n");
             cwd = strdup(".");
         }
index 5adf3940921c8c0caa593debad2a3ddc4bee4833..22a2e6db2b852db883f0982f1406d355679c0bf8 100644 (file)
@@ -58,6 +58,10 @@ AC_DEFUN([MCA_memory_linux_CONFIG],[
                  [memory_linux_ptmalloc2_happy=yes
                   memory_linux_ummu_happy=no])])
 
+    AS_IF([echo "$host_os" | grep '^gnu' >/dev/null 2>/dev/null],
+          [memory_linux_ptmalloc2_happy=no
+           memory_linux_ummu_happy=no])
+
     ######################################################################
     # ptmalloc2
     ######################################################################
index 51573f97ac916300a4a80281a9916a3999e57022..9c3328b5a38f50cdd7b4c8f3b39b9addb41e1320 100644 (file)
@@ -23,9 +23,9 @@
 # -----------------------------------------------------------
 AC_DEFUN([MCA_pstat_darwin_CONFIG],[
     OMPI_VAR_SCOPE_PUSH([paff_darwin_happy])
-    # check to see if we have <mach/mach_host.h>
+    # check to see if we have <mach/clock.h>
     # as this is a Darwin-specific thing
-    AC_CHECK_HEADER([mach/mach_host.h], [paff_darwin_happy=yes], [paff_darwin_happy=no])
+    AC_CHECK_HEADER([mach/clock.h], [paff_darwin_happy=yes], [paff_darwin_happy=no])
 
     AS_IF([test "$paff_darwin_happy" = "yes"], [$1], [$2])
     OMPI_VAR_SCOPE_POP
index d8b4d23f5050d1bdfce0705d4f6ad3d9d2b8d6dd..748ba40bff226a5b333050cab2ee91a536fec0d2 100644 (file)
 
 /* for tons of debug output: -mca shmem_base_verbose 70 */
 
+#ifndef MAXHOSTNAMELEN
+# define MAXHOSTNAMELEN 256
+#endif
+
 /* ////////////////////////////////////////////////////////////////////////// */
 /*local functions */
 /* local functions */
index e83a2bc736a4379e2aa6b64113d9b1cde8c14467..d18c64c879eb0e64298b6913b226ac5109e31b3a 100644 (file)
@@ -45,6 +45,10 @@ BEGIN_C_DECLS
 OPAL_DECLSPEC extern int shmem_posix_shm_open(char *posix_file_name_buff,
                                               size_t size);
 
+#ifndef MAXHOSTNAMELEN
+# define MAXHOSTNAMELEN 256
+#endif
+
 END_C_DECLS
 
 #endif /* OPAL_SHMEM_POSIX_COMMON_UTILS_H */
index 240b459ef8638c9f067922f55c1029e76555c83f..a83434155ce19e44459a31b7f6f9759926c653dc 100644 (file)
 
 /* for tons of debug output: -mca shmem_base_verbose 70 */
 
+#ifndef MAXHOSTNAMELEN
+# define MAXHOSTNAMELEN 256
+#endif
+
 /* ////////////////////////////////////////////////////////////////////////// */
 /* local functions */
 static int
index 273f74e78085fdb502bdbee2effbece30b72438b..1695c752d837eb1cc03a9446b3e7bec6c850a2a7 100644 (file)
@@ -12,9 +12,9 @@
 # -----------------------------------------------------------
 AC_DEFUN([MCA_sysinfo_darwin_CONFIG],[
     OMPI_VAR_SCOPE_PUSH([sysinfo_darwin_happy])
-    # check to see if we have <mach/mach_host.h>
+    # check to see if we have <mach/clock.h>
     # as this is a Darwin-specific thing
-    AC_CHECK_HEADER([mach/mach_host.h], [sysinfo_darwin_happy=yes], [sysinfo_darwin_happy=no])
+    AC_CHECK_HEADER([mach/clock.h], [sysinfo_darwin_happy=yes], [sysinfo_darwin_happy=no])
 
     AS_IF([test "$sysinfo_darwin_happy" = "yes"], [$1], [$2])
     OMPI_VAR_SCOPE_POP
index 7766bce13e66103aaf587d5a767bf5324f7eb4dc..54fb6dcc3867b343e5213b8c816c36f1f4945f78 100644 (file)
@@ -437,8 +437,12 @@ int opal_util_register_stackhandlers (void)
     mca_base_param_lookup_string (param, &string_value);
 
     memset(&act, 0, sizeof(act));
+#ifdef SA_SIGINFO
     act.sa_sigaction = show_stackframe;
     act.sa_flags = SA_SIGINFO;
+#else
+    act.sa_handler = show_stackframe_handler;
+#endif
 #ifdef SA_ONESHOT
     act.sa_flags |= SA_ONESHOT;
 #else
index 92b210e0491e64882e8f61b1de399f2876c7d32d..726e181cf1773bb090ee6b61a3e24cffec03bbfb 100644 (file)
@@ -1370,8 +1370,13 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
     orte_local_rank_t local_rank;
     orte_node_rank_t node_rank;
     char *pathenv = NULL, *mpiexec_pathenv = NULL;
+#if !defined(MAXPATHLEN) && defined(__GLIBC__)
+    char *basedir=NULL;
+    char *dir=NULL;
+#else
     char basedir[MAXPATHLEN];
     char dir[MAXPATHLEN];
+#endif
     char **argvptr;
     char *full_search;
     char **argvsav=NULL;
@@ -1388,7 +1393,11 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
      * bouncing around as we execute various apps, but we will always return
      * to this place as our default directory
      */
+#if !defined(MAXPATHLEN) && defined(__GLIBC__)
+    basedir = get_current_dir_name();
+#else
     getcwd(basedir, sizeof(basedir));
+#endif
 
     /* find the jobdat for this job */
     jobdat = NULL;
@@ -1621,7 +1630,11 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
          * again not match getcwd! This is beyond our control - we are only
          * ensuring they start out matching.
          */
+#if !defined(MAXPATHLEN) && defined(__GLIBC__)
+        dir = get_current_dir_name();
+#else
         getcwd(dir, sizeof(dir));
+#endif
         opal_setenv("PWD", dir, true, &app->env);
         
         /* Search for the OMPI_exec_path and PATH settings in the environment. */
@@ -2118,6 +2131,10 @@ CLEANUP:
  GETOUT:
     opal_condition_signal(&orte_odls_globals.cond);
     OPAL_THREAD_UNLOCK(&orte_odls_globals.mutex);
+#if !defined(MAXPATHLEN) && defined(__GLIBC__)
+    free(basedir);
+    free(dir);
+#endif
     return rc;
 }
 
index 07d27a1fbe1d5a9d30c4c8cd23a6199a4ce22a5b..0f2de5ca46deb2db81e1c0d5fedb04f4cf5fbf76 100644 (file)
@@ -228,7 +228,8 @@ int orte_daemon(int argc, char *argv[])
     int ret = 0;
     int fd;
     opal_cmd_line_t *cmd_line = NULL;
-    char log_file[PATH_MAX];
+    char *log_file = NULL;
+    size_t log_file_len;
     char *jobidstring;
     char *rml_uri;
     int i;
@@ -482,13 +483,16 @@ int orte_daemon(int argc, char *argv[])
         }
 
         /* define a log file name in the session directory */
-        snprintf(log_file, PATH_MAX, "output-orted-%s-%s.log",
+        log_file_len = 13 + strlen(jobidstring) + 1 + strlen(orte_process_info.nodename) + 4 + 1;
+        log_file = malloc(log_file_len);
+        snprintf(log_file, log_file_len, "output-orted-%s-%s.log",
                  jobidstring, orte_process_info.nodename);
         log_path = opal_os_path(false,
                                 orte_process_info.tmpdir_base,
                                 orte_process_info.top_session_dir,
                                 log_file,
                                 NULL);
+        free(log_file);
 
         fd = open(log_path, O_RDWR|O_CREAT|O_TRUNC, 0640);
         if (fd < 0) {
index a54818e0ff87a3d407f39ef0a25c88bdb36f2469..fcdea45a5aade39aaf16ad2b181adb36c6b82c14 100644 (file)
@@ -55,10 +55,12 @@ int orte_util_check_context_cwd(orte_app_context_t *context,
 {
     bool good = true;
     const char *tmp;
+#if 0 /* 'hostname' looks unused... */
     char hostname[MAXHOSTNAMELEN];
     
     /* Use hostname in a few messages below */
     gethostname(hostname, sizeof(hostname));
+#endif
     
     /* If we want to chdir and the chdir fails (for any reason -- such
        as if the dir doesn't exist, it isn't a dir, we don't have