From 4fb95e5edfefc4131eb314f6b16e3172bbbd7215 Mon Sep 17 00:00:00 2001 From: Tim Woodall Date: Wed, 14 Jan 2004 15:57:54 +0000 Subject: [PATCH] reorg - filling in stubs This commit was SVN r372. --- src/mca/mpi/pml/pml.h | 7 +- src/mca/mpi/pml/teg/src/Makefile.am | 1 + src/mca/mpi/pml/teg/src/pml_teg.c | 81 +++++----------------- src/mca/mpi/pml/teg/src/pml_teg.h | 10 +-- src/mca/mpi/pml/teg/src/pml_teg_module.c | 72 +++++++++++++++++++ src/mca/mpi/pml/teg/src/pml_teg_progress.c | 15 +++- src/mca/mpi/ptl/base/Makefile.am | 2 + src/mca/mpi/ptl/base/ptl_base_comm.c | 14 ++++ src/mca/mpi/ptl/base/ptl_base_comm.h | 3 + 9 files changed, 128 insertions(+), 77 deletions(-) create mode 100644 src/mca/mpi/pml/teg/src/pml_teg_module.c create mode 100644 src/mca/mpi/ptl/base/ptl_base_comm.c diff --git a/src/mca/mpi/pml/pml.h b/src/mca/mpi/pml/pml.h index 5c60c4701f..369062b1a8 100644 --- a/src/mca/mpi/pml/pml.h +++ b/src/mca/mpi/pml/pml.h @@ -28,11 +28,6 @@ typedef enum { MCA_PML_BASE_SEND_READY } mca_pml_base_send_mode_t; - -struct mca_pml_base_status_t { -}; -typedef struct mca_pml_base_status_t mca_pml_base_status_t; - #define LAM_ANY_TAG MPI_ANY_TAG /** @@ -128,7 +123,7 @@ typedef int (*mca_pml_base_test_fn_t)( typedef int (*mca_pml_base_wait_fn_t)( lam_request_t* request, - mca_pml_base_status_t* status + lam_status_public_t* status ); diff --git a/src/mca/mpi/pml/teg/src/Makefile.am b/src/mca/mpi/pml/teg/src/Makefile.am index 4616eed29f..3111f40680 100644 --- a/src/mca/mpi/pml/teg/src/Makefile.am +++ b/src/mca/mpi/pml/teg/src/Makefile.am @@ -16,6 +16,7 @@ libmca_pml_teg_la_SOURCES = \ pml_teg.h \ pml_teg_comm.h \ pml_teg_isend.c \ + pml_teg_module.c \ pml_teg_proc.c \ pml_teg_proc.h \ pml_teg_progress.c \ diff --git a/src/mca/mpi/pml/teg/src/pml_teg.c b/src/mca/mpi/pml/teg/src/pml_teg.c index 6e98b54a84..5b8ed07e1e 100644 --- a/src/mca/mpi/pml/teg/src/pml_teg.c +++ b/src/mca/mpi/pml/teg/src/pml_teg.c @@ -1,45 +1,12 @@ #include "lam/util/malloc.h" #include "mca/mpi/pml/pml.h" #include "mca/mpi/ptl/ptl.h" +#include "mca/mpi/ptl/base/ptl_base_comm.h" #include "mca/mpi/ptl/base/ptl_base_sendreq.h" #include "mca/mpi/ptl/base/ptl_base_recvreq.h" #include "pml_teg.h" #include "pml_teg_proc.h" -#define mca_pml_teg_param_register_int(n,v) \ - mca_base_param_lookup_int( \ - mca_base_param_register_int("pml","teg",n,0,v)) - - -mca_pml_base_module_1_0_0_t mca_pml_teg_module = { - /* First, the mca_base_module_t struct containing meta information - about the module itself */ - - { - /* Indicate that we are a pml v1.0.0 module (which also implies a - specific MCA version) */ - - MCA_PML_BASE_VERSION_1_0_0, - - "teg", /* MCA module name */ - 1, /* MCA module major version */ - 0, /* MCA module minor version */ - 0, /* MCA module release version */ - mca_pml_teg_open, /* module open */ - mca_pml_teg_close /* module close */ - }, - - /* Next the MCA v1.0.0 module meta data */ - - { - /* Whether the module is checkpointable or not */ - - false - }, - - mca_pml_teg_init /* module init */ -}; - mca_pml_teg_t mca_pml_teg = { { @@ -60,32 +27,21 @@ mca_pml_teg_t mca_pml_teg = { } }; -/** - * some comment - * - * @param foo description - * @return - * - * long description - */ -int mca_pml_teg_open(void) +int mca_pml_teg_add_comm(lam_communicator_t* comm) { + /* allocate pml specific comm data */ + struct mca_pml_comm_t* pml_comm = (mca_pml_comm_t*)LAM_MALLOC(sizeof(mca_pml_comm_t)); + mca_pml_ptl_comm_init(pml_comm); + comm->c_pml_comm = pml_comm; return LAM_SUCCESS; } - -mca_pml_t* mca_pml_teg_init(int* priority, int* min_thread, int* max_thread) +int mca_pml_teg_del_comm(lam_communicator_t* comm) { - *priority = 0; - *min_thread = 0; - *max_thread = 0; - mca_pml_teg.teg_ptls = 0; - mca_pml_teg.teg_num_ptls = 0; - lam_list_init(&mca_pml_teg.teg_pending_acks); - lam_list_init(&mca_pml_teg.teg_incomplete_sends); - lam_mutex_init(&mca_pml_teg.teg_lock); - return &mca_pml_teg.super; + LAM_FREE(comm->c_pml_comm); + comm->c_pml_comm = 0; + return LAM_SUCCESS; } int mca_pml_teg_add_ptls(struct mca_ptl_t** ptls, size_t nptls) @@ -95,16 +51,6 @@ int mca_pml_teg_add_ptls(struct mca_ptl_t** ptls, size_t nptls) return LAM_SUCCESS; } -int mca_pml_teg_add_comm(lam_communicator_t* comm) -{ - return LAM_SUCCESS; -} - -int mca_pml_teg_del_comm(lam_communicator_t* comm) -{ - return LAM_SUCCESS; -} - int mca_pml_teg_add_procs(lam_proc_t** procs, size_t nprocs) { size_t i; @@ -112,9 +58,11 @@ int mca_pml_teg_add_procs(lam_proc_t** procs, size_t nprocs) for(i=0; iproc_pml == 0) { + /* allocate pml specific proc data */ mca_pml_proc_t* proc_pml = (mca_pml_proc_t*)LAM_MALLOC(sizeof(mca_pml_proc_t)); mca_pml_teg_proc_init(proc_pml); + /* preallocate space in array for max number of ptls */ mca_ptl_array_reserve(&proc_pml->proc_ptl_first, mca_pml_teg.teg_num_ptls); mca_ptl_array_reserve(&proc_pml->proc_ptl_first, mca_pml_teg.teg_num_ptls); @@ -131,3 +79,8 @@ int mca_pml_teg_add_procs(lam_proc_t** procs, size_t nprocs) return LAM_SUCCESS; } +int mca_pml_teg_module_fini(void) +{ + return LAM_SUCCESS; +} + diff --git a/src/mca/mpi/pml/teg/src/pml_teg.h b/src/mca/mpi/pml/teg/src/pml_teg.h index be0cdf21ae..e35ffc177f 100644 --- a/src/mca/mpi/pml/teg/src/pml_teg.h +++ b/src/mca/mpi/pml/teg/src/pml_teg.h @@ -31,7 +31,6 @@ struct mca_pml_teg_t { size_t teg_num_ptls; lam_list_t teg_incomplete_sends; - lam_list_t teg_pending_acks; lam_mutex_t teg_lock; }; typedef struct mca_pml_teg_t mca_pml_teg_t; @@ -46,16 +45,17 @@ extern mca_pml_teg_t mca_pml_teg; extern mca_pml_base_module_1_0_0_t mca_pml_teg_module_1_0_0_0; -extern int mca_pml_teg_open(void); -extern int mca_pml_teg_close(void); +extern int mca_pml_teg_module_open(void); +extern int mca_pml_teg_module_close(void); -extern mca_pml_t* mca_pml_teg_init( +extern mca_pml_t* mca_pml_teg_module_init( int *priority, int *max_tag, int *max_cid ); + /* * PML interface functions. */ @@ -143,7 +143,7 @@ extern int mca_pml_teg_test( extern int mca_pml_teg_wait( lam_request_t* request, - mca_pml_base_status_t* status + lam_status_public_t* status ); diff --git a/src/mca/mpi/pml/teg/src/pml_teg_module.c b/src/mca/mpi/pml/teg/src/pml_teg_module.c new file mode 100644 index 0000000000..d85a51ff64 --- /dev/null +++ b/src/mca/mpi/pml/teg/src/pml_teg_module.c @@ -0,0 +1,72 @@ +#include "mpi.h" +#include "lam/util/malloc.h" +#include "mca/mpi/pml/pml.h" +#include "mca/mpi/ptl/ptl.h" +#include "mca/mpi/ptl/base/ptl_base_sendreq.h" +#include "mca/mpi/ptl/base/ptl_base_recvreq.h" +#include "pml_teg.h" +#include "pml_teg_proc.h" + +#define mca_pml_teg_param_register_int(n,v) \ + mca_base_param_lookup_int( \ + mca_base_param_register_int("pml","teg",n,0,v)) + + +mca_pml_base_module_1_0_0_t mca_pml_teg_module = { + /* First, the mca_base_module_t struct containing meta information + about the module itself */ + + { + /* Indicate that we are a pml v1.0.0 module (which also implies a + specific MCA version) */ + + MCA_PML_BASE_VERSION_1_0_0, + + "teg", /* MCA module name */ + 1, /* MCA module major version */ + 0, /* MCA module minor version */ + 0, /* MCA module release version */ + mca_pml_teg_module_open, /* module open */ + mca_pml_teg_module_close /* module close */ + }, + + /* Next the MCA v1.0.0 module meta data */ + + { + /* Whether the module is checkpointable or not */ + + false + }, + + mca_pml_teg_module_init /* module init */ +}; + + +int mca_pml_teg_module_open(void) +{ + return LAM_SUCCESS; +} + + +int mca_pml_teg_module_close(void) +{ + return LAM_SUCCESS; +} + + +mca_pml_t* mca_pml_teg_module_init(int* priority, int* min_thread, int* max_thread) +{ + *priority = 0; + *min_thread = MPI_THREAD_SINGLE; + *max_thread = MPI_THREAD_MULTIPLE; + + mca_pml_teg.teg_ptl_modules = 0; + mca_pml_teg.teg_num_ptl_modules = 0; + mca_pml_teg.teg_ptls = 0; + mca_pml_teg.teg_num_ptls = 0; + + lam_list_init(&mca_pml_teg.teg_incomplete_sends); + lam_mutex_init(&mca_pml_teg.teg_lock); + return &mca_pml_teg.super; +} + diff --git a/src/mca/mpi/pml/teg/src/pml_teg_progress.c b/src/mca/mpi/pml/teg/src/pml_teg_progress.c index 7625ed1e75..2ad95b0718 100644 --- a/src/mca/mpi/pml/teg/src/pml_teg_progress.c +++ b/src/mca/mpi/pml/teg/src/pml_teg_progress.c @@ -4,6 +4,18 @@ int mca_pml_teg_progress(void) { + mca_ptl_base_tstamp_t tstamp; + size_t i; + + /* + * Progress each of the PTL modules + */ + for(i=0; iptlm_progress(tstamp); + + /* + * Complete any pending send requests. + */ THREAD_LOCK(&mca_pml_teg.teg_lock); mca_ptl_base_send_request_t* req; for(req = (mca_ptl_base_send_request_t*)lam_list_get_first(&mca_pml_teg.teg_incomplete_sends); @@ -13,8 +25,7 @@ int mca_pml_teg_progress(void) bool complete; int rc = mca_pml_teg_send_request_schedule(req, &complete); if(rc != LAM_SUCCESS) { - THREAD_UNLOCK(&mca_pml_teg.teg_lock); - return rc; + continue; } if(complete) { req = (mca_ptl_base_send_request_t*)lam_list_remove( diff --git a/src/mca/mpi/ptl/base/Makefile.am b/src/mca/mpi/ptl/base/Makefile.am index dd587887f0..5268a6cdb7 100644 --- a/src/mca/mpi/ptl/base/Makefile.am +++ b/src/mca/mpi/ptl/base/Makefile.am @@ -9,6 +9,7 @@ noinst_LTLIBRARIES = libmca_mpi_ptl_base.la # Source code files headers = \ + ptl_base_comm.h \ ptl_base_fragment.h \ ptl_base_header.h \ ptl_base_match.h \ @@ -18,6 +19,7 @@ headers = \ libmca_mpi_ptl_base_la_SOURCES = \ $(headers) \ + ptl_base_comm.c \ ptl_base_fragment.c \ ptl_base_match.c \ ptl_base_recvfrag.c \ diff --git a/src/mca/mpi/ptl/base/ptl_base_comm.c b/src/mca/mpi/ptl/base/ptl_base_comm.c new file mode 100644 index 0000000000..279670a6c4 --- /dev/null +++ b/src/mca/mpi/ptl/base/ptl_base_comm.c @@ -0,0 +1,14 @@ +#include "ptl_base_comm.h" + + +void mca_pml_ptl_comm_init(mca_pml_comm_t* comm) +{ + +} + + +void mca_pml_ptl_comm_destroy(mca_pml_comm_t* comm) +{ + +} + diff --git a/src/mca/mpi/ptl/base/ptl_base_comm.h b/src/mca/mpi/ptl/base/ptl_base_comm.h index 8552314c6d..4979409e2d 100644 --- a/src/mca/mpi/ptl/base/ptl_base_comm.h +++ b/src/mca/mpi/ptl/base/ptl_base_comm.h @@ -43,5 +43,8 @@ struct mca_pml_comm_t { typedef struct mca_pml_comm_t mca_pml_comm_t; +extern void mca_pml_ptl_comm_init(struct mca_pml_comm_t*); +extern void mca_pml_ptl_comm_destroy(struct mca_pml_comm_t*); + #endif