[mpich2-commits] r5492 - in mpich2/trunk/src: include mpid/ch3/include util/wrappers

goodell at mcs.anl.gov goodell at mcs.anl.gov
Tue Oct 20 15:35:15 CDT 2009


Author: goodell
Date: 2009-10-20 15:35:15 -0500 (Tue, 20 Oct 2009)
New Revision: 5492

Added:
   mpich2/trunk/src/include/mpichconfconst.h
Modified:
   mpich2/trunk/src/include/mpiimpl.h
   mpich2/trunk/src/include/mpiimplthread.h
   mpich2/trunk/src/mpid/ch3/include/mpidimpl.h
   mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h
Log:
Refactor configure-used constants to a new header included before mpidpre.h.

Prior to this commit the constants used to indicate the thread
granularity level were defined after mpidpre.h was included in mpiimpl.h
This prevented the device from making conditional compilation decisions
in mpidpre.h based on the thread granularity level selected by
configure.

No reviewer.

Added: mpich2/trunk/src/include/mpichconfconst.h
===================================================================
--- mpich2/trunk/src/include/mpichconfconst.h	                        (rev 0)
+++ mpich2/trunk/src/include/mpichconfconst.h	2009-10-20 20:35:15 UTC (rev 5492)
@@ -0,0 +1,52 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* This header file contains constants that might end up on the right hand side
+ * of a #define in mpichconf.h.
+ *
+ * In particular, this file must provide any constants that might be used for
+ * conditional compilation in mpidpre.h, before most of the other headers have
+ * been included in mpiimpl.h. */
+#ifndef MPICHCONFCONST_H_INCLUDED
+#define MPICHCONFCONST_H_INCLUDED
+
+#define MPICH_ERROR_MSG_NONE 0
+#define MPICH_ERROR_MSG_CLASS 1
+#define MPICH_ERROR_MSG_GENERIC 2
+#define MPICH_ERROR_MSG_ALL 8
+
+
+/* -------------------------------------------------------------------- */
+/* thread-related constants */
+/* -------------------------------------------------------------------- */
+
+/* Define the four ways that we achieve proper thread-safe updates of
+ * shared structures and services
+ *
+ * A configure choice will set MPIU_THREAD_GRANULARITY to one of these values */
+
+/* _INVALID exists to avoid accidental macro evaluations to 0 */
+#define MPIU_THREAD_GRANULARITY_INVALID 0
+#define MPIU_THREAD_GRANULARITY_GLOBAL 1
+#define MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL 2
+#define MPIU_THREAD_GRANULARITY_PER_OBJECT 3
+#define MPIU_THREAD_GRANULARITY_LOCK_FREE 4
+/* _SINGLE is the "null" granularity, where all processes are single-threaded */
+#define MPIU_THREAD_GRANULARITY_SINGLE 5
+
+/* controls the allocation mechanism for MPID_Request handles, which can greatly
+ * affect concurrency on the critical path */
+#define MPIU_HANDLE_ALLOCATION_MUTEX         0
+#define MPIU_HANDLE_ALLOCATION_THREAD_LOCAL  1
+
+/* _INVALID exists to avoid accidental macro evaluations to 0 */
+#define MPIU_REFCOUNT_INVALID 0
+/* _NONE means no concurrency control, such as when using MPI_THREAD_SINGLE */
+#define MPIU_REFCOUNT_NONE 1
+#define MPIU_REFCOUNT_LOCK 2
+#define MPIU_REFCOUNT_LOCKFREE 3
+
+#endif /* MPICHCONFCONST_H_INCLUDED */

Modified: mpich2/trunk/src/include/mpiimpl.h
===================================================================
--- mpich2/trunk/src/include/mpiimpl.h	2009-10-20 20:34:51 UTC (rev 5491)
+++ mpich2/trunk/src/include/mpiimpl.h	2009-10-20 20:35:15 UTC (rev 5492)
@@ -21,16 +21,11 @@
 /* Include nested mpi (NMPI) definitions */
 #include "nmpi.h"
 
-/* There are a few definitions that must be made *before* the mpichconf.h 
-   file is included.  These include the definitions of the error levels */
-#define MPICH_ERROR_MSG_NONE 0
-#define MPICH_ERROR_MSG_CLASS 1
-#define MPICH_ERROR_MSG_GENERIC 2
-#define MPICH_ERROR_MSG_ALL 8
+/* There are a few definitions that must be made *before* the mpichconf.h
+   file is included.  These include the definitions of the error levels and some
+   thread granularity constants */
+#include "mpichconfconst.h"
 
-/* Common definition for the max hostname length to be used by
- * different channels as well as the collectives. */
-
 /* Data computed by configure.  This is included *after* mpi.h because we
    do not want mpi.h to depend on any other files or configure flags */
 #include "mpichconf.h"

Modified: mpich2/trunk/src/include/mpiimplthread.h
===================================================================
--- mpich2/trunk/src/include/mpiimplthread.h	2009-10-20 20:34:51 UTC (rev 5491)
+++ mpich2/trunk/src/include/mpiimplthread.h	2009-10-20 20:35:15 UTC (rev 5492)
@@ -25,18 +25,6 @@
 #include "mpid_thread.h"
 #endif
 
-/* 
- * Define the four ways that we achieve proper thread-safe updates of 
- * shared structures and services
- * 
- * A configure choice will set MPIU_THREAD_GRANULARITY to one of these values
- */
-#define MPIU_THREAD_GRANULARITY_GLOBAL 1
-#define MPIU_THREAD_GRANULARITY_BRIEF_GLOBAL 2
-#define MPIU_THREAD_GRANULARITY_PER_OBJECT 3
-#define MPIU_THREAD_GRANULARITY_LOCK_FREE 4
-#define MPIU_THREAD_GRANULARITY_SINGLE 5
-
 /*
  * Define possible thread implementations that could be selected at 
  * configure time.  
@@ -50,6 +38,7 @@
  *
  */
 /* FIXME: These are old and deprecated */
+/* FIXME XXX DJG: delete these soon */
 #define MPICH_THREAD_IMPL_NOT_IMPLEMENTED -1
 #define MPICH_THREAD_IMPL_NONE 1
 #define MPICH_THREAD_IMPL_GLOBAL_MUTEX 2

Modified: mpich2/trunk/src/mpid/ch3/include/mpidimpl.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/include/mpidimpl.h	2009-10-20 20:34:51 UTC (rev 5491)
+++ mpich2/trunk/src/mpid/ch3/include/mpidimpl.h	2009-10-20 20:35:15 UTC (rev 5492)
@@ -234,10 +234,7 @@
  *     cancelled state
  */
 
-#define MPIU_HANDLE_ALLOCATION_MUTEX         0
-#define MPIU_HANDLE_ALLOCATION_THREAD_LOCAL  1
-
-/* XXX DJG for TLS hack */
+/* FIXME XXX DJG for TLS hack */
 #define MPID_REQUEST_TLS_MAX 128
 
 #if MPIU_HANDLE_ALLOCATION_METHOD == MPIU_HANDLE_ALLOCATION_THREAD_LOCAL

Modified: mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h
===================================================================
--- mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h	2009-10-20 20:34:51 UTC (rev 5491)
+++ mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h	2009-10-20 20:35:15 UTC (rev 5492)
@@ -10,6 +10,7 @@
  */
 /* SHM Wrapper funcs defined in this header file */
 
+#include "mpichconfconst.h"
 #include "mpichconf.h"
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>



More information about the mpich2-commits mailing list