[mpich2-commits] r4191 - in mpich2/trunk/src/pm/hydra: . bootstrap/fork bootstrap/slurm bootstrap/ssh include launcher/mpiexec launcher/utils pm/pmiserv utils/args utils/env utils/launch utils/string

balaji at mcs.anl.gov balaji at mcs.anl.gov
Thu Mar 26 00:41:13 CDT 2009


Author: balaji
Date: 2009-03-26 00:41:12 -0500 (Thu, 26 Mar 2009)
New Revision: 4191

Modified:
   mpich2/trunk/src/pm/hydra/README
   mpich2/trunk/src/pm/hydra/bootstrap/fork/fork_launch.c
   mpich2/trunk/src/pm/hydra/bootstrap/slurm/slurm_launch.c
   mpich2/trunk/src/pm/hydra/bootstrap/ssh/ssh_launch.c
   mpich2/trunk/src/pm/hydra/include/hydra_base.h
   mpich2/trunk/src/pm/hydra/include/hydra_utils.h
   mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c
   mpich2/trunk/src/pm/hydra/launcher/utils/lchu.c
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_handle.c
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_handle_v1.c
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_proxy.c
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_proxy_utils.c
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_serv_launch.c
   mpich2/trunk/src/pm/hydra/utils/args/args.c
   mpich2/trunk/src/pm/hydra/utils/env/env.c
   mpich2/trunk/src/pm/hydra/utils/launch/allocate.c
   mpich2/trunk/src/pm/hydra/utils/string/string.c
Log:
Minimize MPI-ism in Hydra.


Modified: mpich2/trunk/src/pm/hydra/README
===================================================================
--- mpich2/trunk/src/pm/hydra/README	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/README	2009-03-26 05:41:12 UTC (rev 4191)
@@ -1,10 +1,10 @@
 General
 -------
 
-Hydra is a process management system for starting parallel jobs,
-especially MPICH2 jobs. Hydra is designed to natively work with
-multiple daemons such as ssh, pbs, slurm and sge. However, in the
-current release, only ssh and fork are supported.
+Hydra is a process management system for starting parallel jobs. Hydra
+is designed to natively work with multiple daemons such as ssh, pbs,
+slurm and sge. However, in the current release, only ssh and fork are
+supported.
 
 More detailed documentation of the internal workings of Hydra are
 available here:
@@ -17,10 +17,10 @@
 To use hydra, mpich2 needs to be configured with the configure option
 --with-pm=hydra.
 
-Once MPICH2 has been built with Hydra, the Hydra commands are in
-mpich2/bin, or the bin subdirectory of the install directory if you
-have done an install.  You should put this (bin) directory in your
-PATH in your .cshrc or .bashrc for usage convenience:
+Once built, the Hydra executables are in mpich2/bin, or the bin
+subdirectory of the install directory if you have done an install.
+You should put this (bin) directory in your PATH in your .cshrc or
+.bashrc for usage convenience:
 
 Put in .cshrc:  setenv PATH /home/you/mpich2/bin:$PATH
 
@@ -114,8 +114,8 @@
 inter-process resource sharing (assuming the closer the processes are
 the more resources that they share). The "pack" scheme packs
 everything as closely as it can; this tries to maximize resource
-sharing hoping that the MPI library can take advantage of this packing
-for better performance.
+sharing hoping that the communication library can take advantage of
+this packing for better performance.
 
 3. User-defined allocation strategies: two schemes are
 provided---command-line and host-file based. The command-line scheme

Modified: mpich2/trunk/src/pm/hydra/bootstrap/fork/fork_launch.c
===================================================================
--- mpich2/trunk/src/pm/hydra/bootstrap/fork/fork_launch.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/bootstrap/fork/fork_launch.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -30,7 +30,7 @@
         /* Setup the executable arguments */
         arg = 0;
         for (i = 0; partition->proxy_args[i]; i++)
-            client_arg[arg++] = MPIU_Strdup(partition->proxy_args[i]);
+            client_arg[arg++] = HYDU_strdup(partition->proxy_args[i]);
         client_arg[arg++] = NULL;
 
         /* The stdin pointer will be some value for process_id 0; for

Modified: mpich2/trunk/src/pm/hydra/bootstrap/slurm/slurm_launch.c
===================================================================
--- mpich2/trunk/src/pm/hydra/bootstrap/slurm/slurm_launch.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/bootstrap/slurm/slurm_launch.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -30,14 +30,14 @@
         /* Setup the executable arguments */
         arg = 0;
         /* FIXME: Get the path to srun */
-        client_arg[arg++] = MPIU_Strdup("srun");
+        client_arg[arg++] = HYDU_strdup("srun");
 
         /* Currently, we do not support any partition names other than
          * host names */
