From 770d49570b406a5ca2db32357f1b4a8536051294 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 9 Jan 2004 22:09:51 +0000 Subject: [PATCH] Moving all the header files. :-) This commit was SVN r185. --- configure.ac | 1 + src/include/Makefile.am | 21 --- src/lam/atomic.h | 102 ++++++++++++++ src/lam/constants.h | 23 ++++ src/lam/ctnetwork/ctclient.c | 2 +- src/lam/ctnetwork/ctcontroller.c | 2 +- src/lam/ctnetwork/ctnode.c | 2 +- src/lam/ctnetwork/ctnode.h | 2 +- src/lam/ctnetwork/ctpeer.c | 2 +- src/lam/lam.h | 23 ++++ src/lam/lfc/array.h | 2 +- src/lam/lfc/hash_table.c | 2 +- src/lam/lfc/hash_table.h | 2 +- src/lam/lfc/object.h | 11 +- src/lam/mem/mem_globals.c | 2 +- src/lam/mem/mem_pool.c | 2 +- src/lam/mem/mem_pool.h | 2 +- src/lam/os/linux/i686/atomic.h | 2 +- src/lam/os/numa.h | 2 +- src/lam/stdint.h | 174 ++++++++++++++++++++++++ src/lam/totalview.h | 11 ++ src/lam/types.h | 32 +++++ src/lam/util/lam_log.c | 2 +- src/lam/util/reactor.h | 2 +- src/mca/mpi/coll/coll.h | 6 +- src/mca/mpi/pml/base/pml_base_request.h | 6 +- src/mca/mpi/pml/pml.h | 4 +- src/mpi/communicator/communicator.h | 49 +++++++ src/mpi/datatype/datatype.c | 2 +- src/mpi/group/group.h | 23 ++++ src/mpi/interface/c/comm_set_name.c | 4 +- src/mpi/proc/proc.h | 38 ++++++ src/mpi/request/request.h | 31 +++++ 33 files changed, 542 insertions(+), 49 deletions(-) create mode 100644 src/lam/atomic.h create mode 100644 src/lam/constants.h create mode 100644 src/lam/lam.h create mode 100644 src/lam/stdint.h create mode 100644 src/lam/totalview.h create mode 100644 src/lam/types.h create mode 100644 src/mpi/communicator/communicator.h create mode 100644 src/mpi/group/group.h create mode 100644 src/mpi/proc/proc.h create mode 100644 src/mpi/request/request.h diff --git a/configure.ac b/configure.ac index 1494ba9345..e68e56f068 100644 --- a/configure.ac +++ b/configure.ac @@ -370,6 +370,7 @@ AC_CONFIG_FILES([ src/Makefile src/include/Makefile + src/include/lam/Makefile src/lam/Makefile src/lam/ctnetwork/Makefile diff --git a/src/include/Makefile.am b/src/include/Makefile.am index a45f67f18b..43b4bb6f9e 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am @@ -5,33 +5,12 @@ include $(top_srcdir)/config/Makefile.options -headers = \ - communicator.h \ - datatype.h \ - group.h \ - lam_constants.h \ - lam.h \ - lam_atomic.h \ - lam_stdint.h \ - lam_types.h \ - proc.h \ - totalview.h - include_HEADERS = \ lam_config.h \ lam_config_bottom.h \ mpi.h \ mpif.h -# Conditionally install the header files - -if WANT_INSTALL_HEADERS -lamdir = $(includedir)/lam/include -lam_HEADERS = $(headers) $(include_HEADERS) -else -lamdir = $(includedir) -endif - # Add a hook to run *after* the file lam_config.h has been installed # out to the target location. It changes the pesky PACKAGE_* macros # that autoconf automatically generates (and there is no way of diff --git a/src/lam/atomic.h b/src/lam/atomic.h new file mode 100644 index 0000000000..688a483d7b --- /dev/null +++ b/src/lam/atomic.h @@ -0,0 +1,102 @@ +/* + * $HEADER$ + */ + +/** @file + * + * Atomic operations. + * + * This API is patterned after the FreeBSD kernel atomic interface, + * but using C99 integer types. The FreeBSD interface is documented + * at + * + * http://www.freebsd.org/cgi/man.cgi?query=atomic&sektion=9 + */ + +#ifndef LAM_ATOMIC_H +#define LAM_ATOMIC_H 1 + +#include "lam_config.h" +#include "lam/stdint.h" + +/* + * prototypes (we may not implement all of this interface) + */ + +static inline int lam_atomic_cmpset_acq_int(volatile int *p, int old, int new); +static inline int lam_atomic_cmpset_rel_int(volatile int *p, int old, int new); +static inline int lam_atomic_load_acq_int(volatile int *p); +static inline int lam_atomic_readandclear_int(volatile int *p); +static inline void lam_atomic_add_acq_int(volatile int *p, int v); +static inline void lam_atomic_add_rel_int(volatile int *p, int v); +static inline void lam_atomic_clear_acq_int(volatile int *p, int v); +static inline void lam_atomic_clear_rel_int(volatile int *p, int v); +static inline void lam_atomic_set_acq_int(volatile int *p, int v); +static inline void lam_atomic_set_rel_int(volatile int *p, int v); +static inline void lam_atomic_store_rel_int(volatile int *p, int v); +static inline void lam_atomic_subtract_acq_int(volatile int *p, int v); +static inline void lam_atomic_subtract_rel_int(volatile int *p, int v); + +static inline int lam_atomic_cmpset_acq_long(volatile long *p, long old, long new); +static inline int lam_atomic_cmpset_rel_long(volatile long *p, long old, long new); +static inline long lam_atomic_load_acq_long(volatile long *p); +static inline long lam_atomic_readandclear_long(volatile long *p); +static inline void lam_atomic_add_acq_long(volatile long *p, long v); +static inline void lam_atomic_add_rel_long(volatile long *p, long v); +static inline void lam_atomic_clear_acq_long(volatile long *p, long v); +static inline void lam_atomic_clear_rel_long(volatile long *p, long v); +static inline void lam_atomic_set_acq_long(volatile long *p, long v); +static inline void lam_atomic_set_rel_long(volatile long *p, long v); +static inline void lam_atomic_store_rel_long(volatile long *p, long v); +static inline void lam_atomic_subtract_acq_long(volatile long *p, long v); +static inline void lam_atomic_subtract_rel_long(volatile long *p, long v); + +static inline int lam_atomic_cmpset_acq_ptr(volatile uintptr_t *p, uintptr_t old, uintptr_t new); +static inline int lam_atomic_cmpset_rel_ptr(volatile uintptr_t *p, uintptr_t old, uintptr_t new); +static inline uintptr_t lam_atomic_load_acq_ptr(volatile uintptr_t *p); +static inline uintptr_t lam_atomic_readandclear_ptr(volatile uintptr_t *p); +static inline void lam_atomic_add_acq_ptr(volatile uintptr_t *p, uintptr_t v); +static inline void lam_atomic_add_rel_ptr(volatile uintptr_t *p, uintptr_t v); +static inline void lam_atomic_clear_acq_ptr(volatile uintptr_t *p, uintptr_t v); +static inline void lam_atomic_clear_rel_ptr(volatile uintptr_t *p, uintptr_t v); +static inline void lam_atomic_set_acq_ptr(volatile uintptr_t *p, uintptr_t v); +static inline void lam_atomic_set_rel_ptr(volatile uintptr_t *p, uintptr_t v); +static inline void lam_atomic_store_rel_ptr(volatile uintptr_t *p, uintptr_t v); +static inline void lam_atomic_subtract_acq_ptr(volatile uintptr_t *p, uintptr_t v); +static inline void lam_atomic_subtract_rel_ptr(volatile uintptr_t *p, uintptr_t v); + +static inline int lam_atomic_cmpset_acq_uint32_t(volatile uint32_t *p, uint32_t old, uint32_t new); +static inline int lam_atomic_cmpset_rel_uint32_t(volatile uint32_t *p, uint32_t old, uint32_t new); +static inline uint32_t lam_atomic_load_acq_uint32_t(volatile uint32_t *p); +static inline uint32_t lam_atomic_readandclear_uint32_t(volatile uint32_t *p); +static inline void lam_atomic_add_acq_uint32_t(volatile uint32_t *p, uint32_t v); +static inline void lam_atomic_add_rel_uint32_t(volatile uint32_t *p, uint32_t v); +static inline void lam_atomic_clear_acq_uint32_t(volatile uint32_t *p, uint32_t v); +static inline void lam_atomic_clear_rel_uint32_t(volatile uint32_t *p, uint32_t v); +static inline void lam_atomic_set_acq_uint32_t(volatile uint32_t *p, uint32_t v); +static inline void lam_atomic_set_rel_uint32_t(volatile uint32_t *p, uint32_t v); +static inline void lam_atomic_store_rel_uint32_t(volatile uint32_t *p, uint32_t v); +static inline void lam_atomic_subtract_acq_uint32_t(volatile uint32_t *p, uint32_t v); +static inline void lam_atomic_subtract_rel_uint32_t(volatile uint32_t *p, uint32_t v); + +static inline int lam_atomic_cmpset_acq_uint64_t(volatile uint64_t *p, uint64_t old, uint64_t new); +static inline int lam_atomic_cmpset_rel_uint64_t(volatile uint64_t *p, uint64_t old, uint64_t new); +static inline uint64_t lam_atomic_load_acq_uint64_t(volatile uint64_t *p); +static inline uint64_t lam_atomic_readandclear_uint64_t(volatile uint64_t *p); +static inline void lam_atomic_add_acq_uint64_t(volatile uint64_t *p, uint64_t v); +static inline void lam_atomic_add_rel_uint64_t(volatile uint64_t *p, uint64_t v); +static inline void lam_atomic_clear_acq_uint64_t(volatile uint64_t *p, uint64_t v); +static inline void lam_atomic_clear_rel_uint64_t(volatile uint64_t *p, uint64_t v); +static inline void lam_atomic_set_acq_uint64_t(volatile uint64_t *p, uint64_t v); +static inline void lam_atomic_set_rel_uint64_t(volatile uint64_t *p, uint64_t v); +static inline void lam_atomic_store_rel_uint64_t(volatile uint64_t *p, uint64_t v); +static inline void lam_atomic_subtract_acq_uint64_t(volatile uint64_t *p, uint64_t v); +static inline void lam_atomic_subtract_rel_uint64_t(volatile uint64_t *p, uint64_t v); + +/* + * implementation (system specific) + */ + +/* #include "os/XXXX/atomic.h" */ + +#endif /* LAM_ATOMIC_H */ diff --git a/src/lam/constants.h b/src/lam/constants.h new file mode 100644 index 0000000000..13d10193c8 --- /dev/null +++ b/src/lam/constants.h @@ -0,0 +1,23 @@ +/* + * $HEADER$ + */ + +#ifndef LAM_CONSTANTS_H +#define LAM_CONSTANTS_H + +/* error codes */ +enum { + LAM_SUCCESS = 0, + LAM_ERROR = -1, + LAM_ERR_OUT_OF_RESOURCE = -2, /* fatal error */ + LAM_ERR_TEMP_OUT_OF_RESOURCE = -3, /* try again later */ + LAM_ERR_RESOURCE_BUSY = -4, + LAM_ERR_BAD_PARAM = -5, /* equivalent to MPI_ERR_ARG error code */ + LAM_ERR_RECV_LESS_THAN_POSTED = -6, + LAM_ERR_RECV_MORE_THAN_POSTED = -7, + LAM_ERR_NO_MATCH_YET = -8, + LAM_ERR_FATAL = -9 +}; + +#endif /* LAM_CONSTANTS_H */ + diff --git a/src/lam/ctnetwork/ctclient.c b/src/lam/ctnetwork/ctclient.c index a8bfa0dd12..5a4d9f84df 100644 --- a/src/lam/ctnetwork/ctclient.c +++ b/src/lam/ctnetwork/ctclient.c @@ -2,5 +2,5 @@ * $HEADER$ */ -#include "ctclient.h" +#include "lam/ctnetwork/ctclient.h" diff --git a/src/lam/ctnetwork/ctcontroller.c b/src/lam/ctnetwork/ctcontroller.c index 1002826b96..7de060903f 100644 --- a/src/lam/ctnetwork/ctcontroller.c +++ b/src/lam/ctnetwork/ctcontroller.c @@ -2,5 +2,5 @@ * $HEADER$ */ -#include "ctpeer.h" +#include "lam/ctnetwork/ctpeer.h" diff --git a/src/lam/ctnetwork/ctnode.c b/src/lam/ctnetwork/ctnode.c index 706b7994cb..a68aaebe67 100644 --- a/src/lam/ctnetwork/ctnode.c +++ b/src/lam/ctnetwork/ctnode.c @@ -2,5 +2,5 @@ * $HEADER$ */ -#include "ctnode.h" +#include "lam/ctnetwork/ctnode.h" diff --git a/src/lam/ctnetwork/ctnode.h b/src/lam/ctnetwork/ctnode.h index 4d048986eb..963ecac88d 100644 --- a/src/lam/ctnetwork/ctnode.h +++ b/src/lam/ctnetwork/ctnode.h @@ -5,7 +5,7 @@ #ifndef LAM_CT_NODE_H #define LAM_CT_NODE_H -#include "lam_stdint.h" +#include "lam/stdint.h" #include "lam/lfc/object.h" #include "lam/lfc/hash_table.h" diff --git a/src/lam/ctnetwork/ctpeer.c b/src/lam/ctnetwork/ctpeer.c index 1002826b96..7de060903f 100644 --- a/src/lam/ctnetwork/ctpeer.c +++ b/src/lam/ctnetwork/ctpeer.c @@ -2,5 +2,5 @@ * $HEADER$ */ -#include "ctpeer.h" +#include "lam/ctnetwork/ctpeer.h" diff --git a/src/lam/lam.h b/src/lam/lam.h new file mode 100644 index 0000000000..65aaaec1e8 --- /dev/null +++ b/src/lam/lam.h @@ -0,0 +1,23 @@ +/* + * $HEADER$ + */ + +#ifndef LAM_H +#define LAM_H + +#include +#include + +#include "lam_config.h" +#include "lam/stdint.h" +#include "lam/types.h" +#include "lam/constants.h" + +#if LAM_ENABLE_MEM_ZERO +#include +#define LAM_MEM_ZERO(foo) memset(&(foo), 0, sizeof(foo)) +#else +#define LAM_MEM_ZERO(foo) +#endif + +#endif /* LAM_H */ diff --git a/src/lam/lfc/array.h b/src/lam/lfc/array.h index c824590158..eb86710923 100644 --- a/src/lam/lfc/array.h +++ b/src/lam/lfc/array.h @@ -6,7 +6,7 @@ #define LAM_ARRAY_H #include "lam_config.h" -#include "include/lam_types.h" +#include "lam/types.h" #include "lam/lfc/object.h" /* diff --git a/src/lam/lfc/hash_table.c b/src/lam/lfc/hash_table.c index 3c716facc2..f1a9eada82 100644 --- a/src/lam/lfc/hash_table.c +++ b/src/lam/lfc/hash_table.c @@ -6,7 +6,7 @@ #include #include "lam_config.h" -#include "include/lam_constants.h" +#include "lam/constants.h" #include "lam/lfc/hash_table.h" #define BUCKET_ALLOC_SZ 5 diff --git a/src/lam/lfc/hash_table.h b/src/lam/lfc/hash_table.h index e43bd4d5a0..18041fdc1e 100644 --- a/src/lam/lfc/hash_table.h +++ b/src/lam/lfc/hash_table.h @@ -6,7 +6,7 @@ #define LAM_HASH_TABLE_H #include "lam_config.h" -#include "include/lam_stdint.h" +#include "lam/stdint.h" #include "lam/lfc/object.h" typedef struct lam_fhnode diff --git a/src/lam/lfc/object.h b/src/lam/lfc/object.h index 55bd0913a1..e53ae9ed47 100644 --- a/src/lam/lfc/object.h +++ b/src/lam/lfc/object.h @@ -6,8 +6,8 @@ #define LAM_OBJECT_H #include -#include "include/lam_types.h" -#include "lam/os/atomic.h" +#include "lam/types.h" +#include "lam/atomic.h" /* * @@ -83,6 +83,13 @@ typedef struct lam_object void lam_obj_init(lam_object_t *obj); void lam_obj_destroy(lam_object_t *obj); +/* + * This function is used by inline functions later in this file, and + * it must be defined by other header files later (eg., one of the + * atomic.h's). + */ +static inline int fetchNadd(volatile int *addr, int inc); + /* returns 1 if object's class is derived from cls, otherwise 0. */ diff --git a/src/lam/mem/mem_globals.c b/src/lam/mem/mem_globals.c index 519d9607b1..e2ebc3b8e0 100644 --- a/src/lam/mem/mem_globals.c +++ b/src/lam/mem/mem_globals.c @@ -4,7 +4,7 @@ #include -#include "lam_constants.h" +#include "lam/constants.h" #include "lam/lfc/object.h" #include "lam/mem/mem_globals.h" diff --git a/src/lam/mem/mem_pool.c b/src/lam/mem/mem_pool.c index 7ea6dfe377..f9e5782bb9 100644 --- a/src/lam/mem/mem_pool.c +++ b/src/lam/mem/mem_pool.c @@ -5,7 +5,7 @@ #include #include #include -#include "lam_constants.h" +#include "lam/constants.h" #include "lam/mem/mem_pool.h" #include "lam/mem/sharedmem_util.h" #include "lam/util/lam_log.h" diff --git a/src/lam/mem/mem_pool.h b/src/lam/mem/mem_pool.h index dbbbc050ed..ec7d9eb7bd 100644 --- a/src/lam/mem/mem_pool.h +++ b/src/lam/mem/mem_pool.h @@ -5,7 +5,7 @@ #ifndef LAM_MEMORY_POOL_H #define LAM_MEMORY_POOL_H -#include "lam_types.h" +#include "lam/types.h" #include "lam/lfc/object.h" #include "lam/mem/allocator.h" #include "lam/threads/mutex.h" diff --git a/src/lam/os/linux/i686/atomic.h b/src/lam/os/linux/i686/atomic.h index 63a7686161..a23bdb235b 100644 --- a/src/lam/os/linux/i686/atomic.h +++ b/src/lam/os/linux/i686/atomic.h @@ -27,6 +27,7 @@ typedef struct { volatile unsigned long long data; } bigAtomicUnsignedInt; +/* JMS This section is commented out */ /* #ifdef __INTEL_COMPILER @@ -44,7 +45,6 @@ extern "C" } #endif - #else */ diff --git a/src/lam/os/numa.h b/src/lam/os/numa.h index b3a9929886..7567c40c89 100644 --- a/src/lam/os/numa.h +++ b/src/lam/os/numa.h @@ -2,7 +2,7 @@ * $HEADER$ */ -#include "lam_constants.h" +#include "lam/constants.h" #include "lam/lfc/object.h" typedef int affinity_t; diff --git a/src/lam/stdint.h b/src/lam/stdint.h new file mode 100644 index 0000000000..521f0767eb --- /dev/null +++ b/src/lam/stdint.h @@ -0,0 +1,174 @@ +/* + * $HEADER$ + * + * This file includes the C99 stdint.h file if available, and otherwise + * defines fixed-width types according to the SIZEOF information + * gathered by configure. + */ + +#ifndef LAM_STDINT_H +#define LAM_STDINT_H 1 + +#include "lam_config.h" + +#ifdef HAVE_STDINT_H + +#include + +#else + +/* + * Include what we can and define what is missing. + */ + +#if HAVE_INTTYPES_H +#include +#endif + +#if HAVE_SYS_TYPES_H +#include +#endif + +/* 8-bit */ + +#if SIZEOF_CHAR == 1 + +#ifndef HAVE_INT8_T +typedef signed char int8_t; +#endif + +#ifndef HAVE_UINT8_T +typedef unsigned char uint8_t; +#endif + +#else + +#error Failed to define 8-bit types + +#endif + +/* 16-bit */ + +#if SIZEOF_SHORT == 2 + +#ifndef HAVE_INT16_T +typedef signed short int16_t; +#endif + +#ifndef HAVE_UINT16_T +typedef unsigned short uint16_t; +#endif + +#else + +#error Failed to define 16-bit types + +#endif + +/* 32-bit */ + +#if SIZEOF_INT == 4 + +#ifndef HAVE_INT32_T +typedef signed int int32_t; +#endif + +#ifndef HAVE_UINT32_T +typedef unsigned int uint32_t; +#endif + +#elif SIZEOF_LONG == 4 + +#ifndef HAVE_INT32_T +typedef signed long int32_t; +#endif + +#ifndef HAVE_UINT32_T +typedef unsigned long uint32_t; +#endif + +#else + +#error Failed to define 32-bit types + +#endif + +/* 64-bit */ + +#if SIZEOF_INT == 8 + +#ifndef HAVE_INT64_T +typedef signed int int64_t; +#endif + +#ifndef HAVE_UINT64_T +typedef unsigned int uint64_t; +#endif + +#elif SIZEOF_LONG == 8 + +#ifndef HAVE_INT64_T +typedef signed long int64_t; +#endif + +#ifndef HAVE_UINT64_T +typedef unsigned long uint64_t; +#endif + +#elif HAVE_LONG_LONG && SIZEOF_LONG_LONG == 8 + +#ifndef HAVE_INT64_T +typedef signed long long int64_t; +#endif + +#ifndef HAVE_UINT64_T +typedef unsigned long long uint64_t; +#endif + +#else + +#error Failed to define 64-bit types + +#endif + +/* Pointers */ + +#if SIZEOF_VOID_P == SIZEOF_INT + +#ifndef HAVE_INTPTR_T +typedef signed int intptr_t; +#endif + +#ifndef HAVE_UINTPTR_T +typedef unsigned int uintptr_t; +#endif + +#elif SIZEOF_VOID_P == SIZEOF_LONG + +#ifndef HAVE_INTPTR_T +typedef signed long intptr_t; +#endif + +#ifndef HAVE_UINTPTR_T +typedef unsigned long uintptr_t; +#endif + +#elif HAVE_LONG_LONG && SIZEOF_VOID_P == SIZEOF_LONG_LONG + +#ifndef HAVE_INTPTR_T +typedef signed long long intptr_t; +#endif +#ifndef HAVE_UINTPTR_T +typedef unsigned long long uintptr_t; +#endif + +#else + +#error Failed to define pointer-sized integer types + +#endif + +#endif /* HAVE_STDINT_H */ + +#endif /* LAM_STDINT_H */ + diff --git a/src/lam/totalview.h b/src/lam/totalview.h new file mode 100644 index 0000000000..1743121148 --- /dev/null +++ b/src/lam/totalview.h @@ -0,0 +1,11 @@ +/* + * $HEADER$ + */ + +#ifndef LAM_TOTALVIEW_H +#define LAM_TOTALVIEW_H + +extern int lam_tv_comm_sequence_number; + +#endif /* LAM_TOTALVIEW_H */ + diff --git a/src/lam/types.h b/src/lam/types.h new file mode 100644 index 0000000000..4a097397b7 --- /dev/null +++ b/src/lam/types.h @@ -0,0 +1,32 @@ +/* + * $HEADER$ + */ + +#ifndef LAM_TYPES_H +#define LAM_TYPES_H + +#include +#include + +#include "lam_config.h" +#include "lam/stdint.h" + +/* + * Increase FD_SETSIZE + */ + +#ifndef LAM_FD_SETSIZE +#define LAM_FD_SETSIZE 4096 +#endif + +typedef struct _lam_fd_set { + uint32_t fds_bits[LAM_FD_SETSIZE / NFDBITS]; +} lam_fd_set_t; + +#define LAM_FD_ZERO(fds) FD_ZERO((fd_set*)(fds)) +#define LAM_FD_SET(fd,fds) FD_SET((fd),(fd_set*)(fds)) +#define LAM_FD_CLR(fd,fds) FD_CLR((fd),(fd_set*)(fds)) +#define LAM_FD_ISSET(fd,fds) FD_ISSET((fd),(fd_set*)(fds)) + +#endif + diff --git a/src/lam/util/lam_log.c b/src/lam/util/lam_log.c index 37dffeb1b2..38e2f60d12 100644 --- a/src/lam/util/lam_log.c +++ b/src/lam/util/lam_log.c @@ -2,7 +2,7 @@ * $HEADER$ */ -#include "lam_log.h" +#include "lam/util/lam_log.h" #include #include diff --git a/src/lam/util/reactor.h b/src/lam/util/reactor.h index 8e489751d7..1d016f1dda 100644 --- a/src/lam/util/reactor.h +++ b/src/lam/util/reactor.h @@ -5,7 +5,7 @@ #ifndef LAM_REACTOR_H #define LAM_REACTOR_H -#include "include/lam_types.h" +#include "lam/types.h" #include "lam/lfc/list.h" #include "lam/lfc/hash_table.h" #include "lam/threads/mutex.h" diff --git a/src/mca/mpi/coll/coll.h b/src/mca/mpi/coll/coll.h index 977db31d58..bca988d0c5 100644 --- a/src/mca/mpi/coll/coll.h +++ b/src/mca/mpi/coll/coll.h @@ -197,7 +197,7 @@ extern "C" { int mca_coll_base_close(void); int mca_coll_base_init_comm(MPI_Comm comm); int mca_coll_base_get_param(MPI_Comm comm, int keyval); - int mca_coll_base_open(lam_cmt_line_t *cmd); + int mca_coll_base_open(lam_cmd_line_t *cmd); int mca_coll_base_query(void); int mca_coll_base_empty_checkpoint(MPI_Comm comm); @@ -227,8 +227,8 @@ extern int mca_coll_did; extern int mca_coll_base_crossover; extern int mca_coll_base_associative; extern int mca_coll_base_reduce_crossover; -extern lam_list_t *mca_coll_base_opened; -extern lam_list_t *mca_coll_base_available; +extern lam_dbl_list_t *mca_coll_base_opened; +extern lam_dbl_list_t *mca_coll_base_available; /* diff --git a/src/mca/mpi/pml/base/pml_base_request.h b/src/mca/mpi/pml/base/pml_base_request.h index 56827aa7b8..f5a232eee1 100644 --- a/src/mca/mpi/pml/base/pml_base_request.h +++ b/src/mca/mpi/pml/base/pml_base_request.h @@ -6,9 +6,9 @@ #ifndef MCA_PML_BASE_REQUEST_H #define MCA_PML_BASE_REQUEST_H -#include "communicator.h" -#include "datatype.h" -#include "include/request.h" +#include "lam/communicator.h" +#include "lam/datatype.h" +#include "lam/request.h" #include "lam/mem/free_list.h" #include "mca/mpi/pml/pml.h" diff --git a/src/mca/mpi/pml/pml.h b/src/mca/mpi/pml/pml.h index 62b15e6c05..74687f7698 100644 --- a/src/mca/mpi/pml/pml.h +++ b/src/mca/mpi/pml/pml.h @@ -5,8 +5,8 @@ #ifndef LAM_MCA_PML_H #define LAM_MCA_PML_H -#include "lam.h" -#include "proc.h" +#include "lam/lam.h" +#include "lam/proc.h" #include "lam/lfc/list.h" #include "mca/mca.h" diff --git a/src/mpi/communicator/communicator.h b/src/mpi/communicator/communicator.h new file mode 100644 index 0000000000..6c3e4af91c --- /dev/null +++ b/src/mpi/communicator/communicator.h @@ -0,0 +1,49 @@ +/* + * $HEADER$ + */ + +#ifndef LAM_COMMUNICATOR +#define LAM_COMMUNICATOR + +#include "mpi.h" +#include "lam/group.h" +#include "lam/threads/mutex.h" +#include "mca/mpi/coll/coll.h" + +struct lam_communicator_t { + char c_name[MPI_MAX_OBJECT_NAME]; + int c_contextid; + int c_refcount; + int c_flags; + + lam_group_t c_local_group; + lam_group_t c_remote_group; + + + /* Queues */ + + /* Attributes */ + + /* Topology information */ + + /* Error handling */ + +#if 0 + MPI_Errhandler c_error_handler; +#endif + + /* Hooks for PML to hang things */ + struct mca_pml_comm_t* c_pml_comm; + +#if 0 + /* Hooks for collectives to hang things */ + mca_coll_t c_coll; + struct mca_coll_comm_t* c_coll_comm; +#endif +}; + +typedef struct lam_communicator_t lam_communicator_t; + + +#endif /* LAM_COMMUNICATOR_H */ + diff --git a/src/mpi/datatype/datatype.c b/src/mpi/datatype/datatype.c index 7c09f14823..f924237f70 100644 --- a/src/mpi/datatype/datatype.c +++ b/src/mpi/datatype/datatype.c @@ -7,7 +7,7 @@ #ifdef DATATYPES_ARE_READY #include "lam_config.h" -#include "datatype.h" +#include "lam/datatype.h" lam_class_info_t lam_datatype_cls = { diff --git a/src/mpi/group/group.h b/src/mpi/group/group.h new file mode 100644 index 0000000000..3b169002a0 --- /dev/null +++ b/src/mpi/group/group.h @@ -0,0 +1,23 @@ +/* + * $HEADER$ + */ + +#ifndef LAM_GROUP_H +#define LAM_GROUP_H + +#include "mpi.h" +#include "lam/proc.h" + + +typedef struct lam_group { + char g_name[MPI_MAX_OBJECT_NAME]; + + /* Processes */ + + lam_proc_t **g_procs; + size_t g_proc_count; + +} lam_group_t; + + +#endif /* LAM_GROUP_H */ diff --git a/src/mpi/interface/c/comm_set_name.c b/src/mpi/interface/c/comm_set_name.c index c47f0fbbba..fcb114fbc8 100644 --- a/src/mpi/interface/c/comm_set_name.c +++ b/src/mpi/interface/c/comm_set_name.c @@ -8,8 +8,8 @@ #include "mpi/c/bindings.h" #include "lam/util/strncpy.h" -#include "communicator.h" -#include "totalview.h" +#include "lam/communicator.h" +#include "lam/totalview.h" #if LAM_WANT_MPI_PROFILING && LAM_HAVE_WEAK_SYMBOLS #pragma weak PMPI_Comm_set_name = MPI_Comm_set_name diff --git a/src/mpi/proc/proc.h b/src/mpi/proc/proc.h new file mode 100644 index 0000000000..3b716ff35f --- /dev/null +++ b/src/mpi/proc/proc.h @@ -0,0 +1,38 @@ +/* + * $HEADER$ + */ + +#ifndef LAM_PROC +#define LAM_PROC + +#include "lam/lfc/list.h" + + +extern lam_class_info_t lam_proc_cls; +extern lam_dbl_list_t lam_procs; + + +struct lam_proc_t { + lam_dbl_item_t super; /* allow proc to be placed on a list */ + pid_t proc_id; + int proc_gid; /* globally unique identifier? */ + struct mca_pml_proc_t* proc_pml; /* PML specific proc data */ + + /* JMS: need to have the following information: + + - endian info + - type size info + - peer parallel job id + - how am i [mpi] connected (bitmap): spawn (parent/child), + connect, accept, joint + */ +}; +typedef struct lam_proc_t lam_proc_t; + + +void lam_proc_init(lam_proc_t*); +void lam_proc_destroy(lam_proc_t*); + + +#endif /* LAM_PROC */ + diff --git a/src/mpi/request/request.h b/src/mpi/request/request.h new file mode 100644 index 0000000000..a9120d3f6f --- /dev/null +++ b/src/mpi/request/request.h @@ -0,0 +1,31 @@ +/* + * $HEADER$ + */ + +#ifndef LAM_REQUEST_H +#define LAM_REQUEST_H + +#include "mpi.h" +#include "lam/lfc/list.h" + + +extern lam_class_info_t lam_request_cls; + +typedef enum { + LAM_REQUEST_PML, + LAM_REQUEST_IO, + LAM_REQUEST_GEN, + LAM_REQUEST_MAX +} lam_request_type_t; + +struct lam_request_t { + lam_dbl_item_t super; + lam_request_type_t req_type; +}; +typedef struct lam_request_t lam_request_t; + +void lam_request_init(lam_request_t*); +void lam_request_destroy(lam_request_t*); + +#endif +