[mpich2-commits] r4129 - in mpich2/trunk/src/pm/hydra: . include utils utils/bind utils/launch

balaji at mcs.anl.gov balaji at mcs.anl.gov
Thu Mar 19 01:29:11 CDT 2009


Author: balaji
Date: 2009-03-19 01:29:11 -0500 (Thu, 19 Mar 2009)
New Revision: 4129

Added:
   mpich2/trunk/src/pm/hydra/utils/bind/
   mpich2/trunk/src/pm/hydra/utils/bind/Makefile.sm
   mpich2/trunk/src/pm/hydra/utils/bind/bind.c
Removed:
   mpich2/trunk/src/pm/hydra/utils/launch/bind.c
Modified:
   mpich2/trunk/src/pm/hydra/configure.in
   mpich2/trunk/src/pm/hydra/include/hydra_utils.h
   mpich2/trunk/src/pm/hydra/utils/Makefile.sm
   mpich2/trunk/src/pm/hydra/utils/launch/Makefile.sm
Log:
Used some more detailed features of PLPA to check how many processing
elements are there on the system and wrap around once we reach the
maximum core. This requires us to make sure that we can read the
system topology information (also through PLPA); so for cases where we
cannot read this information, even if there is no over-provisioning,
we do not perform any binding. Though we are being more conservative
on the systems that we can function correctly, this should be more
robust.


Modified: mpich2/trunk/src/pm/hydra/configure.in
===================================================================
--- mpich2/trunk/src/pm/hydra/configure.in	2009-03-19 05:26:27 UTC (rev 4128)
+++ mpich2/trunk/src/pm/hydra/configure.in	2009-03-19 06:29:11 UTC (rev 4129)
@@ -156,8 +156,8 @@
 AC_MSG_RESULT($PROC_BINDING)
 if test "$PROC_BINDING" = "yes"; then
    AC_DEFINE(PROC_BINDING,1,[Define if process binding is enabled])
-   plpa_makefile="utils/plpa/Makefile"
-   opt_utils="${opt_utils} plpa"
+   opt_utils_makefiles="${opt_utils_makefiles} utils/plpa/Makefile utils/bind/Makefile"
+   opt_utils="${opt_utils} plpa bind"
 fi
 AC_SUBST(opt_utils)
 
@@ -307,7 +307,7 @@
 	utils/sock/Makefile \
 	utils/string/Makefile \
 	utils/timer/Makefile \
-	${plpa_makefile} \
+	${opt_utils_makefiles} \
 	launcher/Makefile \
 	launcher/utils/Makefile \
 	launcher/${hydra_launcher}/Makefile \

Modified: mpich2/trunk/src/pm/hydra/include/hydra_utils.h
===================================================================
--- mpich2/trunk/src/pm/hydra/include/hydra_utils.h	2009-03-19 05:26:27 UTC (rev 4128)
+++ mpich2/trunk/src/pm/hydra/include/hydra_utils.h	2009-03-19 06:29:11 UTC (rev 4129)
@@ -72,13 +72,22 @@
 HYD_Status HYDU_Get_base_path(char *execname, char **path);
 HYD_Status HYDU_Chdir(const char *dir);
 
+
+/* Process binding */
 #if defined PROC_BINDING
+
 #include "plpa.h"
 #include "plpa_internal.h"
-#endif /* PROC_BINDING */
+
 HYD_Status HYDU_bind_process(int core);
 
+#else
 
+#define HYDU_bind_process(...) HYD_SUCCESS
+
+#endif /* PROC_BINDING */
+
+
 /* Memory utilities */
 #define HYDU_NUM_JOIN_STR 100
 

Modified: mpich2/trunk/src/pm/hydra/utils/Makefile.sm
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/Makefile.sm	2009-03-19 05:26:27 UTC (rev 4128)
+++ mpich2/trunk/src/pm/hydra/utils/Makefile.sm	2009-03-19 06:29:11 UTC (rev 4129)
@@ -4,5 +4,5 @@
 #     See COPYRIGHT in top-level directory.
 #
 
-SUBDIRS_opt_utils = plpa .
+SUBDIRS_opt_utils = plpa bind .
 SUBDIRS = args dbg env launch signals sock string timer @opt_utils@


Property changes on: mpich2/trunk/src/pm/hydra/utils/bind
___________________________________________________________________
Name: svn:ignore
   + Makefile
Makefile.in


