1
1
This commit was SVN r305.
Этот коммит содержится в:
Tim Woodall 2004-01-12 19:08:00 +00:00
родитель 938ae7fa39
Коммит 6600fab8f8
3 изменённых файлов: 69 добавлений и 16 удалений

25
src/mca/mpi/pml/teg/src/.cvsignore Обычный файл
Просмотреть файл

@ -0,0 +1,25 @@
Makefile
Makefile.in
acinclude.m4
aclocal.m4
configure
configure.ac
config.log
config.status
libtool
autom4te.cache
.libs
.deps
*.la
*.lo
.lam*
config.guess
config.sub
depcomp
install-sh
ltmain.sh
missing
mkinstalldirs
stamp-h1
teg_config.h
teg_config.h.in

24
src/mca/mpi/pml/teg/src/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,24 @@
# -*- makefile -*-
#
# $HEADER$
#
include $(top_lam_srcdir)/config/Makefile.options
AM_CPPFLAGS = \
-I$(top_lam_builddir)/src/include \
-I$(top_lam_srcdir)/src \
-I$(top_lam_srcdir)/src/include
noinst_LTLIBRARIES = libmca_coll_basic.la
libmca_coll_basic_la_SOURCES = \
pml_teg.c \
pml_teg.h \
pml_teg_comm.h \
pml_teg_isend.c \
pml_teg_proc.c \
pml_teg_proc.h \
pml_teg_ptl_array.c \
pml_teg_ptl_array.h \
pml_teg_sendreq.c \
pml_teg_sendreq.h

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

@ -6,6 +6,8 @@
#include "lam/constants.h"
#include "mca/mpi/ptl/ptl.h"
#include "mca/mpi/pml/base/pml_base_sendreq.h"
#include "pml_teg.h"
#include "pml_teg_proc.h"
/*
@ -15,7 +17,7 @@
* queue for later delivery.
*/
int mca_pml_teg_send_request_start(lam_p2p_send_request_t* req)
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);
@ -44,21 +46,21 @@ int mca_pml_teg_send_request_start(lam_p2p_send_request_t* req)
*
*/
int mca_pml_teg_send_request_schedule(lam_p2p_send_request_t* req, bool_t* complete)
int mca_pml_teg_send_request_schedule(mca_pml_base_send_request_t* req, bool* complete)
{
lam_proc_t *proc = lam_comm_get_remote_proc(
req->super.req_communicator, req->super.req_peer);
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;
/* allocate first fragment, if the first PTL in the list
* cannot allocate resources for the fragment, try the next
* available.
*/
if(req->req_frags_allocated == 0) {
size_t num_ptl_avail = proc->proc_ptl_first.ptl_size;
size_t num_ptl_avail = proc_pml->proc_ptl_first.ptl_size;
size_t i;
for(i = 0; i < num_ptl_avail; i++) {
lam_p2p_ptl_info_t* ptl_info = lam_p2p_ptl_array_get_next(&proc->proc_ptl_first);
lam_p2p_ptl_t* ptl = ptl_info->ptl;
mca_ptl_info_t* ptl_info = mca_ptl_array_get_next(&proc_pml->proc_ptl_first);
mca_ptl_t* ptl = ptl_info->ptl;
int rc = ptl->ptl_fragment(ptl, req, ptl->ptl_frag_first_size);
if (rc == LAM_SUCCESS)
break;
@ -66,7 +68,7 @@ int mca_pml_teg_send_request_schedule(lam_p2p_send_request_t* req, bool_t* compl
return rc;
}
/* has first fragment been allocated? */
if(req->p2ps_frags_allocated == 0) {
if(req->req_frags_allocated == 0) {
*complete = false;
return LAM_SUCCESS;
}
@ -74,11 +76,11 @@ int mca_pml_teg_send_request_schedule(lam_p2p_send_request_t* req, bool_t* compl
/* allocate remaining bytes to PTLs */
size_t bytes_remaining = req->req_length - req->req_bytes_fragmented;
size_t num_ptl_avail = proc->proc_ptl_next.ptl_size;
size_t num_ptl_avail = proc_pml->proc_ptl_next.ptl_size;
size_t num_ptl = 0;
while(bytes_remaining > 0 && num_ptl++ < num_ptl_avail) {
lam_p2p_ptl_info_t* ptl_info = lam_p2p_ptl_array_get_next(&proc->proc_ptl_next);
lam_p2p_ptl_t* ptl = ptl_info->ptl;
mca_ptl_info_t* ptl_info = mca_ptl_array_get_next(&proc_pml->proc_ptl_next);
mca_ptl_t* ptl = ptl_info->ptl;
/* if this is the last PTL that is available to use, or the number of
* bytes remaining in the message is less than the PTLs minimum fragment
@ -94,7 +96,7 @@ int mca_pml_teg_send_request_schedule(lam_p2p_send_request_t* req, bool_t* compl
* previously assigned)
*/
else {
bytes_to_frag = ptl_info->ptl_weight * req->p2ps_length;
bytes_to_frag = ptl_info->ptl_weight * req->req_length;
if(bytes_to_frag > bytes_remaining)
bytes_to_frag = bytes_remaining;
}
@ -102,9 +104,9 @@ int mca_pml_teg_send_request_schedule(lam_p2p_send_request_t* req, bool_t* compl
int rc = ptl->ptl_fragment(ptl, req, bytes_to_frag);
if(rc != LAM_SUCCESS && rc != LAM_ERR_TEMP_OUT_OF_RESOURCE)
return rc;
bytes_remaining = req->p2ps_length = req->p2ps_bytes_fragmented;
bytes_remaining = req->req_length = req->req_bytes_fragmented;
}
*complete = (req->p2ps_length == req->p2ps_bytes_fragmented);
*complete = (req->req_length == req->req_bytes_fragmented);
return LAM_SUCCESS;
}
@ -116,6 +118,7 @@ int mca_pml_teg_send_request_schedule(lam_p2p_send_request_t* req, bool_t* compl
void mca_pml_teg_send_request_push()
{
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);
@ -129,9 +132,10 @@ void mca_pml_teg_send_request_push()
}
if(complete) {
req = (mca_pml_base_send_request_t*)lam_dbl_remove(
&lam_p2p_sends_incomplete, (lam_list_item_t*)req);
&mca_pml_teg.teg_incomplete_sends, (lam_list_item_t*)req);
}
}
THREAD_UNLOCK(&mca_pml_teg.teg_lock);
}