-        client_arg[arg++] = MPIU_Strdup(partition->name);
+        client_arg[arg++] = HYDU_strdup(partition->name);
 
         for (i = 0; partition->proxy_args[i]; i++)
-            client_arg[arg++] = MPIU_Strdup(partition->proxy_args[i]);
+            client_arg[arg++] = HYDU_strdup(partition->proxy_args[i]);
 
         client_arg[arg++] = NULL;
 

Modified: mpich2/trunk/src/pm/hydra/bootstrap/ssh/ssh_launch.c
===================================================================
--- mpich2/trunk/src/pm/hydra/bootstrap/ssh/ssh_launch.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/bootstrap/ssh/ssh_launch.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -35,21 +35,21 @@
 
         /* Setup the executable arguments */
         arg = 0;
-        client_arg[arg++] = MPIU_Strdup("/usr/bin/ssh");
+        client_arg[arg++] = HYDU_strdup("/usr/bin/ssh");
 
         /* Allow X forwarding only if explicitly requested */
         if (handle.enablex == 1)
-            client_arg[arg++] = MPIU_Strdup("-X");
+            client_arg[arg++] = HYDU_strdup("-X");
         else if (handle.enablex == 0)
-            client_arg[arg++] = MPIU_Strdup("-x");
+            client_arg[arg++] = HYDU_strdup("-x");
         else    /* default mode is disable X */
-            client_arg[arg++] = MPIU_Strdup("-x");
+            client_arg[arg++] = HYDU_strdup("-x");
 
         /* ssh does not support any partition names other than host names */
-        client_arg[arg++] = MPIU_Strdup(partition->name);
+        client_arg[arg++] = HYDU_strdup(partition->name);
 
         for (i = 0; partition->proxy_args[i]; i++)
-            client_arg[arg++] = MPIU_Strdup(partition->proxy_args[i]);
+            client_arg[arg++] = HYDU_strdup(partition->proxy_args[i]);
 
         client_arg[arg++] = NULL;
 

Modified: mpich2/trunk/src/pm/hydra/include/hydra_base.h
===================================================================
--- mpich2/trunk/src/pm/hydra/include/hydra_base.h	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/include/hydra_base.h	2009-03-26 05:41:12 UTC (rev 4191)
@@ -264,12 +264,8 @@
 	HYDU_Debug("Exiting function %s\n", __func__);                 \
     }
 #else
-#define HYDU_FUNC_ENTER()                                               \
-    {                                                                   \
-    }
-#define HYDU_FUNC_EXIT()                                               \
-    {                                                                  \
-    }
+#define HYDU_FUNC_ENTER() {}
+#define HYDU_FUNC_EXIT() {}
 #endif
 
 #endif /* HYDRA_BASE_H_INCLUDED */

Modified: mpich2/trunk/src/pm/hydra/include/hydra_utils.h
===================================================================
--- mpich2/trunk/src/pm/hydra/include/hydra_utils.h	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/include/hydra_utils.h	2009-03-26 05:41:12 UTC (rev 4191)
@@ -123,13 +123,8 @@
         MPIU_Free(p);                           \
     }
 
-#define HYDU_STRDUP(src, dest, type, status)                            \
-    {                                                                   \
-        (dest) = (type) MPIU_Strdup((src));                             \
-        if ((dest) == NULL)                                             \
-            HYDU_ERR_SETANDJUMP1((status), HYD_INTERNAL_ERROR,          \
-                             "failed duping string %s\n", (src));       \
-    }
+#define HYDU_snprintf MPIU_Snprintf
+#define HYDU_strdup MPIU_Strdup
 
 HYD_Status HYDU_list_append_strlist(char **exec, char **client_arg);
 HYD_Status HYDU_print_strlist(char **args);

Modified: mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c
===================================================================
--- mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -8,7 +8,6 @@
 #include "hydra_utils.h"
 #include "mpiexec.h"
 #include "lchu.h"
-#include "mpi.h"
 
 #define HYDRA_MAX_PATH 4096
 
@@ -24,8 +23,8 @@
 
 static void show_version(void)
 {
-    printf("MPICH2 Version: %s\n", MPICH2_VERSION);
-    printf("Process Manager: HYDRA\n");
+    printf("HYDRA Build Details\n");
+    printf("Process Manager: PMI\n");
     printf("Boot-strap servers available: %s\n", HYDRA_BSS_NAMES);
 }
 