Added: mpich2/trunk/src/pm/hydra/utils/bind/Makefile.sm
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/bind/Makefile.sm	                        (rev 0)
+++ mpich2/trunk/src/pm/hydra/utils/bind/Makefile.sm	2009-03-19 06:29:11 UTC (rev 4129)
@@ -0,0 +1,14 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+HYDRA_LIB_PATH = ../../lib
+
+libhydra_a_DIR = ${HYDRA_LIB_PATH}
+libhydra_a_SOURCES = bind.c
+INCLUDES = -I${abs_srcdir}/../../include \
+	-I${abs_srcdir}/../../../../include \
+	-I../../include \
+	-I../../../../include

Copied: mpich2/trunk/src/pm/hydra/utils/bind/bind.c (from rev 4128, mpich2/trunk/src/pm/hydra/utils/launch/bind.c)
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/bind/bind.c	                        (rev 0)
+++ mpich2/trunk/src/pm/hydra/utils/bind/bind.c	2009-03-19 06:29:11 UTC (rev 4129)
@@ -0,0 +1,51 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ *  (C) 2008 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "hydra_utils.h"
+
+HYD_Status HYDU_bind_process(int core)
+{
+    plpa_api_type_t p;
+    plpa_cpu_set_t cpuset;
+    int ret, supported;
+    int num_procs, max_proc_id;
+    HYD_Status status = HYD_SUCCESS;
+
+    HYDU_FUNC_ENTER();
+
+    if (!((plpa_api_probe(&p) == 0) && (p == PLPA_PROBE_OK))) {
+        /* If this failed, we just return without binding */
+        goto fn_exit;
+    }
+
+    /* We need topology information too */
+    ret = plpa_have_topology_information(&supported);
+    if ((ret == 0) && (supported == 1)) {
+        /* Find the maximum number of processing elements */
+        ret = plpa_get_processor_data(PLPA_COUNT_ALL, &num_procs, &max_proc_id);
+        if (ret) {
+            HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
+                                "plpa get processor data failed\n");
+        }
+    }
+    else {
+        /* If this failed, we just return without binding */
+        goto fn_exit;
+    }
+
+    PLPA_CPU_ZERO(&cpuset);
+    PLPA_CPU_SET(core % num_procs, &cpuset);
+    ret = plpa_sched_setaffinity(0, 1, &cpuset);
+    if (ret)
+        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "plpa setaffinity failed\n");
+
+  fn_exit:
+    HYDU_FUNC_EXIT();
+    return status;
+
+  fn_fail:
+    goto fn_exit;
+}


Property changes on: mpich2/trunk/src/pm/hydra/utils/bind/bind.c
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: mpich2/trunk/src/pm/hydra/utils/launch/Makefile.sm
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/launch/Makefile.sm	2009-03-19 05:26:27 UTC (rev 4128)
+++ mpich2/trunk/src/pm/hydra/utils/launch/Makefile.sm	2009-03-19 06:29:11 UTC (rev 4129)
@@ -7,7 +7,7 @@
 HYDRA_LIB_PATH = ../../lib
 
 libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = allocate.c launch.c bind.c
+libhydra_a_SOURCES = allocate.c launch.c
 INCLUDES = -I${abs_srcdir}/../../include \
 	-I${abs_srcdir}/../../../../include \
 	-I../../include \

Deleted: mpich2/trunk/src/pm/hydra/utils/launch/bind.c
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/launch/bind.c	2009-03-19 05:26:27 UTC (rev 4128)
+++ mpich2/trunk/src/pm/hydra/utils/launch/bind.c	2009-03-19 06:29:11 UTC (rev 4129)
@@ -1,39 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- *  (C) 2008 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include "hydra_utils.h"
-
-HYD_Status HYDU_bind_process(int core)
-#if defined PROC_BINDING
-{
-    plpa_api_type_t p;
-    plpa_cpu_set_t cpuset;
-    int ret;
-    HYD_Status status = HYD_SUCCESS;
-
-    HYDU_FUNC_ENTER();
-
-    if (!((plpa_api_probe(&p) == 0) && (p == PLPA_PROBE_OK)))
-        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "plpa probe failed\n");
-
-    PLPA_CPU_ZERO(&cpuset);
-    PLPA_CPU_SET(core, &cpuset);
-    ret = plpa_sched_setaffinity(0, 1, &cpuset);
-    if (ret)
-        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "plpa setaffinity failed\n");
-
-  fn_exit:
-    HYDU_FUNC_EXIT();
-    return status;
-
-  fn_fail:
-    goto fn_exit;
-}
-#else
-{
-    return HYD_SUCCESS;
-}
-#endif /* PROC_BINDING */



More information about the mpich2-commits mailing list