From e47106e378fa1cbb1240fd855281c8ed5f6364c0 Mon Sep 17 00:00:00 2001 From: Tim Woodall Date: Wed, 28 Jan 2004 23:47:02 +0000 Subject: [PATCH] unimplemented routines This commit was SVN r562. --- src/mca/mpi/pml/teg/src/pml_teg.c | 10 ++-- src/mca/mpi/pml/teg/src/pml_teg_irecv.c | 6 +- src/mca/mpi/pml/teg/src/pml_teg_start.c | 4 +- src/mca/mpi/ptl/base/ptl_base_comm.c | 77 ++++++++++++++++++++++++- src/mca/mpi/ptl/base/ptl_base_comm.h | 8 ++- 5 files changed, 87 insertions(+), 18 deletions(-) diff --git a/src/mca/mpi/pml/teg/src/pml_teg.c b/src/mca/mpi/pml/teg/src/pml_teg.c index c416b1e90e..a0487b54f9 100644 --- a/src/mca/mpi/pml/teg/src/pml_teg.c +++ b/src/mca/mpi/pml/teg/src/pml_teg.c @@ -35,20 +35,18 @@ mca_pml_teg_t mca_pml_teg = { 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)); - if (0 == pml_comm) { + mca_pml_comm_t* pml_comm = OBJ_CREATE(mca_pml_comm_t, &mca_pml_ptl_comm_cls); + if (NULL == pml_comm) { return LAM_ERR_OUT_OF_RESOURCE; } -#if TIM_HASNT_IMPLEMENTED_THIS_YET - mca_pml_ptl_comm_init(pml_comm, comm->c_remote_group->g_proc_count); -#endif + mca_pml_ptl_comm_init_size(pml_comm, comm->c_remote_group->g_proc_count); comm->c_pml_comm = pml_comm; return LAM_SUCCESS; } int mca_pml_teg_del_comm(lam_communicator_t* comm) { - LAM_FREE(comm->c_pml_comm); + OBJ_RELEASE(comm->c_pml_comm); comm->c_pml_comm = 0; return LAM_SUCCESS; } diff --git a/src/mca/mpi/pml/teg/src/pml_teg_irecv.c b/src/mca/mpi/pml/teg/src/pml_teg_irecv.c index db48c90909..3ec17cc67e 100644 --- a/src/mca/mpi/pml/teg/src/pml_teg_irecv.c +++ b/src/mca/mpi/pml/teg/src/pml_teg_irecv.c @@ -9,8 +9,7 @@ int mca_pml_teg_irecv_init( int tag, bool persistent, struct lam_communicator_t* comm, - struct lam_request_t **request -) + struct lam_request_t **request) { return LAM_ERROR; } @@ -22,8 +21,7 @@ int mca_pml_teg_irecv( int src, int tag, struct lam_communicator_t* comm, - struct lam_request_t **request -) + struct lam_request_t **request) { return LAM_ERROR; } diff --git a/src/mca/mpi/pml/teg/src/pml_teg_start.c b/src/mca/mpi/pml/teg/src/pml_teg_start.c index b1947a7470..17928ec630 100644 --- a/src/mca/mpi/pml/teg/src/pml_teg_start.c +++ b/src/mca/mpi/pml/teg/src/pml_teg_start.c @@ -1,8 +1,8 @@ #include "pml_teg.h" + int mca_pml_teg_start( - lam_request_t* request -) + lam_request_t* request) { return LAM_ERROR; } diff --git a/src/mca/mpi/ptl/base/ptl_base_comm.c b/src/mca/mpi/ptl/base/ptl_base_comm.c index 91091253d0..7ae1dad04d 100644 --- a/src/mca/mpi/ptl/base/ptl_base_comm.c +++ b/src/mca/mpi/ptl/base/ptl_base_comm.c @@ -1,12 +1,83 @@ #include "ptl_base_comm.h" - -void mca_pml_ptl_comm_init(mca_pml_comm_t* comm, size_t size) + +lam_class_info_t mca_pml_ptl_comm_cls = { + "mca_pml_comm_t", + &lam_object_cls, + (class_init_t)mca_pml_ptl_comm_init, + (class_destroy_t)mca_pml_ptl_comm_destroy +}; + +void mca_pml_ptl_comm_init(mca_pml_comm_t* comm) { + SUPER_INIT(comm, &lam_object_cls); + lam_list_init(&comm->wild_receives); } - void mca_pml_ptl_comm_destroy(mca_pml_comm_t* comm) { + LAM_FREE(comm->c_msg_seq); + LAM_FREE(comm->c_next_msg_seq); + LAM_FREE(comm->c_matching_lock); + LAM_FREE(comm->unexpected_frags); + LAM_FREE(comm->unexpected_frags_lock); + LAM_FREE(comm->frags_cant_match); + LAM_FREE(comm->specific_receives); + lam_list_destroy(&comm->wild_receives); + SUPER_DESTROY(comm, &lam_object_cls); } + +int mca_pml_ptl_comm_init_size(mca_pml_comm_t* comm, size_t size) +{ + size_t i; + + /* send message sequence-number support - sender side */ + comm->c_msg_seq = (mca_ptl_base_sequence_t*)LAM_MALLOC(sizeof(mca_ptl_base_sequence_t) * size); + if(NULL == comm->c_msg_seq) + return LAM_ERR_OUT_OF_RESOURCE; + + /* send message sequence-number support - receiver side */ + comm->c_next_msg_seq = (mca_ptl_base_sequence_t*)LAM_MALLOC(sizeof(mca_ptl_base_sequence_t) * size); + if(NULL == comm->c_next_msg_seq) + return LAM_ERR_OUT_OF_RESOURCE; + + /* matching lock */ + comm->c_matching_lock = (lam_mutex_t*)LAM_MALLOC(sizeof(lam_mutex_t) * size); + if(NULL == comm->c_matching_lock) + return LAM_ERR_OUT_OF_RESOURCE; + for(i=0; ic_matching_lock+i); + + /* unexpected fragments queues */ + comm->unexpected_frags = (lam_list_t*)LAM_MALLOC(sizeof(lam_list_t) * size); + if(NULL == comm->unexpected_frags) + return LAM_ERR_OUT_OF_RESOURCE; + for(i=0; iunexpected_frags+i); + + /* these locks are needed to avoid a probe interfering with a match */ + comm->unexpected_frags_lock = (lam_mutex_t*)LAM_MALLOC(sizeof(lam_mutex_t) * size); + if(NULL == comm->unexpected_frags_lock) + return LAM_ERR_OUT_OF_RESOURCE; + for(i=0; iunexpected_frags_lock+i); + + /* out-of-order fragments queues */ + comm->frags_cant_match = (lam_list_t*)LAM_MALLOC(sizeof(lam_list_t) * size); + if(NULL == comm->frags_cant_match) + return LAM_ERR_OUT_OF_RESOURCE; + for(i=0; ifrags_cant_match+i); + + /* queues of unmatched specific (source process specified) receives */ + comm->specific_receives = (lam_list_t*)LAM_MALLOC(sizeof(lam_list_t) * size); + if(NULL == comm->specific_receives) + return LAM_ERR_OUT_OF_RESOURCE; + for(i=0; ispecific_receives+i); + + return LAM_SUCCESS; +} + + diff --git a/src/mca/mpi/ptl/base/ptl_base_comm.h b/src/mca/mpi/ptl/base/ptl_base_comm.h index 330f5ef15c..312faec783 100644 --- a/src/mca/mpi/ptl/base/ptl_base_comm.h +++ b/src/mca/mpi/ptl/base/ptl_base_comm.h @@ -10,10 +10,11 @@ * specific to the PML. */ -extern lam_class_info_t mca_ptl_comm_cls; +extern lam_class_info_t mca_pml_ptl_comm_cls; struct mca_pml_comm_t { - + lam_object_t super; + /* send message sequence-number support - sender side */ mca_ptl_base_sequence_t *c_msg_seq; @@ -43,7 +44,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*, size_t); +extern void mca_pml_ptl_comm_init(struct mca_pml_comm_t*); +extern int mca_pml_ptl_comm_init_size(struct mca_pml_comm_t*, size_t); extern void mca_pml_ptl_comm_destroy(struct mca_pml_comm_t*); #endif