[mpich2-commits] r6687 - in mpich2/trunk/src: include mpid/ch3/channels/nemesis/nemesis/include util/wrappers
goodell at mcs.anl.gov
goodell at mcs.anl.gov
Thu May 20 13:44:31 CDT 2010
Author: goodell
Date: 2010-05-20 13:44:31 -0500 (Thu, 20 May 2010)
New Revision: 6687
Added:
mpich2/trunk/src/include/mpinestimpl.h
mpich2/trunk/src/util/wrappers/mpiu_os_wrappers_pre.h
Modified:
mpich2/trunk/src/include/mpiimpl.h
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_defs.h
mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h
Log:
fix nemesis + OS wrappers include issues
Previously the OS wrappers were included through a deep series of
headers originating at "mpidpre.h"-time. Since the OS wrappers
basically repeated all of the work of mpiimpl.h, this caused several
problems. Now the OS wrappers have "pre" header too, avoiding the
issue.
Reviewed by buntinas at .
Modified: mpich2/trunk/src/include/mpiimpl.h
===================================================================
--- mpich2/trunk/src/include/mpiimpl.h 2010-05-20 18:44:30 UTC (rev 6686)
+++ mpich2/trunk/src/include/mpiimpl.h 2010-05-20 18:44:31 UTC (rev 6687)
@@ -1991,81 +1991,8 @@
#define MPIR_FINALIZE_CALLBACK_DEFAULT_PRIO 0
#define MPIR_FINALIZE_CALLBACK_MAX_PRIO 10
-/* For no error checking, we could define MPIR_Nest_incr/decr as empty */
+#include "mpinestimpl.h"
-/* These routines export the nesting controls for use in ROMIO */
-void MPIR_Nest_incr_export(void);
-void MPIR_Nest_decr_export(void);
-
-#ifdef MPICH_DEBUG_NESTING
-/* this nesting is different than the MPIU_THREAD_*DEPTH macros, this is
- * MPI/NMPI nesting, the other one is critical section nesting */
-
-/* These two routines export the versions of the nest macros that
- provide the file/line where the nest value changes, also for use in ROMIO */
-void MPIR_Nest_incr_export_dbg(const char *, int);
-void MPIR_Nest_decr_export_dbg(const char *, int);
-
-/* FIXME: We should move the initialization and error reporting into
- routines that can be called when necessary */
-#define MPIR_Nest_init() \
- do { \
- int i_; \
- MPICH_Nestinfo_t *nestinfo_ = NULL; \
- MPIU_THREADPRIV_GET; \
- nestinfo_ = MPIU_THREADPRIV_FIELD(nestinfo); \
- for (i_ = 0; i_ <MPICH_MAX_NESTINFO; i_++) { \
- nestinfo_[i_].file[0] = 0; \
- nestinfo_[i_].line = 0; \
- } \
- } while (0)
-#define MPIR_Nest_incr() \
- do { \
- MPICH_Nestinfo_t *nestinfo_ = NULL; \
- MPIU_THREADPRIV_GET; \
- nestinfo_ = MPIU_THREADPRIV_FIELD(nestinfo); \
- if (MPIU_THREADPRIV_FIELD(nest_count) >= MPICH_MAX_NESTINFO) { \
- MPIU_Internal_error_printf("nest stack exceeded at %s:%d\n", \
- __FILE__,__LINE__); \
- } \
- else { \
- MPIU_Strncpy(nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].file, \
- __FILE__, MPICH_MAX_NESTFILENAME); \
- nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].line=__LINE__;} \
- MPIU_THREADPRIV_FIELD(nest_count)++; \
- } while (0)
-/* Set the line for the current entry to - the old line - this can help
- identify increments that did not set the fields */
-#define MPIR_Nest_decr() \
- do { \
- MPICH_Nestinfo_t *nestinfo_ = NULL; \
- MPIU_THREADPRIV_GET; \
- nestinfo_ = MPIU_THREADPRIV_FIELD(nestinfo); \
- if (MPIU_THREADPRIV_FIELD(nest_count) >= 0) { \
- nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].line=-__LINE__; \
- } \
- MPIU_THREADPRIV_FIELD(nest_count)--; \
- if (MPIU_THREADPRIV_FIELD(nest_count) < MPICH_MAX_NESTINFO && \
- strcmp(nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].file,__FILE__) != 0) { \
- MPIU_Msg_printf( "Decremented nest count in file %s:%d but incremented in different file (%s:%d)\n", \
- __FILE__,__LINE__, \
- nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].file, \
- nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].line); \
- } \
- else if (MPIU_THREADPRIV_FIELD(nest_count) < 0){ \
- MPIU_Msg_printf("Decremented nest count in file %s:%d is negative\n", \
- __FILE__,__LINE__); \
- } \
- } while (0)
-#else
-#define MPIR_Nest_init() do { MPIU_THREADPRIV_GET; MPIU_THREADPRIV_FIELD(nest_count) = 0; } while (0)
-#define MPIR_Nest_incr() do { MPIU_THREADPRIV_GET; MPIU_THREADPRIV_FIELD(nest_count)++; } while (0)
-#define MPIR_Nest_decr() do { MPIU_THREADPRIV_GET; MPIU_THREADPRIV_FIELD(nest_count)--; } while (0)
-#endif /* MPICH_DEBUG_NESTING */
-
-#define MPIR_Nest_value() (MPIU_THREADPRIV_FIELD(nest_count))
-
-
/*int MPIR_Comm_attr_dup(MPID_Comm *, MPID_Attribute **);
int MPIR_Comm_attr_delete(MPID_Comm *, MPID_Attribute *);*/
int MPIR_Comm_copy( MPID_Comm *, int, MPID_Comm ** );
Added: mpich2/trunk/src/include/mpinestimpl.h
===================================================================
--- mpich2/trunk/src/include/mpinestimpl.h (rev 0)
+++ mpich2/trunk/src/include/mpinestimpl.h 2010-05-20 18:44:31 UTC (rev 6687)
@@ -0,0 +1,80 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2010 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+/* For no error checking, we could define MPIR_Nest_incr/decr as empty */
+
+/* These routines export the nesting controls for use in ROMIO */
+void MPIR_Nest_incr_export(void);
+void MPIR_Nest_decr_export(void);
+
+#ifdef MPICH_DEBUG_NESTING
+/* this nesting is different than the MPIU_THREAD_*DEPTH macros, this is
+ * MPI/NMPI nesting, the other one is critical section nesting */
+
+/* These two routines export the versions of the nest macros that
+ provide the file/line where the nest value changes, also for use in ROMIO */
+void MPIR_Nest_incr_export_dbg(const char *, int);
+void MPIR_Nest_decr_export_dbg(const char *, int);
+
+/* FIXME: We should move the initialization and error reporting into
+ routines that can be called when necessary */
+#define MPIR_Nest_init() \
+ do { \
+ int i_; \
+ MPICH_Nestinfo_t *nestinfo_ = NULL; \
+ MPIU_THREADPRIV_GET; \
+ nestinfo_ = MPIU_THREADPRIV_FIELD(nestinfo); \
+ for (i_ = 0; i_ <MPICH_MAX_NESTINFO; i_++) { \
+ nestinfo_[i_].file[0] = 0; \
+ nestinfo_[i_].line = 0; \
+ } \
+ } while (0)
+#define MPIR_Nest_incr() \
+ do { \
+ MPICH_Nestinfo_t *nestinfo_ = NULL; \
+ MPIU_THREADPRIV_GET; \
+ nestinfo_ = MPIU_THREADPRIV_FIELD(nestinfo); \
+ if (MPIU_THREADPRIV_FIELD(nest_count) >= MPICH_MAX_NESTINFO) { \
+ MPIU_Internal_error_printf("nest stack exceeded at %s:%d\n", \
+ __FILE__,__LINE__); \
+ } \
+ else { \
+ MPIU_Strncpy(nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].file, \
+ __FILE__, MPICH_MAX_NESTFILENAME); \
+ nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].line=__LINE__;} \
+ MPIU_THREADPRIV_FIELD(nest_count)++; \
+ } while (0)
+/* Set the line for the current entry to - the old line - this can help
+ identify increments that did not set the fields */
+#define MPIR_Nest_decr() \
+ do { \
+ MPICH_Nestinfo_t *nestinfo_ = NULL; \
+ MPIU_THREADPRIV_GET; \
+ nestinfo_ = MPIU_THREADPRIV_FIELD(nestinfo); \
+ if (MPIU_THREADPRIV_FIELD(nest_count) >= 0) { \
+ nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].line=-__LINE__; \
+ } \
+ MPIU_THREADPRIV_FIELD(nest_count)--; \
+ if (MPIU_THREADPRIV_FIELD(nest_count) < MPICH_MAX_NESTINFO && \
+ strcmp(nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].file,__FILE__) != 0) { \
+ MPIU_Msg_printf( "Decremented nest count in file %s:%d but incremented in different file (%s:%d)\n", \
+ __FILE__,__LINE__, \
+ nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].file, \
+ nestinfo_[MPIU_THREADPRIV_FIELD(nest_count)].line); \
+ } \
+ else if (MPIU_THREADPRIV_FIELD(nest_count) < 0){ \
+ MPIU_Msg_printf("Decremented nest count in file %s:%d is negative\n", \
+ __FILE__,__LINE__); \
+ } \
+ } while (0)
+#else
+#define MPIR_Nest_init() do { MPIU_THREADPRIV_GET; MPIU_THREADPRIV_FIELD(nest_count) = 0; } while (0)
+#define MPIR_Nest_incr() do { MPIU_THREADPRIV_GET; MPIU_THREADPRIV_FIELD(nest_count)++; } while (0)
+#define MPIR_Nest_decr() do { MPIU_THREADPRIV_GET; MPIU_THREADPRIV_FIELD(nest_count)--; } while (0)
+#endif /* MPICH_DEBUG_NESTING */
+
+#define MPIR_Nest_value() (MPIU_THREADPRIV_FIELD(nest_count))
+
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_defs.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_defs.h 2010-05-20 18:44:30 UTC (rev 6686)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_defs.h 2010-05-20 18:44:31 UTC (rev 6687)
@@ -11,7 +11,7 @@
#include "mpitypedefs.h"
#include "mpid_nem_datatypes.h"
#include "mpi.h"
-#include "mpiu_os_wrappers.h"
+#include "mpiu_os_wrappers_pre.h"
#define MPID_NEM_MAX_FNAME_LEN 256
Added: mpich2/trunk/src/util/wrappers/mpiu_os_wrappers_pre.h
===================================================================
--- mpich2/trunk/src/util/wrappers/mpiu_os_wrappers_pre.h (rev 0)
+++ mpich2/trunk/src/util/wrappers/mpiu_os_wrappers_pre.h 2010-05-20 18:44:31 UTC (rev 6687)
@@ -0,0 +1,61 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2010 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+/* This file contains "pre" definitions and declarations for the OS wrappers.
+ * That is, things that shouldn't depend on much more than the mpichconf.h
+ * values. */
+
+#ifndef MPIU_OS_WRAPPERS_PRE_H_INCLUDED
+#define MPIU_OS_WRAPPERS_PRE_H_INCLUDED
+
+/* ------------------------------------------------------------------------ */
+/* util wrappers */
+/* TODO port defs/decls here as necessary */
+
+/* ------------------------------------------------------------------------ */
+/* process wrappers */
+/* TODO port defs/decls here as necessary */
+
+/* ------------------------------------------------------------------------ */
+/* shm wrappers */
+
+#define MPIU_SHMW_FLAG_CLR 0x0
+#define MPIU_SHMW_FLAG_SHM_CREATE 0x1
+#define MPIU_SHMW_FLAG_SHM_ATTACH 0x10
+#define MPIU_SHMW_FLAG_GHND_STATIC 0x100
+
+#ifdef USE_SYSV_SHM
+typedef int MPIU_SHMW_Lhnd_t;
+#elif defined USE_MMAP_SHM
+typedef int MPIU_SHMW_Lhnd_t;
+#elif defined USE_NT_SHM
+typedef HANDLE MPIU_SHMW_Lhnd_t;
+#endif
+
+typedef char * MPIU_SHMW_Ghnd_t;
+/* The local handle, lhnd, is valid only for the current process,
+ * The global handle, ghnd, is valid across multiple processes
+ * The handle flag, flag, is used to set various attributes of the
+ * handle.
+ */
+typedef struct{
+ MPIU_SHMW_Lhnd_t lhnd;
+ MPIU_SHMW_Ghnd_t ghnd;
+ int flag;
+} MPIU_SHMW_LGhnd_t;
+
+typedef MPIU_SHMW_LGhnd_t * MPIU_SHMW_Hnd_t;
+
+#define MPIU_SHMW_HND_INVALID NULL
+#define MPIU_SHMW_GHND_INVALID NULL
+#define MPIU_SHMW_GHND_INIT_VAL '\0'
+/* TODO port additional defs/decls here as necessary */
+
+/* ------------------------------------------------------------------------ */
+/* sock wrappers */
+/* TODO port defs/decls here as necessary */
+
+#endif /* MPIU_OS_WRAPPERS_PRE_H_INCLUDED */
Modified: mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h
===================================================================
--- mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h 2010-05-20 18:44:30 UTC (rev 6686)
+++ mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h 2010-05-20 18:44:31 UTC (rev 6687)
@@ -39,47 +39,13 @@
# error "No shared memory mechanism specified"
#endif
-#include "mpi.h"
-#include "mpibase.h"
-#include "mpierror.h"
-#include "mpierrs.h"
-#include "mpimem.h"
-#include "mpiimplthread.h"
-#include "mpiutil.h"
-#include "mpidbg.h"
+#include "mpiu_os_wrappers_pre.h"
#include "mpiu_util_wrappers.h"
-#define MPIU_SHMW_FLAG_CLR 0x0
-#define MPIU_SHMW_FLAG_SHM_CREATE 0x1
-#define MPIU_SHMW_FLAG_SHM_ATTACH 0x10
-#define MPIU_SHMW_FLAG_GHND_STATIC 0x100
-
-#ifdef USE_SYSV_SHM
-typedef int MPIU_SHMW_Lhnd_t;
-#elif defined USE_MMAP_SHM
-typedef int MPIU_SHMW_Lhnd_t;
-#elif defined USE_NT_SHM
-typedef HANDLE MPIU_SHMW_Lhnd_t;
+#if !(defined(MPISHARED_H_INCLUDED) || defined(MPIIMPL_H_INCLUDED))
+#error "this header must be included after mpiimpl.h or mpishared.h"
#endif
-typedef char * MPIU_SHMW_Ghnd_t;
-/* The local handle, lhnd, is valid only for the current process,
- * The global handle, ghnd, is valid across multiple processes
- * The handle flag, flag, is used to set various attributes of the
- * handle.
- */
-typedef struct{
- MPIU_SHMW_Lhnd_t lhnd;
- MPIU_SHMW_Ghnd_t ghnd;
- int flag;
-} MPIU_SHMW_LGhnd_t;
-
-typedef MPIU_SHMW_LGhnd_t * MPIU_SHMW_Hnd_t;
-
-#define MPIU_SHMW_HND_INVALID NULL
-#define MPIU_SHMW_GHND_INVALID NULL
-#define MPIU_SHMW_GHND_INIT_VAL '\0'
-
/* FIXME: Reduce the conditional checks for wrapper-internal
* utility funcs/macros.
*/
More information about the mpich2-commits
mailing list