@@ -96,9 +95,9 @@
 
         if (!strcmp(*argv, "-genv")) {
             INCREMENT_ARGV(status);
-            env_name = MPIU_Strdup(*argv);
+            env_name = HYDU_strdup(*argv);
             INCREMENT_ARGV(status);
-            env_value = MPIU_Strdup(*argv);
+            env_value = HYDU_strdup(*argv);
 
             status = HYDU_env_create(&env, env_name, env_value);
             HYDU_ERR_POP(status, "unable to create env struct\n");
@@ -142,9 +141,9 @@
 
         if (!strcmp(*argv, "-env")) {
             INCREMENT_ARGV(status);
-            env_name = MPIU_Strdup(*argv);
+            env_name = HYDU_strdup(*argv);
             INCREMENT_ARGV(status);
-            env_value = MPIU_Strdup(*argv);
+            env_value = HYDU_strdup(*argv);
 
             status = HYDU_env_create(&env, env_name, env_value);
             HYDU_ERR_POP(status, "unable to create env struct\n");
@@ -158,7 +157,7 @@
 
         if (!strcmp(*argv, "-wdir")) {
             INCREMENT_ARGV(status);
-            handle.wdir = MPIU_Strdup(*argv);
+            handle.wdir = HYDU_strdup(*argv);
             continue;
         }
 
@@ -177,7 +176,7 @@
 
         if (!strcmp(*argv, "-f")) {
             INCREMENT_ARGV(status);
-            handle.host_file = MPIU_Strdup(*argv);
+            handle.host_file = HYDU_strdup(*argv);
             continue;
         }
 
@@ -193,7 +192,7 @@
             }
             HYDU_ERR_CHKANDJUMP(status, handle.bootstrap, HYD_INTERNAL_ERROR,
                                 "duplicate bootstrap server\n");
-            handle.bootstrap = MPIU_Strdup(str[1]);
+            handle.bootstrap = HYDU_strdup(str[1]);
             continue;
         }
 
@@ -220,7 +219,7 @@
                 if (!strcmp(str[2], "user")) {
                     handle.binding = HYD_BIND_USER;
                     if (str[3])
-                        handle.user_bind_map = MPIU_Strdup(str[3]);
+                        handle.user_bind_map = HYDU_strdup(str[3]);
                 }
             }
 
@@ -255,7 +254,7 @@
             i = 0;
             while (exec_info->exec[i] != NULL)
                 i++;
-            exec_info->exec[i] = MPIU_Strdup(*argv);
+            exec_info->exec[i] = HYDU_strdup(*argv);
             exec_info->exec[i + 1] = NULL;
         } while (++argv && *argv);
 
@@ -283,15 +282,15 @@
 
     tmp = getenv("HYDRA_BOOTSTRAP");
     if (handle.bootstrap == NULL && tmp)
-        handle.bootstrap = MPIU_Strdup(tmp);
+        handle.bootstrap = HYDU_strdup(tmp);
     if (handle.bootstrap == NULL)
-        handle.bootstrap = MPIU_Strdup(HYDRA_DEFAULT_BSS);
+        handle.bootstrap = HYDU_strdup(HYDRA_DEFAULT_BSS);
 
     tmp = getenv("HYDRA_HOST_FILE");
     if (handle.host_file == NULL && tmp)
-        handle.host_file = MPIU_Strdup(tmp);
+        handle.host_file = HYDU_strdup(tmp);
     if (handle.host_file == NULL)
-        handle.host_file = MPIU_Strdup("HYDRA_USE_LOCALHOST");
+        handle.host_file = HYDU_strdup("HYDRA_USE_LOCALHOST");
 
     status = HYDU_get_base_path(progname, handle.wdir, &handle.base_path);
     HYDU_ERR_POP(status, "unable to get base path\n");

Modified: mpich2/trunk/src/pm/hydra/launcher/utils/lchu.c
===================================================================
--- mpich2/trunk/src/pm/hydra/launcher/utils/lchu.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/launcher/utils/lchu.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -220,7 +220,7 @@
                 HYDU_ERR_POP(status, "unable to allocate partition exec\n");
 
                 for (i = 0; exec_info->exec[i]; i++)
-                    partition->exec_list->exec[i] = MPIU_Strdup(exec_info->exec[i]);
+                    partition->exec_list->exec[i] = HYDU_strdup(exec_info->exec[i]);
                 partition->exec_list->exec[i] = NULL;
 
                 partition->exec_list->proc_count =
@@ -240,7 +240,7 @@
 
                 exec = exec->next;
                 for (i = 0; exec_info->exec[i]; i++)
-                    exec->exec[i] = MPIU_Strdup(exec_info->exec[i]);
+                    exec->exec[i] = HYDU_strdup(exec_info->exec[i]);
                 exec->exec[i] = NULL;
 
                 exec->proc_count =

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_handle.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_handle.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_handle.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -20,7 +20,7 @@
     HYDU_FUNC_ENTER();
 
     HYDU_MALLOC(*kvs, HYD_PMCD_pmi_kvs_t *, sizeof(HYD_PMCD_pmi_kvs_t), status);
