1
1

moved/renamed base data structures used in PML<->PTL interface from pml/base

to ptl/base as these are specific to the PTL interface

This commit was SVN r346.
Этот коммит содержится в:
Tim Woodall 2004-01-14 03:42:02 +00:00
родитель cdd3c4f4d1
Коммит 8d4f3d2b92
25 изменённых файлов: 632 добавлений и 188 удалений

Просмотреть файл

@ -10,21 +10,11 @@ noinst_LTLIBRARIES = libmca_mpi_pml_base.la
headers = \
base.h \
pml_base_fragment.h \
pml_base_header.h \
pml_base_recvfrag.h \
pml_base_request.h \
pml_base_sendfrag.h \
pml_base_sendreq.h
pml_base_request.h
libmca_mpi_pml_base_la_SOURCES = \
$(headers) \
pml_base_fragment.c \
pml_base_recvfrag.c \
pml_base_recvreq.c \
pml_base_request.c \
pml_base_sendfrag.c \
pml_base_sendreq.c
pml_base_request.c
# Conditionally install the header files

Просмотреть файл

@ -10,8 +10,6 @@
#include "mpi/request/request.h"
#include "mpi/datatype/datatype.h"
#include "mpi/communicator/communicator.h"
#include "mca/mpi/pml/pml.h"
extern lam_class_info_t mca_pml_base_request_cls;
@ -52,7 +50,7 @@ typedef struct {
/* flag indicating if MPI is done with this request called */
bool req_mpi_done;
/* flag indicating if the pt-2-pt layer is done with this request */
bool req_p2p_layer_done;
bool req_pml_layer_done;
} mca_pml_base_request_t;

Просмотреть файл

