[mpich2-commits] r4192 - in mpich2/trunk/src/pm/hydra: . bootstrap/utils include utils utils/dbg
balaji at mcs.anl.gov
balaji at mcs.anl.gov
Thu Mar 26 01:07:41 CDT 2009
Author: balaji
Date: 2009-03-26 01:07:41 -0500 (Thu, 26 Mar 2009)
New Revision: 4192
Added:
mpich2/trunk/src/pm/hydra/utils/dbg/
mpich2/trunk/src/pm/hydra/utils/dbg/Makefile.sm
mpich2/trunk/src/pm/hydra/utils/dbg/dbg.c
Modified:
mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_finalize.c
mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_usize.c
mpich2/trunk/src/pm/hydra/configure.in
mpich2/trunk/src/pm/hydra/include/hydra_base.h
mpich2/trunk/src/pm/hydra/include/hydra_utils.h
mpich2/trunk/src/pm/hydra/utils/Makefile.sm
Log:
Some more reduction in the dependency on MPICH2.
Modified: mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_finalize.c
===================================================================
--- mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_finalize.c 2009-03-26 05:41:12 UTC (rev 4191)
+++ mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_finalize.c 2009-03-26 06:07:41 UTC (rev 4192)
@@ -5,6 +5,7 @@
*/
#include "hydra_base.h"
+#include "hydra_utils.h"
#include "bscu.h"
HYD_Status HYD_BSCU_finalize(void)
Modified: mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_usize.c
===================================================================
--- mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_usize.c 2009-03-26 05:41:12 UTC (rev 4191)
+++ mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_usize.c 2009-03-26 06:07:41 UTC (rev 4192)
@@ -5,6 +5,7 @@
*/
#include "hydra_base.h"
+#include "hydra_utils.h"
#include "bscu.h"
HYD_Status HYD_BSCU_get_usize(int *size)
Modified: mpich2/trunk/src/pm/hydra/configure.in
===================================================================
--- mpich2/trunk/src/pm/hydra/configure.in 2009-03-26 05:41:12 UTC (rev 4191)
+++ mpich2/trunk/src/pm/hydra/configure.in 2009-03-26 06:07:41 UTC (rev 4192)
@@ -300,6 +300,7 @@
AC_OUTPUT(Makefile \
utils/Makefile \
utils/args/Makefile \
+ utils/dbg/Makefile \
utils/env/Makefile \
utils/launch/Makefile \
utils/signals/Makefile \
Modified: mpich2/trunk/src/pm/hydra/include/hydra_base.h
===================================================================
--- mpich2/trunk/src/pm/hydra/include/hydra_base.h 2009-03-26 05:41:12 UTC (rev 4191)
+++ mpich2/trunk/src/pm/hydra/include/hydra_base.h 2009-03-26 06:07:41 UTC (rev 4192)
@@ -8,7 +8,6 @@
#define HYDRA_BASE_H_INCLUDED
#include <stdio.h>
-#include "mpibase.h"
#include "hydra_config.h"
#if defined HAVE_UNISTD_H
@@ -39,13 +38,11 @@
#if defined HAVE_GETTIMEOFDAY
/* FIXME: Is time.h available everywhere? We should probably have
- * multiple timer options like MPICH2. */
+ * multiple timer options. */
#include <time.h>
#include <sys/time.h>
#endif /* HAVE_GETTIMEOFDAY */
-#include "mpimem.h"
-
#if defined MAXHOSTNAMELEN
#define MAX_HOSTNAME_LEN MAXHOSTNAMELEN
#else
@@ -155,117 +152,4 @@
struct HYD_Exec_info *next;
} *exec_info;
-
-#define HYDU_ERR_POP(status, message) \
- { \
- if (status != HYD_SUCCESS && status != HYD_GRACEFUL_ABORT) { \
- if (strcmp(message, "")) \
- HYDU_Error_printf(message); \
- goto fn_fail; \
- } \
- else if (status == HYD_GRACEFUL_ABORT) { \
- goto fn_exit; \
- } \
- }
-
-#define HYDU_ERR_SETANDJUMP(status, error, message) \
- { \
- status = error; \
- if (status != HYD_SUCCESS && status != HYD_GRACEFUL_ABORT) { \
- if (strcmp(message, "")) \
- HYDU_Error_printf(message); \
- goto fn_fail; \
- } \
- else if (status == HYD_GRACEFUL_ABORT) { \
- goto fn_exit; \
- } \
- }
-
-#define HYDU_ERR_CHKANDJUMP(status, chk, error, message) \
- { \
- if ((chk)) \
- HYDU_ERR_SETANDJUMP(status, error, message); \
- }
-
-#define HYDU_ERR_SETANDJUMP1(status, error, message, arg1) \
- { \
- status = error; \
- if (status != HYD_SUCCESS && status != HYD_GRACEFUL_ABORT) { \
- if (strcmp(message, "")) \
- HYDU_Error_printf(message, arg1); \
- goto fn_fail; \
- } \
- else if (status == HYD_GRACEFUL_ABORT) { \
- goto fn_exit; \
- } \
- }
-
-#define HYDU_ERR_SETANDJUMP2(status, error, message, arg1, arg2) \
- { \
- status = error; \
- if (status != HYD_SUCCESS && status != HYD_GRACEFUL_ABORT) { \
- if (strcmp(message, "")) \
- HYDU_Error_printf(message, arg1, arg2); \
- goto fn_fail; \
- } \
- else if (status == HYD_GRACEFUL_ABORT) { \
- goto fn_exit; \
- } \
- }
-
-
-#if defined ENABLE_WARNINGS
-#define HYDU_Warn_printf HYDU_Error_printf
-#else
-#define HYDU_Warn_printf(...) {}
-#endif /* ENABLE_WARNINGS */
-
-#if !defined COMPILER_ACCEPTS_VA_ARGS
-#define HYDU_Error_printf MPIU_Error_printf
-#elif defined COMPILER_ACCEPTS_FUNC && defined __LINE__
-#define HYDU_Error_printf(...) \
- { \
- fprintf(stderr, "%s (%d): ", __func__, __LINE__); \
- MPIU_Error_printf(__VA_ARGS__); \
- }
-#elif defined __FILE__ && defined __LINE__
-#define HYDU_Error_printf(...) \
- { \
- fprintf(stderr, "%s (%d): ", __FILE__, __LINE__); \
- MPIU_Error_printf(__VA_ARGS__); \
- }
-#else
-#define HYDU_Error_printf(...) \
- { \
- MPIU_Error_printf(__VA_ARGS__); \
- }
-#endif
-
-#if !defined COMPILER_ACCEPTS_VA_ARGS
-#define HYDU_Debug if (handle.debug) printf
-#else
-#define HYDU_Debug(...) \
- { \
- if (handle.debug) \
- printf(__VA_ARGS__); \
- }
-#endif /* COMPILER_ACCEPTS_VA_ARGS */
-
-#if !defined ENABLE_DEBUG
-#define HYDU_FUNC_ENTER()
-#define HYDU_FUNC_EXIT()
-#elif defined COMPILER_ACCEPTS_FUNC
-#define HYDU_FUNC_ENTER() \
- { \
- HYDU_Debug("Entering function %s\n", __func__); \
- }
-#define HYDU_FUNC_EXIT() \
- { \
- HYDU_Debug("Exiting function %s\n", __func__); \
- }
-#else
-#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 05:41:12 UTC (rev 4191)
+++ mpich2/trunk/src/pm/hydra/include/hydra_utils.h 2009-03-26 06:07:41 UTC (rev 4192)
@@ -8,7 +8,122 @@
#define HYDRA_UTILS_H_INCLUDED
#include "hydra_base.h"
+#include "mpimem.h"
+int HYDU_Error_printf_simple(const char *str, ...);
+
+#if !defined COMPILER_ACCEPTS_VA_ARGS
+#define HYDU_Error_printf HYDU_Error_printf_simple
+#elif defined COMPILER_ACCEPTS_FUNC && defined __LINE__
+#define HYDU_Error_printf(...) \
+ { \
+ fprintf(stderr, "%s (%d): ", __func__, __LINE__); \
+ HYDU_Error_printf_simple(__VA_ARGS__); \
+ }
+#elif defined __FILE__ && defined __LINE__
+#define HYDU_Error_printf(...) \
+ { \
+ fprintf(stderr, "%s (%d): ", __FILE__, __LINE__); \
+ HYDU_Error_printf_simple(__VA_ARGS__); \
+ }
+#else
+#define HYDU_Error_printf(...) \
+ { \
+ HYDU_Error_printf_simple(__VA_ARGS__); \
+ }
+#endif
+
+#if !defined COMPILER_ACCEPTS_VA_ARGS
+#define HYDU_Debug if (handle.debug) printf
+#else
+#define HYDU_Debug(...) \
+ { \
+ if (handle.debug) \
+ printf(__VA_ARGS__); \
+ }
+#endif /* COMPILER_ACCEPTS_VA_ARGS */
+
+#define HYDU_ERR_POP(status, message) \
+ { \
+ if (status != HYD_SUCCESS && status != HYD_GRACEFUL_ABORT) { \
+ if (strcmp(message, "")) \
+ HYDU_Error_printf(message); \
+ goto fn_fail; \
+ } \
+ else if (status == HYD_GRACEFUL_ABORT) { \
+ goto fn_exit; \
+ } \
+ }
+
+#define HYDU_ERR_SETANDJUMP(status, error, message) \
+ { \
+ status = error; \
+ if (status != HYD_SUCCESS && status != HYD_GRACEFUL_ABORT) { \
+ if (strcmp(message, "")) \
+ HYDU_Error_printf(message); \
+ goto fn_fail; \
+ } \
+ else if (status == HYD_GRACEFUL_ABORT) { \
+ goto fn_exit; \
+ } \
+ }
+
+#define HYDU_ERR_CHKANDJUMP(status, chk, error, message) \
+ { \
+ if ((chk)) \
+ HYDU_ERR_SETANDJUMP(status, error, message); \
+ }
+
+#define HYDU_ERR_SETANDJUMP1(status, error, message, arg1) \
+ { \
+ status = error; \
+ if (status != HYD_SUCCESS && status != HYD_GRACEFUL_ABORT) { \
+ if (strcmp(message, "")) \
+ HYDU_Error_printf(message, arg1); \
+ goto fn_fail; \
+ } \
+ else if (status == HYD_GRACEFUL_ABORT) { \
+ goto fn_exit; \
+ } \
+ }
+
+#define HYDU_ERR_SETANDJUMP2(status, error, message, arg1, arg2) \
+ { \
+ status = error; \
+ if (status != HYD_SUCCESS && status != HYD_GRACEFUL_ABORT) { \
+ if (strcmp(message, "")) \
+ HYDU_Error_printf(message, arg1, arg2); \
+ goto fn_fail; \
+ } \
+ else if (status == HYD_GRACEFUL_ABORT) { \
+ goto fn_exit; \
+ } \
+ }
+
+#if defined ENABLE_WARNINGS
+#define HYDU_Warn_printf HYDU_Error_printf
+#else
+#define HYDU_Warn_printf(...) {}
+#endif /* ENABLE_WARNINGS */
+
+#if !defined ENABLE_DEBUG
+#define HYDU_FUNC_ENTER()
+#define HYDU_FUNC_EXIT()
+#elif defined COMPILER_ACCEPTS_FUNC
+#define HYDU_FUNC_ENTER() \
+ { \
+ HYDU_Debug("Entering function %s\n", __func__); \
+ }
+#define HYDU_FUNC_EXIT() \
+ { \
+ HYDU_Debug("Exiting function %s\n", __func__); \
+ }
+#else
+#define HYDU_FUNC_ENTER() {}
+#define HYDU_FUNC_EXIT() {}
+#endif
+
+
/* args */
HYD_Status HYDU_get_base_path(char *execname, char *wdir, char **path);
Modified: mpich2/trunk/src/pm/hydra/utils/Makefile.sm
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/Makefile.sm 2009-03-26 05:41:12 UTC (rev 4191)
+++ mpich2/trunk/src/pm/hydra/utils/Makefile.sm 2009-03-26 06:07:41 UTC (rev 4192)
@@ -5,4 +5,4 @@
#
SUBDIRS_opt_utils = plpa bind .
-SUBDIRS = args env launch signals sock string timer @opt_utils@
+SUBDIRS = args dbg env launch signals sock string timer @opt_utils@
Property changes on: mpich2/trunk/src/pm/hydra/utils/dbg
___________________________________________________________________
Name: svn:ignore
+ Makefile.in
Makefile
Added: mpich2/trunk/src/pm/hydra/utils/dbg/Makefile.sm
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/dbg/Makefile.sm (rev 0)
+++ mpich2/trunk/src/pm/hydra/utils/dbg/Makefile.sm 2009-03-26 06:07:41 UTC (rev 4192)
@@ -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 = dbg.c
+INCLUDES = -I${abs_srcdir}/../../include \
+ -I${abs_srcdir}/../../../../include \
+ -I../../include \
+ -I../../../../include
Added: mpich2/trunk/src/pm/hydra/utils/dbg/dbg.c
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/dbg/dbg.c (rev 0)
+++ mpich2/trunk/src/pm/hydra/utils/dbg/dbg.c 2009-03-26 06:07:41 UTC (rev 4192)
@@ -0,0 +1,20 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2008 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "hydra_utils.h"
+
+int HYDU_Error_printf_simple(const char *str, ...)
+{
+ int n;
+ va_list list;
+
+ va_start(list, str);
+ n = vfprintf(stderr, str, list);
+ fflush(stderr);
+ va_end(list);
+
+ return n;
+}
More information about the mpich2-commits
mailing list