-    MPIU_Snprintf((*kvs)->kvs_name, MAXNAMELEN, "kvs_%d_%d", (int) getpid(), pgid);
+    HYDU_snprintf((*kvs)->kvs_name, MAXNAMELEN, "kvs_%d_%d", (int) getpid(), pgid);
     (*kvs)->key_pair = NULL;
 
   fn_exit:

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_handle_v1.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_handle_v1.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_handle_v1.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -101,13 +101,13 @@
     debug = handle.debug;
 
     i = 0;
-    tmp[i++] = MPIU_Strdup("cmd=initack\ncmd=set size=");
+    tmp[i++] = HYDU_strdup("cmd=initack\ncmd=set size=");
     tmp[i++] = HYDU_int_to_str(size);
-    tmp[i++] = MPIU_Strdup("\ncmd=set rank=");
+    tmp[i++] = HYDU_strdup("\ncmd=set rank=");
     tmp[i++] = HYDU_int_to_str(id);
-    tmp[i++] = MPIU_Strdup("\ncmd=set debug=");
+    tmp[i++] = HYDU_strdup("\ncmd=set debug=");
     tmp[i++] = HYDU_int_to_str(debug);
-    tmp[i++] = MPIU_Strdup("\n");
+    tmp[i++] = HYDU_strdup("\n");
     tmp[i++] = NULL;
 
     status = HYDU_str_alloc_and_join(tmp, &cmd);
@@ -147,13 +147,13 @@
     HYDU_FUNC_ENTER();
 
     i = 0;
-    tmp[i++] = MPIU_Strdup("cmd=maxes kvsname_max=");
+    tmp[i++] = HYDU_strdup("cmd=maxes kvsname_max=");
     tmp[i++] = HYDU_int_to_str(MAXKVSNAME);
-    tmp[i++] = MPIU_Strdup(" keylen_max=");
+    tmp[i++] = HYDU_strdup(" keylen_max=");
     tmp[i++] = HYDU_int_to_str(MAXKEYLEN);
-    tmp[i++] = MPIU_Strdup(" vallen_max=");
+    tmp[i++] = HYDU_strdup(" vallen_max=");
     tmp[i++] = HYDU_int_to_str(MAXVALLEN);
-    tmp[i++] = MPIU_Strdup("\n");
+    tmp[i++] = HYDU_strdup("\n");
     tmp[i++] = NULL;
 
     status = HYDU_str_alloc_and_join(tmp, &cmd);
@@ -190,9 +190,9 @@
         HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "unable to find process structure\n");
 
     i = 0;
-    tmp[i++] = MPIU_Strdup("cmd=appnum appnum=");
+    tmp[i++] = HYDU_strdup("cmd=appnum appnum=");
     tmp[i++] = HYDU_int_to_str(process->pg->id);
-    tmp[i++] = MPIU_Strdup("\n");
+    tmp[i++] = HYDU_strdup("\n");
     tmp[i++] = NULL;
 
     status = HYDU_str_alloc_and_join(tmp, &cmd);
@@ -320,8 +320,8 @@
                              kvsname, process->pg->kvs->kvs_name);
 
     HYDU_MALLOC(key_pair, HYD_PMCD_pmi_kvs_pair_t *, sizeof(HYD_PMCD_pmi_kvs_pair_t), status);
-    MPIU_Snprintf(key_pair->key, MAXKEYLEN, "%s", key);
-    MPIU_Snprintf(key_pair->val, MAXVALLEN, "%s", val);
+    HYDU_snprintf(key_pair->key, MAXKEYLEN, "%s", key);
+    HYDU_snprintf(key_pair->val, MAXVALLEN, "%s", val);
     key_pair->next = NULL;
 
     i = 0;
@@ -335,7 +335,7 @@
         while (run->next) {
             if (!strcmp(run->key, key_pair->key)) {
                 tmp[i++] = "-1 msg=duplicate_key";
-                key_pair_str = MPIU_Strdup(key_pair->key);
+                key_pair_str = HYDU_strdup(key_pair->key);
                 tmp[i++] = key_pair_str;
                 break;
             }
@@ -403,7 +403,7 @@
         while (run) {
             if (!strcmp(run->key, key)) {
                 tmp[i++] = "0 msg=success value=";
-                key_val_str = MPIU_Strdup(run->val);
+                key_val_str = HYDU_strdup(run->val);
                 tmp[i++] = key_val_str;
                 break;
             }

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_proxy.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_proxy.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_proxy.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -102,7 +102,7 @@
                                      "unable to change wdir (%s)\n", HYDU_strerror(errno));
 
             for (j = 0, arg = 0; exec->exec[j]; j++)
-                client_args[arg++] = MPIU_Strdup(exec->exec[j]);
+                client_args[arg++] = HYDU_strdup(exec->exec[j]);
             client_args[arg++] = NULL;
 
             core = HYDU_bind_get_core_id(process_id, HYD_PMCD_pmi_proxy_params.binding);

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_proxy_utils.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_proxy_utils.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_proxy_utils.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -5,6 +5,7 @@
  */
 
 #include "pmi_proxy.h"
+#include "hydra_utils.h"
 
 struct HYD_PMCD_pmi_proxy_params HYD_PMCD_pmi_proxy_params;
 
@@ -38,7 +39,7 @@
         /* Working directory */
         if (!strcmp(*argv, "--wdir")) {
             argv++;
-            HYD_PMCD_pmi_proxy_params.wdir = MPIU_Strdup(*argv);
+            HYD_PMCD_pmi_proxy_params.wdir = HYDU_strdup(*argv);
             continue;
         }
 
@@ -50,7 +51,7 @@
             if (!strcmp(*argv, "HYDRA_NO_USER_MAP"))
                 HYD_PMCD_pmi_proxy_params.user_bind_map = NULL;
             else
-                HYD_PMCD_pmi_proxy_params.user_bind_map = MPIU_Strdup(*argv);
+                HYD_PMCD_pmi_proxy_params.user_bind_map = HYDU_strdup(*argv);
             continue;
         }
 