@ -20,7 +20,7 @@
* PML module functions
*/
typedef struct mca_pml_1_0_0_t * (*mca_pml_base_init_1_0_0_fn_t)(int* priority, int* min_thread, int* max_thread);
typedef struct mca_pml_t * (*mca_pml_base_init_fn_t)(int* priority, int* min_thread, int* max_thread);
typedef int (*mca_pml_base_fini_fn_t)(void);
/*
@ -29,9 +29,7 @@ typedef int (*mca_pml_base_fini_fn_t)(void);
struct mca_ptl_t;
typedef uint64_t mca_pml_base_sequence_t;
typedef uint64_t mca_pml_base_tstamp_t;
typedef lam_list_t mca_pml_base_queue_t;
typedef enum {
MCA_PML_BASE_SEND_STANDARD,
@ -125,7 +123,7 @@ typedef int (*mca_pml_base_wait_fn_t)(
struct mca_pml_base_module_1_0_0_t {
mca_base_module_t pmlm_version;
mca_base_module_data_1_0_0_t pmlm_data;
mca_pml_base_init_1_0_0_fn_t pmlm_init;
mca_pml_base_init_fn_t pmlm_init;
};
typedef struct mca_pml_base_module_1_0_0_t mca_pml_base_module_1_0_0_t;
@ -135,7 +133,7 @@ typedef struct mca_pml_base_module_1_0_0_t mca_pml_base_module_1_0_0_t;
* provided by a PML.
*/
struct mca_pml_1_0_0_t {
struct mca_pml_t {
mca_pml_base_add_comm_fn_t pml_add_comm;
mca_pml_base_del_comm_fn_t pml_del_comm;
@ -154,8 +152,7 @@ struct mca_pml_1_0_0_t {
mca_pml_base_wait_fn_t pml_wait;
};
typedef struct mca_pml_1_0_0_t mca_pml_1_0_0_t;
typedef struct mca_pml_1_0_0_t mca_pml_t;
typedef struct mca_pml_t mca_pml_t;
/*
* Macro for use in modules that are of type pml v1.0.0

Просмотреть файл

@ -44,5 +44,14 @@ static inline mca_ptl_info_t* mca_ptl_array_get_next(mca_ptl_array_t* ptl_array)
return ptl_info;
}
static inline mca_ptl_t* mca_ptl_array_get_next_ptl(mca_ptl_array_t* ptl_array)
{
mca_ptl_info_t* ptl_info = &ptl_array->ptl_array[ptl_array->ptl_index++];
if(ptl_array->ptl_index == ptl_array->ptl_size)
ptl_array->ptl_index = 0;
return ptl_info->ptl;
}
#endif

Просмотреть файл

@ -1,8 +1,8 @@
#include "lam/util/malloc.h"
#include "mca/mpi/pml/pml.h"
#include "mca/mpi/ptl/ptl.h"
#include "mca/mpi/pml/base/pml_base_sendreq.h"
#include "mca/mpi/pml/base/pml_base_recvreq.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"
@ -60,6 +60,14 @@ mca_pml_teg_t mca_pml_teg = {
}
};
/**
* some comment
*
* @param foo description
* @return
*
* long description
*/
int mca_pml_teg_open(lam_cmd_line_t* cmd_line)
{
@ -67,13 +75,14 @@ int mca_pml_teg_open(lam_cmd_line_t* cmd_line)
}
mca_pml_1_0_0_t* mca_pml_teg_init(int* priority, int* min_thread, int* max_thread)
mca_pml_t* mca_pml_teg_init(int* priority, int* min_thread, int* max_thread)
{
*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;

Просмотреть файл

@ -1,3 +1,8 @@
/** @file
*
*
*/
/*
* $HEADER$
*/
@ -12,19 +17,22 @@
#include "mca/mpi/ptl/ptl.h"
/*
/**
* TEG PML Interface
*/
struct mca_pml_teg_t {
mca_pml_t super;
mca_pml_t super; /**< comment */
/* available ptls */
mca_ptl_base_module_t **teg_ptl_modules;
size_t teg_num_ptl_modules;
mca_ptl_t** teg_ptls;
size_t teg_num_ptls;
/* incomplete posted sends */
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;
@ -40,12 +48,12 @@ extern mca_pml_base_module_1_0_0_t mca_pml_teg_module_1_0_0_0;
extern int mca_pml_teg_open(
lam_cmd_line_t*
lam_cmd_line_t* cmd_line
);
extern int mca_pml_teg_close(void);
extern mca_pml_1_0_0_t* mca_pml_teg_init(
extern mca_pml_t* mca_pml_teg_init(
int *priority,
int *max_tag,
int *max_cid

Просмотреть файл

@ -7,7 +7,6 @@
#include "pml_teg_sendreq.h"
int mca_pml_teg_isend_init(
void *buf,
size_t size,
@ -19,13 +18,12 @@ int mca_pml_teg_isend_init(
lam_communicator_t* comm,
lam_request_t **request)
{
int rc;
mca_pml_base_send_request_t* sendreq;
mca_pml_proc_t *proc = mca_pml_teg_proc_lookup_remote(comm,dst);
if((rc = mca_pml_teg_send_request_alloc(proc, &sendreq)) != LAM_SUCCESS)
mca_ptl_base_send_request_t* sendreq;
int rc = mca_pml_teg_send_request_alloc(comm,dst,&sendreq);
if(rc != LAM_SUCCESS)
return rc;
mca_pml_base_send_request_rinit(
mca_ptl_base_send_request_rinit(
sendreq,
buf,
size,
@ -34,7 +32,7 @@ int mca_pml_teg_isend_init(
tag,
comm,
sendmode,
persistent
false
);
*request = (lam_request_t*)sendreq;
@ -52,13 +50,12 @@ int mca_pml_teg_isend(
lam_communicator_t* comm,
lam_request_t **request)
{
int rc;
mca_pml_base_send_request_t* sendreq;
mca_pml_proc_t* proc = mca_pml_teg_proc_lookup_remote(comm,dst);
if((rc = mca_pml_teg_send_request_alloc(proc, &sendreq)) != LAM_SUCCESS)
mca_ptl_base_send_request_t* sendreq;
int rc = mca_pml_teg_send_request_alloc(comm,dst,&sendreq);
if(rc != LAM_SUCCESS)
return rc;
mca_pml_base_send_request_rinit(
mca_ptl_base_send_request_rinit(
sendreq,
buf,
size,

Просмотреть файл

@ -5,6 +5,7 @@
#ifndef MCA_PML_PROC_H
#define MCA_PML_PROC_H
#include "lam/threads/mutex.h"
#include "mpi/communicator/communicator.h"
#include "mpi/group/group.h"
#include "mpi/proc/proc.h"
@ -20,6 +21,7 @@ extern lam_class_info_t mca_pml_teg_proc_cls;
struct mca_pml_proc_t {
lam_list_item_t super;
lam_proc_t *proc_lam;
lam_mutex_t proc_lock;
mca_ptl_array_t proc_ptl_first;
mca_ptl_array_t proc_ptl_next;
};

Просмотреть файл

@ -10,39 +10,17 @@
#include "pml_teg_sendreq.h"
int mca_pml_teg_send_request_alloc(mca_pml_proc_t* proc, mca_pml_base_send_request_t** sendreq)
{
return LAM_SUCCESS;
}
/*
* Start a send request by calling the scheduler to stripe
* the message across available PTLs. If the scheduler cannot
* fragment the entire message due to resource constraints,
* queue for later delivery.
*/
int mca_pml_teg_send_request_start(mca_pml_base_send_request_t* req)
{
bool complete;
int rc = mca_pml_teg_send_request_schedule(req, &complete);
if(rc != LAM_SUCCESS)
return rc;
if(complete == false) {
THREAD_LOCK(&mca_pml_teg.teg_lock);
lam_list_append(&mca_pml_teg.teg_incomplete_sends, (lam_list_item_t*)req);
THREAD_UNLOCK(&mca_pml_teg.teg_lock);
}
return LAM_SUCCESS;
}
/*
* Schedule message delivery across potentially multiple PTLs. Use
* two seperate PTL pools. One for the first fragment (low latency)
* and a second for the remaining fragments (high bandwidth). Note that
* the same PTL could exist in both pools.
/**
* Schedule message delivery across potentially multiple PTLs.
*
* @param request (IN) Request to schedule
* @param complete (OUT) Completion status
* @return status Error status
*
* The scheduler uses two seperate PTL pools. One for the first fragment
* (low latency) and a second for the remaining fragments (high bandwidth).
* Note that the same PTL could exist in both pools.
*
* If the first fragment cannot be scheduled due to a resource constraint,
* the entire message is queued for later delivery by the progress engine.
@ -52,11 +30,14 @@ int mca_pml_teg_send_request_start(mca_pml_base_send_request_t* req)
*
*/
int mca_pml_teg_send_request_schedule(mca_pml_base_send_request_t* req, bool* complete)
int mca_pml_teg_send_request_schedule(mca_ptl_base_send_request_t* req, bool* complete)
{
#if 0
lam_proc_t *proc = lam_comm_lookup_peer(req->super.req_communicator, req->super.req_peer);
mca_pml_proc_t* proc_pml = proc->proc_pml;
/* start the first fragment */
if(lam
/* allocate remaining bytes to PTLs */
size_t bytes_remaining = req->req_length - req->req_bytes_fragmented;
@ -91,6 +72,7 @@ int mca_pml_teg_send_request_schedule(mca_pml_base_send_request_t* req, bool* co
bytes_remaining = req->req_length = req->req_bytes_fragmented;
}
*complete = (req->req_length == req->req_bytes_fragmented);
#endif
return LAM_SUCCESS;
}
@ -103,10 +85,10 @@ int mca_pml_teg_send_request_schedule(mca_pml_base_send_request_t* req, bool* co
int mca_pml_teg_send_request_progress(void)
{
THREAD_LOCK(&mca_pml_teg.teg_lock);
mca_pml_base_send_request_t* req;
for(req = (mca_pml_base_send_request_t*)lam_list_get_first(&mca_pml_teg.teg_incomplete_sends);
req != (mca_pml_base_send_request_t*)lam_list_get_end(&mca_pml_teg.teg_incomplete_sends);
req = (mca_pml_base_send_request_t*)lam_list_get_next(req)) {
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);
req != (mca_ptl_base_send_request_t*)lam_list_get_end(&mca_pml_teg.teg_incomplete_sends);
req = (mca_ptl_base_send_request_t*)lam_list_get_next(req)) {
bool complete;
int rc = mca_pml_teg_send_request_schedule(req, &complete);
@ -115,7 +97,7 @@ int mca_pml_teg_send_request_progress(void)
return rc;
}
if(complete) {
req = (mca_pml_base_send_request_t*)lam_list_remove(
req = (mca_ptl_base_send_request_t*)lam_list_remove(
&mca_pml_teg.teg_incomplete_sends, (lam_list_item_t*)req);
}
}

Просмотреть файл

@ -5,18 +5,49 @@
#ifndef LAM_PML_TEG_SEND_REQUEST_H
#define LAM_PML_TEG_SEND_REQUEST_H
#include "mca/mpi/pml/base/pml_base_sendreq.h"
#include "mca/mpi/pml/base/pml_base_sendfrag.h"
#include "mca/mpi/ptl/base/ptl_base_sendreq.h"
#include "mca/mpi/ptl/base/ptl_base_sendfrag.h"
int mca_pml_teg_send_request_alloc(
mca_pml_proc_t*,
mca_pml_base_send_request_t**
);
int mca_pml_teg_send_request_start(mca_pml_base_send_request_t* req);
int mca_pml_teg_send_request_schedule(mca_pml_base_send_request_t* req, bool* complete);
int mca_pml_teg_send_request_schedule(mca_ptl_base_send_request_t* req, bool* complete);
int mca_pml_teg_send_request_progress(void);
static inline int mca_pml_teg_send_request_alloc(
lam_communicator_t* comm,
int dst,
mca_ptl_base_send_request_t** sendreq)
{
mca_pml_proc_t *proc = mca_pml_teg_proc_lookup_remote(comm,dst);
mca_ptl_t* ptl;
THREAD_SCOPED_LOCK(&proc->proc_lock,
(ptl = mca_ptl_array_get_next_ptl(&proc->proc_ptl_first)));
int rc = ptl->ptl_request_alloc(ptl,sendreq);
if(rc != LAM_SUCCESS)
return rc;
(*sendreq)->req_first_ptl = ptl;
return LAM_SUCCESS;
}
static inline int mca_pml_teg_send_request_start(
mca_ptl_base_send_request_t* req)
{
mca_ptl_t* ptl = req->req_first_ptl;
size_t first_fragment_size = ptl->ptl_frag_first_size;
// queue for pending acknowledgment
THREAD_SCOPED_LOCK(&mca_pml_teg.teg_lock,
lam_list_append(&mca_pml_teg.teg_pending_acks, (lam_list_item_t*)req));
// start the first fragment
if(req->req_length < first_fragment_size)
first_fragment_size = req->req_length;
return req->req_first_ptl->ptl_send(ptl, req, first_fragment_size);
}
#endif

Просмотреть файл

@ -4,7 +4,34 @@
include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libbase.la
noinst_LTLIBRARIES = libmca_mpi_ptl_base.la
# Source code files
headers = \
base.h \
ptl_base_fragment.h \
ptl_base_header.h \
ptl_base_match.h \
ptl_base_recvfrag.h \
ptl_base_sendfrag.h \
ptl_base_sendreq.h
libmca_mpi_ptl_base_la_SOURCES = \
$(headers) \
ptl_base_fragment.c \
ptl_base_match.c \
ptl_base_recvfrag.c \
ptl_base_recvreq.c \
ptl_base_sendfrag.c \
ptl_base_sendreq.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
lamdir = $(includedir)/mca/mpi/ptl/base
lam_HEADERS = $(headers)
else
lamdir = $(includedir)
endif
libbase_la_SOURCES = \
ptl_base_match.c

25
src/mca/mpi/ptl/base/ptl_base_fragment.c Обычный файл
Просмотреть файл

@ -0,0 +1,25 @@
/*
* $HEADER$
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "lam/lfc/list.h"
#include "mca/mpi/ptl/base/ptl_base_fragment.h"
lam_class_info_t mca_ptl_base_frag_cls = {
"mca_ptl_base_frag_t",
&lam_list_item_cls,
(class_init_t) mca_ptl_base_frag_init,
(class_destroy_t) mca_ptl_base_frag_destroy
};
void mca_ptl_base_frag_init(mca_ptl_base_frag_t* frag)
{
SUPER_INIT(frag, &lam_list_item_cls);
}
void mca_ptl_base_frag_destroy(mca_ptl_base_frag_t* frag)
{
SUPER_DESTROY(frag, &lam_list_item_cls);
}

28
src/mca/mpi/ptl/base/ptl_base_fragment.h Обычный файл
Просмотреть файл

@ -0,0 +1,28 @@
/*
* $HEADER$
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifndef MCA_PML_BASE_FRAGMENT_H
#define MCA_PML_BASE_FRAGMENT_H
#include "lam/lfc/list.h"
#include "mca/mpi/ptl/ptl.h"
#include "mca/mpi/ptl/base/ptl_base_header.h"
extern lam_class_info_t mca_ptl_base_frag_cls;
struct mca_ptl_base_frag_t {
lam_list_item_t super;
mca_ptl_base_reliable_hdr_t frag_header;
struct mca_ptl_t* frag_ptl;
};
typedef struct mca_ptl_base_frag_t mca_ptl_base_frag_t;
void mca_ptl_base_frag_init(mca_ptl_base_frag_t*);
void mca_ptl_base_frag_destroy(mca_ptl_base_frag_t*);
#endif

43
src/mca/mpi/ptl/base/ptl_base_header.h Обычный файл
Просмотреть файл

@ -0,0 +1,43 @@
/*
* $HEADER$
*/
#ifndef MCA_PML_BASE_HEADER_H
#define MCA_PML_BASE_HEADER_H
#include "mca/mpi/ptl/ptl.h"
/* define a common set of parameters included in all
* point-to-point headers
*/
typedef struct {
/* communicator index */
uint32_t hdr_contextid;
/* source rank */
int hdr_src_rank;
/* destination rank */
int hdr_dst_rank;
/* user tag */
int hdr_user_tag;
/* type of message - send/bsend/ssend/rsend/recv */
int hdr_msg_type;
/* message length */
size_t hdr_msg_length;
/* fragment length */
size_t hdr_frag_length;
/* offset into message */
size_t hdr_offset;
} mca_ptl_base_hdr_t;
typedef struct {
/* base header */
mca_ptl_base_hdr_t hdr_base;
/* message sequence number */
mca_ptl_base_sequence_t hdr_msg_seq_num;
/* fragment sequence number */
mca_ptl_base_sequence_t hdr_frag_seq_num;
} mca_ptl_base_reliable_hdr_t;
#endif /* MCA_PML_BASE_HEADER_H */

Просмотреть файл

@ -6,16 +6,16 @@
#include <stdio.h>
#include "mca/mpi/pml/pml.h"
#include "mca/mpi/pml/base/pml_base_recvfrag.h"
#include "lam/lfc/list.h"
#include "lam/threads/mutex.h"
#include "lam/constants.h"
#include "mpi/communicator/communicator.h"
#include "mca/mpi/pml/base/pml_base_header.h"
#include "mca/mpi/pml/base/pml_base_comm.h"
#include "lam/lfc/list.h"
#include "mca/mpi/ptl/base/ptl_base_match.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_recvfrag.h"
#include "mca/mpi/ptl/base/ptl_base_header.h"
#include "mca/mpi/ptl/base/ptl_base_match.h"
/**
* RCS/CTS receive side matching
@ -47,14 +47,14 @@
* - fragments may be corrupt
* - this routine may be called simoultaneously by more than one thread
*/
int mca_ptl_base_match(mca_pml_base_reliable_hdr_t *frag_header,
mca_pml_base_recv_frag_t *frag_desc, int *match_made,
int mca_ptl_base_match(mca_ptl_base_reliable_hdr_t *frag_header,
mca_ptl_base_recv_frag_t *frag_desc, int *match_made,
lam_list_t *additional_matches)
{
/* local variables */
mca_pml_base_sequence_t frag_msg_seq_num,next_msg_seq_num_expected;
mca_ptl_base_sequence_t frag_msg_seq_num,next_msg_seq_num_expected;
lam_communicator_t *comm_ptr;
mca_pml_base_recv_request_t *matched_receive;
mca_ptl_base_recv_request_t *matched_receive;
mca_pml_comm_t *pml_comm;
int frag_src;
@ -185,15 +185,15 @@ int mca_ptl_base_match(mca_pml_base_reliable_hdr_t *frag_header,
* This routine assumes that the appropriate matching locks are
* set by the upper level routine.
*/
mca_pml_base_recv_request_t *mca_ptl_base_check_recieves_for_match
(mca_pml_base_reliable_hdr_t *frag_header, mca_pml_comm_t *pml_comm)
mca_ptl_base_recv_request_t *mca_ptl_base_check_recieves_for_match
(mca_ptl_base_reliable_hdr_t *frag_header, mca_pml_comm_t *pml_comm)
{
/* local parameters */
mca_pml_base_recv_request_t *return_match;
mca_ptl_base_recv_request_t *return_match;
int frag_src;
/* initialization */
return_match=(mca_pml_base_recv_request_t *)NULL;
return_match=(mca_ptl_base_recv_request_t *)NULL;
/*
* figure out what sort of matching logic to use, if need to
@ -239,16 +239,16 @@ mca_pml_base_recv_request_t *mca_ptl_base_check_recieves_for_match
* This routine assumes that the appropriate matching locks are
* set by the upper level routine.
*/
mca_pml_base_recv_request_t *check_wild_receives_for_match(
mca_pml_base_reliable_hdr_t *frag_header,
mca_ptl_base_recv_request_t *check_wild_receives_for_match(
mca_ptl_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *pml_comm)
{
/* local parameters */
mca_pml_base_recv_request_t *return_match, *wild_recv;
mca_ptl_base_recv_request_t *return_match, *wild_recv;
int frag_user_tag,recv_user_tag;
/* initialization */
return_match=(mca_pml_base_recv_request_t *)NULL;
return_match=(mca_ptl_base_recv_request_t *)NULL;
frag_user_tag=frag_header->hdr_base.hdr_user_tag;
/*
@ -256,11 +256,11 @@ mca_pml_base_recv_request_t *check_wild_receives_for_match(
* locking is protecting from having other threads trying to
* change this list.
*/
for(wild_recv = (mca_pml_base_recv_request_t *)
for(wild_recv = (mca_ptl_base_recv_request_t *)
lam_list_get_first(&(pml_comm->wild_receives));
wild_recv != (mca_pml_base_recv_request_t *)
wild_recv != (mca_ptl_base_recv_request_t *)
lam_list_get_end(&(pml_comm->wild_receives));
wild_recv = (mca_pml_base_recv_request_t *)
wild_recv = (mca_ptl_base_recv_request_t *)
((lam_list_item_t *)wild_recv)->lam_list_next) {
recv_user_tag = wild_recv->super.req_tag;
@ -306,28 +306,28 @@ mca_pml_base_recv_request_t *check_wild_receives_for_match(
* This routine assumes that the appropriate matching locks are
* set by the upper level routine.
*/
mca_pml_base_recv_request_t *check_specific_receives_for_match(
mca_pml_base_reliable_hdr_t *frag_header,
mca_ptl_base_recv_request_t *check_specific_receives_for_match(
mca_ptl_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *pml_comm)
{
/* local variables */
mca_pml_base_recv_request_t *specific_recv, *return_match;
mca_ptl_base_recv_request_t *specific_recv, *return_match;
int frag_src,recv_user_tag,frag_user_tag;
/* initialization */
return_match=(mca_pml_base_recv_request_t *)NULL;
return_match=(mca_ptl_base_recv_request_t *)NULL;
frag_src = frag_header->hdr_frag_seq_num;
frag_user_tag=frag_header->hdr_base.hdr_user_tag;
/*
* Loop over the specific irecvs.
*/
for(specific_recv = (mca_pml_base_recv_request_t *)
for(specific_recv = (mca_ptl_base_recv_request_t *)
lam_list_get_first((pml_comm->specific_receives)+frag_src);
specific_recv != (mca_pml_base_recv_request_t *)
specific_recv != (mca_ptl_base_recv_request_t *)
lam_list_get_end((pml_comm->specific_receives)+frag_src);
specific_recv = (mca_pml_base_recv_request_t *)
specific_recv = (mca_ptl_base_recv_request_t *)
((lam_list_item_t *)specific_recv)->lam_list_next) {
/*
* Check for a match
@ -368,17 +368,17 @@ mca_pml_base_recv_request_t *check_specific_receives_for_match(
* This routine assumes that the appropriate matching locks are
* set by the upper level routine.
*/
mca_pml_base_recv_request_t *check_specific_and_wild_receives_for_match(
mca_pml_base_reliable_hdr_t *frag_header,
mca_ptl_base_recv_request_t *check_specific_and_wild_receives_for_match(
mca_ptl_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *pml_comm)
{
/* local variables */
mca_pml_base_recv_request_t *specific_recv, *wild_recv, *return_match;
mca_pml_base_sequence_t wild_recv_seq_num, specific_recv_seq_num;
mca_ptl_base_recv_request_t *specific_recv, *wild_recv, *return_match;
mca_ptl_base_sequence_t wild_recv_seq_num, specific_recv_seq_num;
int frag_src,frag_user_tag, wild_recv_tag, specific_recv_tag;
/* initialization */
return_match=(mca_pml_base_recv_request_t *)NULL;
return_match=(mca_ptl_base_recv_request_t *)NULL;
frag_src = frag_header->hdr_frag_seq_num;
frag_user_tag=frag_header->hdr_base.hdr_user_tag;
@ -386,13 +386,13 @@ mca_pml_base_recv_request_t *check_specific_and_wild_receives_for_match(
* We know that when this is called, both specific and wild irecvs
* have been posted.
*/
specific_recv = (mca_pml_base_recv_request_t *)
specific_recv = (mca_ptl_base_recv_request_t *)
lam_list_get_first((pml_comm->specific_receives)+frag_src);
wild_recv = (mca_pml_base_recv_request_t *)
wild_recv = (mca_ptl_base_recv_request_t *)
lam_list_get_first(&(pml_comm->wild_receives));
specific_recv_seq_num = specific_recv->sequence_number;
wild_recv_seq_num = wild_recv->sequence_number;
specific_recv_seq_num = specific_recv->req_sequence;
wild_recv_seq_num = wild_recv->req_sequence;
while (true) {
if (wild_recv_seq_num < specific_recv_seq_num) {
@ -421,14 +421,14 @@ mca_pml_base_recv_request_t *check_specific_and_wild_receives_for_match(
/*
* No match, go to the next.
*/
wild_recv=(mca_pml_base_recv_request_t *)
wild_recv=(mca_ptl_base_recv_request_t *)
((lam_list_item_t *)wild_recv)->lam_list_next;
/*
* If that was the last wild one, just look at the
* rest of the specific ones.
*/
if (wild_recv == (mca_pml_base_recv_request_t *)
if (wild_recv == (mca_ptl_base_recv_request_t *)
lam_list_get_end(&(pml_comm->wild_receives)) )
{
return_match = check_specific_receives_for_match(frag_header,
@ -441,7 +441,7 @@ mca_pml_base_recv_request_t *check_specific_and_wild_receives_for_match(
* Get the sequence number for this recv, and go
* back to the top of the loop.
*/
wild_recv_seq_num = wild_recv->sequence_number;
wild_recv_seq_num = wild_recv->req_sequence;
} else {
/*
@ -467,14 +467,14 @@ mca_pml_base_recv_request_t *check_specific_and_wild_receives_for_match(
/*
* No match, go on to the next specific irecv.
*/
specific_recv = (mca_pml_base_recv_request_t *)
specific_recv = (mca_ptl_base_recv_request_t *)
((lam_list_item_t *)specific_recv)->lam_list_next;
/*
* If that was the last specific irecv, process the
* rest of the wild ones.
*/
if (specific_recv == (mca_pml_base_recv_request_t *)
if (specific_recv == (mca_ptl_base_recv_request_t *)
lam_list_get_end((pml_comm->specific_receives)+frag_src) )
{
return_match = check_wild_receives_for_match(frag_header,
@ -486,7 +486,7 @@ mca_pml_base_recv_request_t *check_specific_and_wild_receives_for_match(
* Get the sequence number for this recv, and go
* back to the top of the loop.
*/
specific_recv_seq_num = specific_recv->sequence_number;
specific_recv_seq_num = specific_recv->req_sequence;
}
}
}

Просмотреть файл

@ -5,25 +5,25 @@
#ifndef MCA_PTL_BASE_MATCH_H
#define MCA_PTL_BASE_MATCH_H
int mca_ptl_base_match(mca_pml_base_reliable_hdr_t *frag_header,
mca_pml_base_recv_frag_t *frag_desc, int *match_made,
int mca_ptl_base_match(mca_ptl_base_reliable_hdr_t *frag_header,
mca_ptl_base_recv_frag_t *frag_desc, int *match_made,
lam_list_t *additional_matches);
mca_pml_base_recv_request_t *mca_ptl_base_check_recieves_for_match(
mca_pml_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *pml_comm);
mca_ptl_base_recv_request_t *mca_ptl_base_check_recieves_for_match(
mca_ptl_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *ptl_comm);
mca_pml_base_recv_request_t *check_wild_receives_for_match(
mca_pml_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *pml_comm);
mca_ptl_base_recv_request_t *check_wild_receives_for_match(
mca_ptl_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *ptl_comm);
mca_pml_base_recv_request_t *check_specific_receives_for_match(
mca_pml_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *pml_comm);
mca_ptl_base_recv_request_t *check_specific_receives_for_match(
mca_ptl_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *ptl_comm);
mca_pml_base_recv_request_t *check_specific_and_wild_receives_for_match(
mca_pml_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *pml_comm);
mca_ptl_base_recv_request_t *check_specific_and_wild_receives_for_match(
mca_ptl_base_reliable_hdr_t *frag_header,
mca_pml_comm_t *ptl_comm);
#endif /* MCA_PTL_BASE_MATCH_H */

25
src/mca/mpi/ptl/base/ptl_base_recvfrag.c Обычный файл
Просмотреть файл

@ -0,0 +1,25 @@
/*
* $HEADER$
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "mca/mpi/ptl/base/ptl_base_recvfrag.h"
lam_class_info_t mca_ptl_base_recv_frag_cls = {
"mca_ptl_base_recv_frag_t",
&mca_ptl_base_frag_cls,
(class_init_t) mca_ptl_base_recv_frag_init,
(class_destroy_t) mca_ptl_base_recv_frag_destroy
};
void mca_ptl_base_recv_frag_init(mca_ptl_base_recv_frag_t* frag)
{
SUPER_INIT(frag, &mca_ptl_base_frag_cls);
}
void mca_ptl_base_recv_frag_destroy(mca_ptl_base_recv_frag_t* frag)
{
SUPER_DESTROY(frag, &mca_ptl_base_frag_cls);
}

28
src/mca/mpi/ptl/base/ptl_base_recvfrag.h Обычный файл
Просмотреть файл

@ -0,0 +1,28 @@
/*
* $HEADER$
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifndef MCA_PML_BASE_RECVFRAG_H
#define MCA_PML_BASE_RECVFRAG_H
#include "mca/mpi/ptl/ptl.h"
#include "mca/mpi/ptl/base/ptl_base_fragment.h"
#include "mca/mpi/ptl/base/ptl_base_recvreq.h"
extern lam_class_info_t mca_ptl_base_recv_frag_cls;
typedef struct {
mca_ptl_base_frag_t super;
/* matched receve request corresponding to this fragment */
mca_ptl_base_recv_request_t *matched_recv;
} mca_ptl_base_recv_frag_t;
void mca_ptl_base_recv_frag_init(mca_ptl_base_recv_frag_t*);
void mca_ptl_base_recv_frag_destroy(mca_ptl_base_recv_frag_t*);
#endif

25
src/mca/mpi/ptl/base/ptl_base_recvreq.c Обычный файл
Просмотреть файл

@ -0,0 +1,25 @@
/*
* $HEADER$
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "mca/mpi/ptl/base/ptl_base_recvreq.h"
lam_class_info_t mca_ptl_base_recv_request_cls = {
"mca_ptl_base_recv_request_t",
&mca_pml_base_request_cls,
(class_init_t) mca_ptl_base_recv_request_init,
(class_destroy_t) mca_ptl_base_recv_request_destroy
};
void mca_ptl_base_recv_request_init(mca_ptl_base_recv_request_t* req)
{
SUPER_INIT(req, &mca_pml_base_request_cls);
}
void mca_ptl_base_recv_request_destroy(mca_ptl_base_recv_request_t* req)
{
SUPER_DESTROY(req, &mca_pml_base_request_cls);
}

25
src/mca/mpi/ptl/base/ptl_base_recvreq.h Обычный файл
Просмотреть файл

@ -0,0 +1,25 @@
/*
* $HEADER$
*/
#ifndef MCA_PML_BASE_RECV_REQUEST_H
#define MCA_PML_BASE_RECV_REQUEST_H
#include "mca/mpi/ptl/ptl.h"
#include "mca/mpi/pml/base/pml_base_request.h"
extern lam_class_info_t mca_ptl_base_recv_request_cls;;
typedef struct {
mca_pml_base_request_t super;
mca_ptl_base_sequence_t req_sequence;
} mca_ptl_base_recv_request_t;
void mca_ptl_base_recv_request_init(mca_ptl_base_recv_request_t*);
void mca_ptl_base_recv_request_destroy(mca_ptl_base_recv_request_t*);
#endif

24
src/mca/mpi/ptl/base/ptl_base_sendfrag.c Обычный файл
Просмотреть файл

@ -0,0 +1,24 @@
/*
* $HEADER$
*/
#include "mca/mpi/ptl/base/ptl_base_sendfrag.h"
lam_class_info_t mca_ptl_base_send_frag_cls = {
"mca_ptl_base_send_frag_t",
&mca_ptl_base_frag_cls,
(class_init_t) mca_ptl_base_send_frag_init,
(class_destroy_t) mca_ptl_base_send_frag_destroy
};
void mca_ptl_base_send_frag_init(mca_ptl_base_send_frag_t* frag)
{
SUPER_INIT(frag, &mca_ptl_base_frag_cls);
}
void mca_ptl_base_send_frag_destroy(mca_ptl_base_send_frag_t* frag)
{
SUPER_DESTROY(frag, &mca_ptl_base_frag_cls);
}

24
src/mca/mpi/ptl/base/ptl_base_sendfrag.h Обычный файл
Просмотреть файл

@ -0,0 +1,24 @@
/*
* $HEADER$
*/
#ifndef MCA_PML_BASE_SEND_FRAG_H
#define MCA_PML_BASE_SEND_FRAG_H
#include "mca/mpi/ptl/ptl.h"
#include "mca/mpi/ptl/base/ptl_base_fragment.h"
extern lam_class_info_t mca_ptl_base_send_frag_cls;
struct mca_ptl_base_send_frag_t {
mca_ptl_base_frag_t super;
struct mca_ptl_base_send_request_t *frag_request;
};
typedef struct mca_ptl_base_send_frag_t mca_ptl_base_send_frag_t;
void mca_ptl_base_send_frag_init(mca_ptl_base_send_frag_t*);
void mca_ptl_base_send_frag_destroy(mca_ptl_base_send_frag_t*);
#endif

26
src/mca/mpi/ptl/base/ptl_base_sendreq.c Обычный файл
Просмотреть файл

@ -0,0 +1,26 @@
/*
* $HEADER$
*/
#include "mca/mpi/ptl/base/ptl_base_sendreq.h"
lam_class_info_t mca_ptl_base_send_request_cls = {
"mca_ptl_base_send_request_t",
&mca_pml_base_request_cls,
(class_init_t) mca_ptl_base_send_request_init,
(class_destroy_t) mca_ptl_base_send_request_destroy
};
void mca_ptl_base_send_request_init(mca_ptl_base_send_request_t* req)
{
SUPER_INIT(req, &mca_pml_base_request_cls);
lam_list_init(&req->req_unacked_frags);
}
void mca_ptl_base_send_request_destroy(mca_ptl_base_send_request_t* req)
{
lam_list_destroy(&req->req_unacked_frags);
SUPER_DESTROY(&req->req_unacked_frags, &mca_pml_base_request_cls);
}

78
src/mca/mpi/ptl/base/ptl_base_sendreq.h Обычный файл
Просмотреть файл

@ -0,0 +1,78 @@
/*
* $HEADER$
*/
#ifndef MCA_PML_BASE_SEND_REQUEST_H
#define MCA_PML_BASE_SEND_REQUEST_H
#include "lam_config.h"
#include "mca/mpi/ptl/ptl.h"
#include "mca/mpi/pml/base/pml_base_request.h"
struct mca_ptl_base_send_request_t {
/* request object - common data structure for use by wait/test */
mca_pml_base_request_t super;
/* pointer to user data */
void *req_data;
/* size of send/recv in bytes */
size_t req_length;
/* number of bytes that have already been assigned to a fragment */
size_t req_bytes_fragmented;
/* number of bytes that have been acked */
size_t req_bytes_acked;
/* number of fragments that have been allocated */
size_t req_frags_allocated;
/* clear to send flag */
bool req_clear_to_send;
/* type of send */
mca_pml_base_send_mode_t req_send_mode;
/* time at which watchdog timer expires */
mca_pml_base_tstamp_t req_time_out;
/* sequence number for MPI pt-2-pt ordering */
mca_ptl_base_sequence_t req_msg_sequence_number;
/* queue of fragments that are waiting to be acknowledged */
mca_ptl_base_queue_t req_unacked_frags;
/* first ptl/fragment descriptor */
struct mca_ptl_t* req_first_ptl;
struct mca_ptl_base_send_frag_t* req_first_frag;
};
typedef struct mca_ptl_base_send_request_t mca_ptl_base_send_request_t;
void mca_ptl_base_send_request_init(mca_ptl_base_send_request_t*);
void mca_ptl_base_send_request_destroy(mca_ptl_base_send_request_t*);
static inline void mca_ptl_base_send_request_rinit(
mca_ptl_base_send_request_t *request,
void *data,
size_t length,
lam_datatype_t* datatype,
int peer,
int tag,
lam_communicator_t* comm,
mca_pml_base_send_mode_t sendmode,
bool persistent)
{
request->req_data = data;
request->req_length = length;
request->req_clear_to_send = false;
request->req_bytes_fragmented = 0;
request->req_bytes_acked = 0;
request->req_frags_allocated = 0;
request->req_send_mode = sendmode;
request->super.req_datatype = datatype;
request->super.req_peer = peer;
request->super.req_tag = tag;
request->super.req_communicator = comm;
request->super.req_type = MCA_PML_REQUEST_SEND;
request->super.req_persistent = persistent;
request->super.req_mpi_done = false;
request->super.req_pml_layer_done = false;
}
#endif

Просмотреть файл

@ -1,7 +1,10 @@
/*
* $HEADER$
*/
/** @file
*
* P2P Transport Layer (PTL)
*/
#ifndef LAM_MCA_PTL_H
#define LAM_MCA_PTL_H
@ -10,70 +13,110 @@
#include "lam/lfc/list.h"
#include "mpi/proc/proc.h"
#include "mca/mpi/pml/pml.h"
#include "mca/mpi/pml/base/pml_base_sendreq.h"
#include "mca/mpi/ptl/ptl.h"
/*
* PTL type
* PTL types
*/
struct mca_ptl_1_0_0_t;
typedef struct mca_ptl_1_0_0_t mca_ptl_t;
struct mca_ptl_t;
struct mca_ptl_base_fragment_t;
struct mca_ptl_base_send_request_t;
typedef uint64_t mca_ptl_base_sequence_t;
typedef uint64_t mca_ptl_base_tstamp_t;
typedef lam_list_t mca_ptl_base_queue_t;
/*
* PTL module functions.
/**
* Intializes the PTL module and creates specific PTL instance(s).
*
* @param num_ptls (OUT) Returns the number of ptl instances created.
* @param thread_min (OUT) Minimum thread level supported by the PTL.
* @param thread_max (OUT) Maximum thread level supported by the PTL.
* @return Array of pointers to PTL instances.
*/
typedef struct mca_ptl_t** (*mca_ptl_base_init_fn_t)(
int* num_ptls,
int *thread_min,
int *thread_max
);
typedef struct mca_ptl_1_0_0_t** (*mca_ptl_init_1_0_0_fn_t)(int* num_ptls, int *thread_min, int *thread_max);
typedef int (*mca_ptl_add_procs_fn_t)(mca_ptl_t*, struct lam_proc_t**, size_t nprocs);
typedef int (*mca_ptl_fini_fn_t)(mca_ptl_t*);
/*
* PTL action functions.
/**
* PML->PTL notification of change in the process list.
*
* @param ptl (IN)
* @param procs (IN)
* @param nprocs (IN)
* @return
*/
typedef int (*mca_ptl_base_add_procs_fn_t)(
struct mca_ptl_t* ptl,
struct lam_proc_t** procs,
size_t nprocs
);
typedef mca_pml_base_send_request_t* (*mca_ptl_request_alloc_fn_t)(mca_ptl_t*);
typedef int (*mca_ptl_fragment_fn_t)(struct mca_ptl_t*, mca_pml_base_send_request_t*, size_t);
typedef int (*mca_ptl_progress_fn_t)(struct mca_ptl_t*, mca_pml_base_tstamp_t);
/**
* Called by the MCA to cleanup any resources held by the PTL.
*/
typedef int (*mca_ptl_base_fini_fn_t)(
struct mca_ptl_t*
);
typedef int (*mca_ptl_base_request_alloc_fn_t)(
struct mca_ptl_t* ptl,
struct mca_ptl_base_send_request_t**
);
typedef int (*mca_ptl_base_send_fn_t)(
struct mca_ptl_t* ptl,
struct mca_ptl_base_send_request_t*,
size_t size
);
typedef int (*mca_ptl_base_progress_fn_t)(
struct mca_ptl_t*,
mca_pml_base_tstamp_t
);
/*
* Struct used to pass PTL module information from the each PTL
* instance back to the MCA framework.
*/
struct mca_ptl_module_1_0_0_t {
struct mca_ptl_base_module_1_0_0_t {
mca_base_module_t ptlm_version;
mca_base_module_data_1_0_0_t ptlm_data;
mca_ptl_init_1_0_0_fn_t ptlm_init;
mca_ptl_base_init_fn_t ptlm_init;
};
typedef struct mca_ptl_module_1_0_0_t mca_ptl_module_1_0_0_t;
typedef struct mca_ptl_module_1_0_0_t mca_ptl_module_t;
typedef struct mca_ptl_base_module_1_0_0_t mca_ptl_base_module_1_0_0_t;
typedef struct mca_ptl_base_module_1_0_0_t mca_ptl_base_module_t;
/*
/**
* Struct that represents the common state and interface functions
* provided by a PTL.
*/
struct mca_ptl_1_0_0_t {
struct mca_ptl_t {
/* PTL common attributes */
size_t ptl_frag_first_size; /* maximum size of first fragment */
size_t ptl_frag_min_size; /* threshold below which the CDI will not fragment */
size_t ptl_frag_max_size; /* maximum fragment size supported by the CDI */
uint32_t ptl_endpoint_latency; /* relative/absolute measure of latency */
uint64_t ptl_endpoint_bandwidth; /* bandwidth (bytes/sec) supported by each endpoint */
size_t ptl_endpoint_count; /* number endpoints supported by this CDI */
mca_ptl_base_module_t* ptl_module;
size_t ptl_frag_first_size; /**< maximum size of first fragment */
size_t ptl_frag_min_size; /**< threshold below which the CDI will not fragment */
size_t ptl_frag_max_size; /**< maximum fragment size supported by the CDI */
uint32_t ptl_endpoint_latency; /**< relative/absolute measure of latency */
uint64_t ptl_endpoint_bandwidth; /**< bandwidth (bytes/sec) supported by each endpoint */
size_t ptl_endpoint_count; /**< number endpoints supported by this CDI */
/* PTL function table */
mca_ptl_add_procs_fn_t ptl_add_procs;
mca_ptl_fini_fn_t ptl_fini;
mca_ptl_fragment_fn_t ptl_fragment;
mca_ptl_progress_fn_t ptl_progress;
mca_ptl_request_alloc_fn_t ptl_request_alloc;
mca_ptl_base_add_procs_fn_t ptl_add_procs;
mca_ptl_base_fini_fn_t ptl_fini;
mca_ptl_base_send_fn_t ptl_send;
mca_ptl_base_progress_fn_t ptl_progress;
mca_ptl_base_request_alloc_fn_t ptl_request_alloc;
};
typedef struct mca_ptl_1_0_0_t mca_ptl_1_0_0_t;
typedef struct mca_ptl_t mca_ptl_t;
/*
* Global functions for MCA: overall PTL open and close