From 55a8a7b3d8d68fcd007758ebc1b9b1bbeff0be9e Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Tue, 10 Aug 2004 23:36:59 +0000 Subject: [PATCH] Move all files in the main self directory. Should lead to a faster compilation. This commit was SVN r2031. --- src/mca/ptl/self/Makefile.am | 12 +- src/mca/ptl/self/configure.params | 6 +- src/mca/ptl/self/src/Makefile.am | 12 -- src/mca/ptl/self/src/ptl_self.c | 194 ---------------------- src/mca/ptl/self/src/ptl_self.h | 86 ---------- src/mca/ptl/self/src/ptl_self_component.c | 163 ------------------ src/mca/ptl/self/src/self_config.h | 0 7 files changed, 9 insertions(+), 464 deletions(-) delete mode 100644 src/mca/ptl/self/src/Makefile.am delete mode 100644 src/mca/ptl/self/src/ptl_self.c delete mode 100644 src/mca/ptl/self/src/ptl_self.h delete mode 100644 src/mca/ptl/self/src/ptl_self_component.c delete mode 100644 src/mca/ptl/self/src/self_config.h diff --git a/src/mca/ptl/self/Makefile.am b/src/mca/ptl/self/Makefile.am index b1fbb14dc0..9c960d75f6 100644 --- a/src/mca/ptl/self/Makefile.am +++ b/src/mca/ptl/self/Makefile.am @@ -6,8 +6,6 @@ include $(top_ompi_srcdir)/config/Makefile.options -SUBDIRS = src - # Make the output library in this directory, and name it either # mca__.la (for DSO builds) or libmca__.la # (for static builds). @@ -20,13 +18,15 @@ component_noinst = libmca_ptl_self.la component_install = endif +self_SOURCES = ptl_self.c ptl_self.h ptl_self_component.c + mcacomponentdir = $(libdir)/openmpi mcacomponent_LTLIBRARIES = $(component_install) -mca_ptl_self_la_SOURCES = -mca_ptl_self_la_LIBADD = src/libmca_ptl_self.la +mca_ptl_self_la_SOURCES = $(self_SOURCES) +mca_ptl_self_la_LIBADD = mca_ptl_self_la_LDFLAGS = -module -avoid-version noinst_LTLIBRARIES = $(component_noinst) -libmca_ptl_self_la_SOURCES = -libmca_ptl_self_la_LIBADD = src/libmca_ptl_self.la +libmca_ptl_self_la_SOURCES = $(self_SOURCES) +libmca_ptl_self_la_LIBADD = libmca_ptl_self_la_LDFLAGS = -module -avoid-version diff --git a/src/mca/ptl/self/configure.params b/src/mca/ptl/self/configure.params index 30d4d08203..2508949e28 100644 --- a/src/mca/ptl/self/configure.params +++ b/src/mca/ptl/self/configure.params @@ -5,6 +5,6 @@ # Specific to this module -PARAM_INIT_FILE=src/ptl_self.c -PARAM_CONFIG_HEADER_FILE="src/self_config.h" -PARAM_CONFIG_FILES="Makefile src/Makefile" +PARAM_INIT_FILE=ptl_self.c +PARAM_CONFIG_HEADER_FILE="self_config.h" +PARAM_CONFIG_FILES="Makefile" diff --git a/src/mca/ptl/self/src/Makefile.am b/src/mca/ptl/self/src/Makefile.am deleted file mode 100644 index 8919676268..0000000000 --- a/src/mca/ptl/self/src/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -# -*- makefile -*- -# -# $HEADER$ -# - -include $(top_ompi_srcdir)/config/Makefile.options - -noinst_LTLIBRARIES = libmca_ptl_self.la -libmca_ptl_self_la_SOURCES = \ - ptl_self.c \ - ptl_self.h \ - ptl_self_component.c diff --git a/src/mca/ptl/self/src/ptl_self.c b/src/mca/ptl/self/src/ptl_self.c deleted file mode 100644 index 313ddca924..0000000000 --- a/src/mca/ptl/self/src/ptl_self.c +++ /dev/null @@ -1,194 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * $HEADER$ - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "include/constants.h" -#include "event/event.h" -#include "util/argv.h" -#include "util/output.h" -#include "mca/pml/pml.h" -#include "mca/ptl/ptl.h" -#include "mca/pml/base/pml_base_sendreq.h" -#include "mca/ptl/base/ptl_base_sendfrag.h" -#include "mca/ptl/base/ptl_base_recvfrag.h" -#include "mca/base/mca_base_param.h" -#include "ptl_self.h" - -mca_ptl_base_module_t mca_ptl_self_module = { - &mca_ptl_self_component.super, - 8, /* ptl_cache_size */ - sizeof(mca_ptl_base_recv_frag_t), /* ptl_cache_bytes */ - 0, /* ptl_frag_first_size */ - 0, /* ptl_frag_min_size */ - 0, /* ptl_frag_max_size */ - 65535, /* ptl_exclusivity */ - 0, /* ptl_latency */ - 0, /* ptl_bandwidth */ - MCA_PTL_PUT, /* ptl flags */ - mca_ptl_self_add_proc, - mca_ptl_self_del_proc, - mca_ptl_self_finalize, - mca_ptl_self_send, /* put */ - mca_ptl_self_send, /* put */ - NULL, /* get */ - mca_ptl_self_matched, /* matched */ - mca_ptl_self_request_init, - mca_ptl_self_request_fini, - NULL, /* match */ - NULL, - NULL -}; - -extern mca_ptl_self_component_t mca_ptl_self_component; - - -int mca_ptl_self_add_proc(struct mca_ptl_base_module_t* ptl, size_t nprocs, struct ompi_proc_t **ompi_proc, struct mca_ptl_base_peer_t** peer_ret, ompi_bitmap_t* reachable) -{ - int i, count; - - mca_ptl_self_component.self_local = ompi_proc_local(); - - for( i = 0, count = 0; i < nprocs; i++ ) { - if( ompi_proc[i] == mca_ptl_self_component.self_local ) { - ompi_bitmap_set_bit( reachable, i ); - count++; - } - } - return OMPI_SUCCESS; -} - -int mca_ptl_self_del_proc(struct mca_ptl_base_module_t* ptl, size_t nprocs, struct ompi_proc_t **proc, struct mca_ptl_base_peer_t** ptl_peer) -{ - return OMPI_SUCCESS; -} - -/* before the module is unloaded (called once)*/ -int mca_ptl_self_finalize(struct mca_ptl_base_module_t* ptl) -{ - return OMPI_SUCCESS; -} - -int mca_ptl_self_request_init(struct mca_ptl_base_module_t* ptl, mca_pml_base_send_request_t* request) -{ - OBJ_CONSTRUCT(request+1, mca_ptl_base_recv_frag_t); - return OMPI_SUCCESS; -} - -void mca_ptl_self_request_fini(struct mca_ptl_base_module_t* ptl, mca_pml_base_send_request_t* request) -{ - OBJ_DESTRUCT(request+1); -} - -/* - * Initiate a send. If this is the first fragment, use the fragment - * descriptor allocated with the send requests, otherwise obtain - * one from the free list. Initialize the fragment and foward - * on to the peer. - */ - -int mca_ptl_self_send( - struct mca_ptl_base_module_t* ptl, - struct mca_ptl_base_peer_t* ptl_base_peer, - struct mca_pml_base_send_request_t* request, - size_t offset, - size_t size, - int flags ) -{ - mca_ptl_self_send_request_t* req = (mca_ptl_self_send_request_t*)request; - mca_ptl_base_header_t* hdr = &(req->req_frag.frag_base.frag_header); - - hdr->hdr_common.hdr_type = MCA_PTL_HDR_TYPE_MATCH; - hdr->hdr_common.hdr_flags = flags; - hdr->hdr_common.hdr_size = sizeof(mca_ptl_base_match_header_t); - hdr->hdr_frag.hdr_frag_offset = offset; - hdr->hdr_frag.hdr_frag_seq = 0; - hdr->hdr_match.hdr_contextid = request->req_base.req_comm->c_contextid; - hdr->hdr_match.hdr_src = request->req_base.req_comm->c_my_rank; - hdr->hdr_match.hdr_dst = request->req_base.req_peer; - hdr->hdr_match.hdr_tag = request->req_base.req_tag; - hdr->hdr_match.hdr_msg_length = request->req_bytes_packed; - hdr->hdr_match.hdr_msg_seq = request->req_base.req_sequence; - hdr->hdr_frag.hdr_frag_length = request->req_bytes_packed; - hdr->hdr_frag.hdr_frag_offset = 0 ; - hdr->hdr_frag.hdr_src_ptr.pval = (void*)req; - req->req_frag.frag_base.frag_peer = ptl_base_peer; - req->req_frag.frag_base.frag_size = request->req_bytes_packed; - req->req_frag.frag_base.frag_owner = &mca_ptl_self_module; - req->req_frag.frag_request = NULL; - req->req_frag.frag_is_buffered = 0; - ptl->ptl_match( ptl, &(req->req_frag), &(hdr->hdr_match) ); - return OMPI_SUCCESS; -} - - -/* - * A posted receive has been matched - if required send an - * ack back to the peer and process the fragment. - */ -void mca_ptl_self_matched( mca_ptl_base_module_t* ptl, - mca_ptl_base_recv_frag_t* frag) -{ - mca_ptl_self_send_request_t* sendreq = (mca_ptl_self_send_request_t*) - frag->frag_base.frag_header.hdr_frag.hdr_src_ptr.pval; - mca_pml_base_recv_request_t* recvreq = frag->frag_request; - - /* Did you have the same datatype or not ? If yes we can use an optimized version - * for the copy function, if not we have to use a temporary buffer to pack/unpack - * - * Note that if this is a buffered send - the data has already been packed into - * a contigous buffer and the convertor on the send request initialized to point - * into this buffer. - */ - if( sendreq->req_send.req_base.req_datatype == recvreq->req_base.req_datatype && - sendreq->req_send.req_send_mode != MCA_PML_BASE_SEND_BUFFERED) { - ompi_ddt_copy_content_same_ddt( - recvreq->req_base.req_datatype, - recvreq->req_base.req_count, - recvreq->req_base.req_addr, - sendreq->req_send.req_base.req_addr ); - } else { - ompi_convertor_t *pSendConvertor, *pRecvConvertor; - struct iovec iov[1]; - int completed, iov_count, length; - char* buf; - - /* We use a temporary buffer as it look to be faster on much architectures */ - length = 64 * 1024; - buf = malloc( length * sizeof(char) ); - - ompi_convertor_init_for_recv( - &frag->frag_base.frag_convertor, - 0, - recvreq->req_base.req_datatype, - recvreq->req_base.req_count, - recvreq->req_base.req_addr, 0 ); - pSendConvertor = &(sendreq->req_send.req_convertor); - pRecvConvertor = &(frag->frag_base.frag_convertor); - completed = 0; - while( !completed ) { - iov[0].iov_base = buf; - iov[0].iov_len = length; - iov_count = 1; - completed |= ompi_convertor_pack( pSendConvertor, iov, iov_count ); - /*assert( freeAfter == 0 );*/ - completed |= ompi_convertor_unpack( pRecvConvertor, iov, iov_count ); - /*assert( freeAfter == 0 );*/ - } - free( buf ); - } - ptl->ptl_send_progress( ptl, &sendreq->req_send, sendreq->req_send.req_bytes_packed ); - ptl->ptl_recv_progress( ptl, - recvreq, - frag->frag_base.frag_header.hdr_frag.hdr_frag_length, - frag->frag_base.frag_size ); -} - diff --git a/src/mca/ptl/self/src/ptl_self.h b/src/mca/ptl/self/src/ptl_self.h deleted file mode 100644 index 20478cbecf..0000000000 --- a/src/mca/ptl/self/src/ptl_self.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - *$HEADER$ - */ -/** - * @file - */ - -#ifndef PTL_SELF_H_HAS_BEEN_INCLUDED -#define PTL_SELF_H_HAS_BEEN_INCLUDED - -#include "class/ompi_free_list.h" -#include "event/event.h" -#include "mca/pml/pml.h" -#include "mca/ptl/ptl.h" -#include "mca/pml/base/pml_base_sendreq.h" -#include "mca/pml/base/pml_base_recvreq.h" -#include "mca/ptl/base/ptl_base_recvfrag.h" - -/** - * SELF PTL component. - */ -struct mca_ptl_self_component_t { - mca_ptl_base_component_1_0_0_t super; /**< base PTL component */ - struct mca_ptl_base_module_t** self_ptl_modules; /**< array of available PTL modules */ - u_int32_t self_num_ptl_modules; /**< number of ptl modules actually used */ - u_int32_t self_max_ptl_modules; /**< maximum number of ptl modules */ - u_int32_t self_buf_size; /**< the size of the internal buffer used to pack/unpack the data */ - u_int32_t self_is_non_blocking; /**< how the memcopy operations are done segmented or not */ - int32_t self_free_list_num; /**< initial size of free lists */ - int32_t self_free_list_max; /**< maximum size of free lists */ - int32_t self_free_list_inc; /**< number of elements to alloc when growing free lists */ - ompi_free_list_t self_send_requests; /**< free list of self send requests -- sendreq + sendfrag */ - ompi_proc_t* self_local; /**< the self proc instance corresponding to the local process */ -}; -typedef struct mca_ptl_self_component_t mca_ptl_self_component_t; - -/** - * Self send request derived type. The send request contains both the - * base send request, and the base receive fragment which will be used to do the match. - */ -struct mca_ptl_self_send_request_t { - mca_pml_base_send_request_t req_send; - mca_ptl_base_recv_frag_t req_frag; /* first fragment */ -}; -typedef struct mca_ptl_self_send_request_t mca_ptl_self_send_request_t; -OBJ_CLASS_DECLARATION(mca_ptl_self_send_request_t); - -extern mca_ptl_self_component_t mca_ptl_self_component; - -/** - * Register SELF component parameters with the MCA framework - */ -extern int mca_ptl_self_component_open(void); - -/** - * Any final cleanup before being unloaded. - */ -extern int mca_ptl_self_component_close(void); - -/** - * SELF component initialization. - * - * @param num_ptls (OUT) Number of PTLs returned in PTL array. - * @param allow_multi_user_threads (OUT) Flag indicating wether PTL supports user threads (TRUE) - * @param have_hidden_threads (OUT) Flag indicating wether PTL uses threads (TRUE) - * - * (1) prepare the local buffering and initialize the SELF - * engine. - */ -extern mca_ptl_base_module_t** mca_ptl_self_component_init( - int *num_ptls, - bool *allow_multi_user_threads, - bool *have_hidden_threads -); - -int mca_ptl_self_add_proc(struct mca_ptl_base_module_t* ptl, size_t nprocs, struct ompi_proc_t **ompi_proc, struct mca_ptl_base_peer_t** peer_ret, ompi_bitmap_t* reachable); -int mca_ptl_self_del_proc(struct mca_ptl_base_module_t* ptl, size_t nprocs, struct ompi_proc_t **proc, struct mca_ptl_base_peer_t** ptl_peer); -int mca_ptl_self_finalize(struct mca_ptl_base_module_t* ptl); -int mca_ptl_self_request_init(struct mca_ptl_base_module_t* ptl, struct mca_pml_base_send_request_t* request); -void mca_ptl_self_request_fini(struct mca_ptl_base_module_t* ptl, struct mca_pml_base_send_request_t* request); -int mca_ptl_self_send( struct mca_ptl_base_module_t* ptl, struct mca_ptl_base_peer_t* ptl_base_peer, struct mca_pml_base_send_request_t* request, - size_t offset, size_t size, int flags ); -void mca_ptl_self_matched( mca_ptl_base_module_t* ptl, mca_ptl_base_recv_frag_t* frag ); - -#endif /* PTL_SELF_H_HAS_BEEN_INCLUDED */ - diff --git a/src/mca/ptl/self/src/ptl_self_component.c b/src/mca/ptl/self/src/ptl_self_component.c deleted file mode 100644 index 8c577cde99..0000000000 --- a/src/mca/ptl/self/src/ptl_self_component.c +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * $HEADER$ - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "include/constants.h" -#include "event/event.h" -#include "util/if.h" -#include "util/argv.h" -#include "util/output.h" -#include "mca/pml/pml.h" -#include "mca/ptl/ptl.h" -#include "mca/pml/base/pml_base_sendreq.h" -#include "mca/ptl/base/ptl_base_recvfrag.h" -#include "mca/base/mca_base_param.h" -#include "mca/base/mca_base_module_exchange.h" -#include "ptl_self.h" - -mca_ptl_self_component_t mca_ptl_self_component = { - { - /* First, the mca_base_component_t struct containing meta information - about the component itself */ - - { - /* Indicate that we are a pml v1.0.0 component (which also implies a - specific MCA version) */ - - MCA_PTL_BASE_VERSION_1_0_0, - - "self", /* MCA component name */ - 1, /* MCA component major version */ - 0, /* MCA component minor version */ - 0, /* MCA component release version */ - mca_ptl_self_component_open, /* component open */ - mca_ptl_self_component_close /* component close */ - }, - - /* Next the MCA v1.0.0 component meta data */ - - { - /* Whether the component is checkpointable or not */ - true - }, - - mca_ptl_self_component_init, - NULL, - NULL, - } -}; - -extern mca_ptl_base_module_t mca_ptl_self_module; - - -static void mca_ptl_self_send_request_construct(mca_ptl_self_send_request_t* request) -{ - OBJ_CONSTRUCT(&request->req_frag, mca_ptl_base_recv_frag_t); -} - -static void mca_ptl_self_send_request_destruct(mca_ptl_self_send_request_t* request) -{ - OBJ_DESTRUCT(&request->req_frag); -} - -OBJ_CLASS_INSTANCE( mca_ptl_self_send_request_t, - mca_pml_base_send_request_t, - mca_ptl_self_send_request_construct, - mca_ptl_self_send_request_destruct ); - -/* - * utility routines for parameter registration - */ - -static inline int mca_ptl_self_param_register_int( - const char* param_name, - int default_value ) -{ - int id = mca_base_param_register_int("ptl","self",param_name,NULL,default_value); - int param_value = default_value; - mca_base_param_lookup_int(id,¶m_value); - return param_value; -} - -/* - * Called by MCA framework to open the component, registers - * component parameters. - */ - -int mca_ptl_self_component_open(void) -{ - /* initialize state */ - mca_ptl_self_component.self_ptl_modules = NULL; - mca_ptl_self_component.self_num_ptl_modules = 0; - - /* initialize objects */ - - /* register SELF component parameters */ - mca_ptl_self_component.self_buf_size = - mca_ptl_self_param_register_int("buffer_size", 64*1024); - mca_ptl_self_component.self_is_non_blocking = - mca_ptl_self_param_register_int("nonblocking", 1); - return OMPI_SUCCESS; -} - -int mca_ptl_self_component_close(void) -{ - if (mca_ptl_self_component.self_send_requests.fl_num_allocated != - mca_ptl_self_component.self_send_requests.super.ompi_list_length) { - ompi_output(0, "self send requests: %d allocated %d returned\n", - mca_ptl_self_component.self_send_requests.fl_num_allocated, - mca_ptl_self_component.self_send_requests.super.ompi_list_length); - } - -#if 0 - /* JMS debug */ - if (NULL != mca_ptl_self_component.self_ptl_modules) { - free(mca_ptl_self_component.self_ptl_modules); - mca_ptl_self_component.self_ptl_modules = NULL; - OBJ_DESTRUCT( &(mca_ptl_self_component.self_send_requests) ); - } - mca_ptl_self_component.self_num_ptl_modules = 0; -#endif - return OMPI_SUCCESS; -} - - -mca_ptl_base_module_t** mca_ptl_self_component_init(int *num_ptl_modules, - bool *allow_multi_user_threads, - bool *have_hidden_threads) -{ - *num_ptl_modules = 0; - *allow_multi_user_threads = true; - *have_hidden_threads = false; - - mca_ptl_self_component.self_ptl_modules = malloc(sizeof(mca_ptl_base_module_t*)); - if( NULL == mca_ptl_self_component.self_ptl_modules ) - return NULL; - mca_ptl_self_component.self_ptl_modules[0] = &mca_ptl_self_module; - mca_ptl_self_component.self_num_ptl_modules = 1; - mca_ptl_self_component.self_max_ptl_modules = 1; - mca_ptl_self_component.self_free_list_num = 4; - mca_ptl_self_component.self_free_list_max = -1; - mca_ptl_self_component.self_free_list_inc = 4; - *num_ptl_modules = 1; - - OBJ_CONSTRUCT(&mca_ptl_self_component.self_send_requests, ompi_free_list_t); - ompi_free_list_init(&mca_ptl_self_component.self_send_requests, - sizeof(mca_ptl_self_send_request_t), - OBJ_CLASS(mca_ptl_self_send_request_t), - mca_ptl_self_component.self_free_list_num, - mca_ptl_self_component.self_free_list_max, - mca_ptl_self_component.self_free_list_inc, - NULL); /* use default allocator */ - - return mca_ptl_self_component.self_ptl_modules; -} diff --git a/src/mca/ptl/self/src/self_config.h b/src/mca/ptl/self/src/self_config.h deleted file mode 100644 index e69de29bb2..0000000000