@@ -165,7 +166,7 @@
          * everything into the args variable. */
         for (exec = HYD_PMCD_pmi_proxy_params.exec_list; exec->next; exec = exec->next);
         for (arg = 0; *argv && strcmp(*argv, "--exec");) {
-            exec->exec[arg++] = MPIU_Strdup(*argv);
+            exec->exec[arg++] = HYDU_strdup(*argv);
             ++argv;
         }
         exec->exec[arg++] = NULL;

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_serv_launch.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_serv_launch.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmi_serv_launch.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -78,7 +78,7 @@
     sport = HYDU_int_to_str(port);
 
     HYDU_MALLOC(port_str, char *, strlen(hostname) + 1 + strlen(sport) + 1, status);
-    MPIU_Snprintf(port_str, strlen(hostname) + 1 + strlen(sport) + 1,
+    HYDU_snprintf(port_str, strlen(hostname) + 1 + strlen(sport) + 1,
                   "%s:%s", hostname, sport);
     HYDU_FREE(sport);
     HYDU_Debug("Process manager listening on PMI port %s\n", port_str);
@@ -110,34 +110,34 @@
 
         arg = HYDU_strlist_lastidx(partition->proxy_args);
         i = 0;
-        path_str[i++] = MPIU_Strdup(handle.base_path);
-        path_str[i++] = MPIU_Strdup("pmi_proxy");
+        path_str[i++] = HYDU_strdup(handle.base_path);
+        path_str[i++] = HYDU_strdup("pmi_proxy");
         path_str[i] = NULL;
         status = HYDU_str_alloc_and_join(path_str, &partition->proxy_args[arg++]);
         HYDU_ERR_POP(status, "unable to join strings\n");
         HYDU_free_strlist(path_str);
 
-        partition->proxy_args[arg++] = MPIU_Strdup("--proxy-port");
+        partition->proxy_args[arg++] = HYDU_strdup("--proxy-port");
         partition->proxy_args[arg++] = HYDU_int_to_str(handle.proxy_port);
 
-        partition->proxy_args[arg++] = MPIU_Strdup("--one-pass-count");
+        partition->proxy_args[arg++] = HYDU_strdup("--one-pass-count");
         partition->proxy_args[arg++] = HYDU_int_to_str(handle.one_pass_count);
 
-        partition->proxy_args[arg++] = MPIU_Strdup("--wdir");
-        partition->proxy_args[arg++] = MPIU_Strdup(handle.wdir);
+        partition->proxy_args[arg++] = HYDU_strdup("--wdir");
+        partition->proxy_args[arg++] = HYDU_strdup(handle.wdir);
 
-        partition->proxy_args[arg++] = MPIU_Strdup("--binding");
+        partition->proxy_args[arg++] = HYDU_strdup("--binding");
         partition->proxy_args[arg++] = HYDU_int_to_str(handle.binding);
         if (handle.user_bind_map)
-            partition->proxy_args[arg++] = MPIU_Strdup(handle.user_bind_map);
+            partition->proxy_args[arg++] = HYDU_strdup(handle.user_bind_map);
         else if (partition->user_bind_map)
-            partition->proxy_args[arg++] = MPIU_Strdup(partition->user_bind_map);
+            partition->proxy_args[arg++] = HYDU_strdup(partition->user_bind_map);
         else
-            partition->proxy_args[arg++] = MPIU_Strdup("HYDRA_NO_USER_MAP");
+            partition->proxy_args[arg++] = HYDU_strdup("HYDRA_NO_USER_MAP");
 
         /* Pass the global environment separately, instead of for each
          * executable, as an optimization */
-        partition->proxy_args[arg++] = MPIU_Strdup("--global-env");
+        partition->proxy_args[arg++] = HYDU_strdup("--global-env");
         for (i = 0, env = handle.system_env; env; env = env->next, i++);
         for (env = handle.prop_env; env; env = env->next, i++);
         partition->proxy_args[arg++] = HYDU_int_to_str(i);
@@ -148,12 +148,12 @@
         /* Pass the segment information */
         for (segment = partition->segment_list; segment; segment = segment->next) {
             arg = HYDU_strlist_lastidx(partition->proxy_args);
-            partition->proxy_args[arg++] = MPIU_Strdup("--segment");
+            partition->proxy_args[arg++] = HYDU_strdup("--segment");
 
-            partition->proxy_args[arg++] = MPIU_Strdup("--segment-start-pid");
+            partition->proxy_args[arg++] = HYDU_strdup("--segment-start-pid");
             partition->proxy_args[arg++] = HYDU_int_to_str(segment->start_pid);
 
-            partition->proxy_args[arg++] = MPIU_Strdup("--segment-proc-count");
+            partition->proxy_args[arg++] = HYDU_strdup("--segment-proc-count");
             partition->proxy_args[arg++] = HYDU_int_to_str(segment->proc_count);
             partition->proxy_args[arg++] = NULL;
         }
@@ -161,14 +161,14 @@
         /* Now pass the local executable information */
         for (exec = partition->exec_list; exec; exec = exec->next) {
             arg = HYDU_strlist_lastidx(partition->proxy_args);
-            partition->proxy_args[arg++] = MPIU_Strdup("--exec");
+            partition->proxy_args[arg++] = HYDU_strdup("--exec");
 
-            partition->proxy_args[arg++] = MPIU_Strdup("--exec-proc-count");
+            partition->proxy_args[arg++] = HYDU_strdup("--exec-proc-count");
             partition->proxy_args[arg++] = HYDU_int_to_str(exec->proc_count);
             partition->proxy_args[arg++] = NULL;
 
             arg = HYDU_strlist_lastidx(partition->proxy_args);
-            partition->proxy_args[arg++] = MPIU_Strdup("--exec-local-env");
+            partition->proxy_args[arg++] = HYDU_strdup("--exec-local-env");
             for (i = 0, env = exec->prop_env; env; env = env->next, i++);
             partition->proxy_args[arg++] = HYDU_int_to_str(i);
             partition->proxy_args[arg++] = NULL;

Modified: mpich2/trunk/src/pm/hydra/utils/args/args.c
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/args/args.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/utils/args/args.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -15,10 +15,10 @@
     HYDU_FUNC_ENTER();
 
     /* Find the last '/' in the executable name */
-    post = MPIU_Strdup(execname);
+    post = HYDU_strdup(execname);
     loc = strrchr(post, '/');
     if (!loc) { /* If there is no path */
-        *path = MPIU_Strdup("");
+        *path = HYDU_strdup("");
     }
     else {      /* There is a path */
         *(++loc) = 0;
@@ -33,7 +33,7 @@
             HYDU_ERR_POP(status, "unable to join strings\n");
         }
         else {  /* absolute */
-            *path = MPIU_Strdup(post);
+            *path = HYDU_strdup(post);
         }
     }
 

Modified: mpich2/trunk/src/pm/hydra/utils/env/env.c
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/env/env.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/utils/env/env.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -15,11 +15,11 @@
     HYDU_FUNC_ENTER();
 
     i = 0;
-    tmp[i++] = MPIU_Strdup("'");
-    tmp[i++] = MPIU_Strdup(env->env_name);
-    tmp[i++] = MPIU_Strdup("=");
-    tmp[i++] = env->env_value ? MPIU_Strdup(env->env_value) : MPIU_Strdup("");
-    tmp[i++] = MPIU_Strdup("'");
+    tmp[i++] = HYDU_strdup("'");
+    tmp[i++] = HYDU_strdup(env->env_name);
+    tmp[i++] = HYDU_strdup("=");
+    tmp[i++] = env->env_value ? HYDU_strdup(env->env_value) : HYDU_strdup("");
+    tmp[i++] = HYDU_strdup("'");
     tmp[i++] = NULL;
 
     status = HYDU_str_alloc_and_join(tmp, str);
@@ -47,8 +47,8 @@
     HYDU_MALLOC(tenv, HYD_Env_t *, sizeof(HYD_Env_t), status);
     memcpy(tenv, &env, sizeof(HYD_Env_t));
     tenv->next = NULL;
-    tenv->env_name = MPIU_Strdup(env.env_name);
-    tenv->env_value = env.env_value ? MPIU_Strdup(env.env_value) : NULL;
+    tenv->env_name = HYDU_strdup(env.env_name);
+    tenv->env_value = env.env_value ? HYDU_strdup(env.env_value) : NULL;
 
   fn_exit:
     HYDU_FUNC_EXIT();
@@ -73,8 +73,8 @@
     HYDU_MALLOC(env, HYD_Env_t *, sizeof(HYD_Env_t), status);
     env_name = strtok(str, "=");
     env_value = strtok(NULL, "=");
-    env->env_name = MPIU_Strdup(env_name);
-    env->env_value = env_value ? MPIU_Strdup(env_value) : NULL;
+    env->env_name = HYDU_strdup(env_name);
+    env->env_value = env_value ? HYDU_strdup(env_value) : NULL;
 
   fn_exit:
     HYDU_FUNC_EXIT();
@@ -126,7 +126,7 @@
     *env_list = NULL;
     i = 0;
     while (environ[i]) {
-        env_str = MPIU_Strdup(environ[i]);
+        env_str = HYDU_strdup(environ[i]);
 
         env = HYDU_str_to_env(env_str);
 
@@ -180,8 +180,8 @@
     HYDU_FUNC_ENTER();
 
     HYDU_MALLOC(*env, HYD_Env_t *, sizeof(HYD_Env_t), status);
-    (*env)->env_name = MPIU_Strdup(env_name);
-    (*env)->env_value = env_value ? MPIU_Strdup(env_value) : NULL;
+    (*env)->env_name = HYDU_strdup(env_name);
+    (*env)->env_value = env_value ? HYDU_strdup(env_value) : NULL;
     (*env)->next = NULL;
 
   fn_exit:
@@ -274,14 +274,14 @@
                 /* If we found an entry for this environment variable, just update it */
                 if (run->env_value != NULL && tenv->env_value != NULL) {
                     HYDU_FREE(run->env_value);
-                    run->env_value = MPIU_Strdup(tenv->env_value);
+                    run->env_value = HYDU_strdup(tenv->env_value);
                 }
                 else if (run->env_value != NULL) {
                     HYDU_FREE(run->env_value);
                     run->env_value = NULL;
                 }
                 else if (env.env_value != NULL) {
-                    run->env_value = MPIU_Strdup(tenv->env_value);
+                    run->env_value = HYDU_strdup(tenv->env_value);
                 }
 
                 HYDU_FREE(tenv->env_name);
@@ -317,14 +317,14 @@
     HYDU_FUNC_ENTER();
 
     i = 0;
-    tmp[i++] = MPIU_Strdup(env->env_name);
-    tmp[i++] = MPIU_Strdup("=");
-    tmp[i++] = env->env_value ? MPIU_Strdup(env->env_value) : MPIU_Strdup("");
+    tmp[i++] = HYDU_strdup(env->env_name);
+    tmp[i++] = HYDU_strdup("=");
+    tmp[i++] = env->env_value ? HYDU_strdup(env->env_value) : HYDU_strdup("");
     tmp[i++] = NULL;
     status = HYDU_str_alloc_and_join(tmp, &str);
     HYDU_ERR_POP(status, "unable to join strings\n");
 
-    MPIU_PutEnv(str);
+    putenv(str);
 
     for (i = 0; tmp[i]; i++)
         HYDU_FREE(tmp[i]);

Modified: mpich2/trunk/src/pm/hydra/utils/launch/allocate.c
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/launch/allocate.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/utils/launch/allocate.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -165,7 +165,7 @@
     if (*partition_list == NULL) {
         HYDU_alloc_partition(partition_list);
         (*partition_list)->segment_list = segment;
-        (*partition_list)->name = MPIU_Strdup(name);
+        (*partition_list)->name = HYDU_strdup(name);
         (*partition_list)->total_proc_count += segment->proc_count;
     }
     else {
@@ -186,7 +186,7 @@
             else if (partition->next == NULL) {
                 HYDU_alloc_partition(&partition->next);
                 partition->next->segment_list = segment;
-                partition->next->name = MPIU_Strdup(name);
+                partition->next->name = HYDU_strdup(name);
                 partition->next->total_proc_count += segment->proc_count;
                 break;
             }
@@ -227,9 +227,9 @@
     HYDU_FUNC_ENTER();
 
     i = 0;
-    tmp[i++] = MPIU_Strdup(str);
+    tmp[i++] = HYDU_strdup(str);
     for (j = 0; j < count; j++)
-        tmp[i++] = MPIU_Strdup(pad);
+        tmp[i++] = HYDU_strdup(pad);
     tmp[i] = NULL;
 
     status = HYDU_str_alloc_and_join(tmp, &out);
@@ -258,9 +258,9 @@
 
     if (*partition_list == NULL) {
         HYDU_alloc_partition(partition_list);
-        (*partition_list)->name = MPIU_Strdup(name);
+        (*partition_list)->name = HYDU_strdup(name);
 
-        x = MPIU_Strdup(map);
+        x = HYDU_strdup(map);
         count = num_procs - count_elements(x, ",");
         HYDU_FREE(x);
 
@@ -272,20 +272,20 @@
             if (strcmp(partition->name, name) == 0) {
                 /* Found a partition with the same name; append */
                 if (partition->user_bind_map == NULL) {
-                    x = MPIU_Strdup(map);
+                    x = HYDU_strdup(map);
                     count = num_procs - count_elements(x, ",");
                     HYDU_FREE(x);
 
                     partition->user_bind_map = pad_string(map, ",-1", count);
                 }
                 else {
-                    x = MPIU_Strdup(map);
+                    x = HYDU_strdup(map);
                     count = num_procs - count_elements(x, ",");
                     HYDU_FREE(x);
 
                     i = 0;
-                    tmp[i++] = MPIU_Strdup(partition->user_bind_map);
-                    tmp[i++] = MPIU_Strdup(",");
+                    tmp[i++] = HYDU_strdup(partition->user_bind_map);
+                    tmp[i++] = HYDU_strdup(",");
                     tmp[i++] = pad_string(map, ",-1", count);
                     tmp[i++] = NULL;
 
@@ -299,8 +299,8 @@
             }
             else if (partition->next == NULL) {
                 HYDU_alloc_partition(&partition->next);
-                partition->next->name = MPIU_Strdup(name);
-                partition->next->user_bind_map = MPIU_Strdup(map);
+                partition->next->name = HYDU_strdup(name);
+                partition->next->user_bind_map = HYDU_strdup(map);
                 break;
             }
             else {
@@ -353,7 +353,7 @@
 
     if (!strcmp(host_file, "HYDRA_USE_LOCALHOST")) {
         HYDU_alloc_partition(&(*partition_list));
-        (*partition_list)->name = MPIU_Strdup("localhost");
+        (*partition_list)->name = HYDU_strdup("localhost");
         (*partition_list)->total_proc_count = 1;
 
         HYDU_alloc_partition_segment(&((*partition_list)->segment_list));

Modified: mpich2/trunk/src/pm/hydra/utils/string/string.c
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/string/string.c	2009-03-26 02:36:11 UTC (rev 4190)
+++ mpich2/trunk/src/pm/hydra/utils/string/string.c	2009-03-26 05:41:12 UTC (rev 4191)
@@ -15,7 +15,7 @@
 
     i = HYDU_strlist_lastidx(dest_strlist);
     for (j = 0; src_strlist[j]; j++)
-        dest_strlist[i++] = MPIU_Strdup(src_strlist[j]);
+        dest_strlist[i++] = HYDU_strdup(src_strlist[j]);
     dest_strlist[i++] = NULL;
 
     HYDU_FUNC_EXIT();
@@ -68,7 +68,7 @@
     (*strjoin)[0] = 0;
 
     for (i = 0; strlist[i] != NULL; i++) {
-        MPIU_Snprintf(*strjoin + count, len - count + 1, "%s", strlist[i]);
+        HYDU_snprintf(*strjoin + count, len - count + 1, "%s", strlist[i]);
         count += strlen(strlist[i]);
     }
 
@@ -91,13 +91,13 @@
     if (str == NULL)
         HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "");
 
-    *str1 = MPIU_Strdup(str);
+    *str1 = HYDU_strdup(str);
     for (i = 0; (*str1)[i] && ((*str1)[i] != sep); i++);
 
     if ((*str1)[i] == 0)        /* End of the string */
         *str2 = NULL;
     else {
-        *str2 = MPIU_Strdup(&((*str1)[i + 1]));
+        *str2 = HYDU_strdup(&((*str1)[i + 1]));
         (*str1)[i] = 0;
     }
 
@@ -130,13 +130,10 @@
         max *= 10;
     }
 
-    str = (char *) MPIU_Malloc(len + 1);
-    if (str == NULL) {
-        HYDU_ERR_SETANDJUMP1(status, HYD_NO_MEM, "unable to allocate %d bytes\n", len + 1);
-        goto fn_fail;
-    }
+    HYDU_MALLOC(str, char *, len + 1, status);
+    HYDU_ERR_POP(status, "unable to allocate memory\n");
 
-    MPIU_Snprintf(str, len + 1, "%d", x);
+    HYDU_snprintf(str, len + 1, "%d", x);
 
   fn_exit:
     HYDU_FUNC_EXIT();
@@ -154,7 +151,7 @@
 #if defined HAVE_STRERROR
     str = strerror(error);
 #else
-    str = MPIU_Strdup("errno: %d", error);
+    str = HYDU_strdup("errno: %d", error);
 #endif /* HAVE_STRERROR */
 
     return str;
@@ -190,7 +187,7 @@
             HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "too many arguments in line\n");
 
         /* Make a copy and NULL terminate it */
-        strlist[argc] = MPIU_Strdup(p);
+        strlist[argc] = HYDU_strdup(p);
         r = strlist[argc];
         while (*r && !isspace(*r))
             r++;



More information about the mpich2-commits mailing list