1
1

-- Fix a bug on re-enabling chained event

-- Replace stdout with stderr for debugging output

This commit was SVN r2378.
Этот коммит содержится в:
Weikuan Yu 2004-08-29 14:22:35 +00:00
родитель 8869ebb16e
Коммит 841b73f8a3
6 изменённых файлов: 73 добавлений и 58 удалений

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

@ -246,6 +246,11 @@ mca_ptl_elan_isend (struct mca_ptl_base_module_t *ptl,
*/
START_FUNC(PTL_ELAN_DEBUG_SEND);
{
/* FIXME: YUW, remove this block */
fprintf(stderr, "[proc%s:%s:%d] here\n",
getenv("RMS_RANK"), __FILE__, __LINE__);
}
if (offset == 0) { /* The first fragment uses a cached desc */
desc = ((mca_ptl_elan_send_request_t*)sendreq)->req_frag;

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

@ -104,7 +104,6 @@ ompi_init_elan_queue_events (mca_ptl_elan_module_t * ptl,
* there is no need to trigger a local event */
desc->comp_dma.dma_dstEvent = elan4_main2elan (ctx,
(void *) ptl->comp->input);
/*desc->main_dma.dma_srcEvent = SDRAM2ELAN (ctx, desc->elan_event);*/
desc->comp_dma.dma_srcEvent = 0x0ULL;
desc->comp_dma.dma_typeSize |= RUN_DMA_CMD;
desc->comp_dma.dma_pad = NOP_CMD;

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

@ -163,6 +163,8 @@ mca_ptl_elan_send_desc_done (
ptl = ((ompi_ptl_elan_qdma_desc_t *)desc->desc)->ptl;
header = &desc->frag_base.frag_header;
LOG_PRINT(PTL_ELAN_DEBUG_SEND, "req %p done frag %p \n", req, desc);
if(NULL == req) { /* An ack descriptor */
OMPI_FREE_LIST_RETURN (&ptl->queue->tx_desc_free,
(ompi_list_item_t *) desc);

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

@ -69,6 +69,13 @@ mca_ptl_elan_data_frag (struct mca_ptl_elan_module_t *ptl,
/* Copy the header, mca_ptl_base_match() does not do what it claims */
recv_frag->frag_recv.frag_base.frag_header = *header;
LOG_PRINT(PTL_ELAN_DEBUG_RECV,
"[recv header...] type %d src_ptr %p dst_ptr %p data %x\n",
header->hdr_common.hdr_type,
header->hdr_frag.hdr_src_ptr.pval,
header->hdr_frag.hdr_dst_ptr.pval,
(int)((char *) header + sizeof (mca_ptl_base_header_t)));
/* Taking the data starting point be default */
recv_frag->frag_recv.frag_base.frag_addr =
(char *) header + sizeof (mca_ptl_base_header_t);
@ -131,18 +138,18 @@ mca_ptl_elan_last_frag_ack (struct mca_ptl_elan_module_t *ptl,
/* XXX: Check if the sourc pointer points to the correct fragment */
desc = (mca_ptl_elan_send_frag_t*) header->hdr_ack.hdr_src_ptr.pval;
req = (mca_pml_base_send_request_t *) desc->desc->req;
req->req_peer_match = header->hdr_ack.hdr_dst_match;
req->req_peer_addr = header->hdr_ack.hdr_dst_addr;
req->req_peer_size = header->hdr_ack.hdr_dst_size;
LOG_PRINT(PTL_ELAN_DEBUG_ACK, "desc %p remote req %p addr %p, len %d\n",
header->hdr_ack.hdr_src_ptr.pval,
req->req_peer_match.pval,
req->req_peer_addr.pval,
req->req_peer_size);
LOG_PRINT(PTL_ELAN_DEBUG_ACK,
"desc %p remote req %p addr %p, len %d\n",
header->hdr_ack.hdr_src_ptr.pval,
req->req_peer_match.pval,
req->req_peer_addr.pval,
req->req_peer_size);
#if 1
if(fetchNset(&desc->frag_progressed, 1) == 0)
@ -268,10 +275,12 @@ mca_ptl_elan_init_qdma_desc (struct mca_ptl_elan_send_frag_t *frag,
header_length = sizeof (mca_ptl_base_frag_header_t);
}
LOG_PRINT(PTL_ELAN_DEBUG_SEND, "frag %p req %p addr %p offset %d\n",
hdr->hdr_frag.hdr_src_ptr.pval,
hdr->hdr_frag.hdr_dst_ptr.pval,
pml_req->req_base.req_addr, offset);
LOG_PRINT(PTL_ELAN_DEBUG_SEND,
"req %p frag %p dst_ptr %p addr %p offset %d \n",
pml_req,
hdr->hdr_frag.hdr_src_ptr.pval,
hdr->hdr_frag.hdr_dst_ptr.pval,
pml_req->req_base.req_addr, offset);
/* initialize convertor */
if(size_in > 0) {
@ -318,8 +327,15 @@ mca_ptl_elan_init_qdma_desc (struct mca_ptl_elan_send_frag_t *frag,
#if OMPI_PTL_ELAN_COMP_QUEUE
/* XXX: Chain a QDMA to each queue and
* Have all the srcEvent fired to the Queue */
* Have all the srcEvent fired to the Queue
*
* XXX: The chain dma will go directly into a command stream
* so we need addend the command queue control bits.
* Allocate space from command queues hanged off the CTX.
*/
desc->comp_event->ev_Params[1] = elan4_alloccq_space (ctx, 8, CQ_Size8K);
desc->comp_event->ev_CountAndType = E4_EVENT_INIT_VALUE(-32,
E4_EVENT_COPY, E4_EVENT_DTYPE_LONG, 8);
desc->comp_dma.dma_cookie = elan4_local_cookie(ptl->queue->tx_cpool,
E4_COOKIE_TYPE_LOCAL_DMA, ptl->elan_vp);
desc->comp_dma.dma_srcAddr = elan4_main2elan (ctx,
@ -327,22 +343,18 @@ mca_ptl_elan_init_qdma_desc (struct mca_ptl_elan_send_frag_t *frag,
memcpy ((void *)desc->comp_buff, (void *)&desc->comp_dma,
sizeof (E4_DMA64));
/* XXX: The chain dma will go directly into a command stream
* so we need addend the command queue control bits.
* Allocate space from command queues hanged off the CTX.
*/
desc->comp_event->ev_Params[1] = elan4_alloccq_space (ctx, 8, CQ_Size8K);
desc->main_dma.dma_srcEvent= elan4_main2elan(
ctx, (E4_Event *)desc->comp_event);
desc->main_dma.dma_srcAddr = MAIN2ELAN (ctx, &desc->buff[0]);
/* XXX: Hardcoded DMA retry count */
/* Initialize some of the dma structures
* XXX: Hardcoded DMA retry count */
desc->main_dma.dma_typeSize = E4_DMA_TYPE_SIZE ((header_length +
size_out),
DMA_DataTypeByte,
DMA_QueueWrite, 16);
desc->main_dma.dma_vproc = destvp;
desc->main_dma.dma_cookie= elan4_local_cookie (ptl->queue->tx_cpool,
E4_COOKIE_TYPE_LOCAL_DMA, destvp);
desc->main_dma.dma_vproc = destvp;
desc->main_dma.dma_srcEvent= elan4_main2elan(
ctx, (E4_Event *)desc->comp_event);
desc->main_dma.dma_srcAddr = MAIN2ELAN (ctx, &desc->buff[0]);
#else
desc->main_dma.dma_srcAddr = MAIN2ELAN (ctx, &desc->buff[0]);
/* XXX: Hardcoded DMA retry count */
@ -944,8 +956,6 @@ mca_ptl_elan_drain_recv (struct mca_ptl_elan_module_t *ptl)
ELAN_CTX *ctx;
int rc;
START_FUNC(PTL_ELAN_DEBUG_RECV);
queue = ptl->queue;
rxq = queue->rxq;
ctx = ptl->ptl_elan_ctx;
@ -962,12 +972,6 @@ mca_ptl_elan_drain_recv (struct mca_ptl_elan_module_t *ptl)
header = (mca_ptl_base_header_t *) rxq->qr_fptr;
LOG_PRINT(PTL_ELAN_DEBUG_MAC,
"[recv...] type %d flag %d size %d\n",
header->hdr_common.hdr_type,
header->hdr_common.hdr_flags,
header->hdr_common.hdr_size);
switch (header->hdr_common.hdr_type) {
case MCA_PTL_HDR_TYPE_MATCH:
case MCA_PTL_HDR_TYPE_FRAG:
@ -1020,7 +1024,6 @@ mca_ptl_elan_drain_recv (struct mca_ptl_elan_module_t *ptl)
}
OMPI_UNLOCK (&queue->rx_lock);
END_FUNC(PTL_ELAN_DEBUG_RECV);
return OMPI_SUCCESS;
}
@ -1046,8 +1049,9 @@ mca_ptl_elan_update_desc (struct mca_ptl_elan_module_t *ptl)
rc = elan4_pollevent_word (ctx, &rxq->qr_doneWord, 1);
#endif
if (rc) {
mca_ptl_elan_send_frag_t *frag;
mca_ptl_base_header_t *header;
ompi_ptl_elan_base_desc_t *basic;
OMPI_LOCK (&comp->rx_lock);
header = (mca_ptl_base_header_t *) rxq->qr_fptr;
@ -1058,9 +1062,15 @@ mca_ptl_elan_update_desc (struct mca_ptl_elan_module_t *ptl)
header->hdr_common.hdr_flags,
header->hdr_common.hdr_size);
/* FIXME: please fix this completion queue processing */
frag = (mca_ptl_elan_send_frag_t *)header->hdr_frag.hdr_src_ptr.pval;
basic = (ompi_ptl_elan_base_desc_t*)frag->desc;
/* FIXME: please reorganize this into a common routine */
/* XXX: please reset additional chained event for put/get desc */
mca_ptl_elan_send_desc_done (frag,
(mca_pml_base_send_request_t *) basic->req);
/* XXX: Reset the comp event, buggy */
/*PRIMEEVENT_WORD (ctx, basic->comp_event, 1);*/
/* Work out the new front pointer */
if (rxq->qr_fptr == rxq->qr_top) {

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

@ -52,32 +52,33 @@
#define PTL_ELAN_DEBUG_GET (0x400)
#define PTL_ELAN_DEBUG_CHAIN (0x800)
#define PTL_ELAN_DEBUG_FLAG (PTL_ELAN_DEBUG_MAC|PTL_ELAN_DEBUG_SEND)
#define PTL_ELAN_DEBUG_FLAG \
(PTL_ELAN_DEBUG_MAC|PTL_ELAN_DEBUG_SEND|PTL_ELAN_DEBUG_RECV|PTL_ELAN_DEBUG_PUT|PTL_ELAN_DEBUG_GET)
#define START_FUNC(flag) \
do { \
if (PTL_ELAN_DEBUG_FLAG & flag) { \
char hostname[32]; gethostname(hostname, 32); \
fprintf(stderr, "[%s:%s:%d] Entering ...\n", \
hostname, __FUNCTION__, __LINE__); \
char *rms_rank = getenv("RMS_RANK"); \
fprintf(stderr, "[proc%s:%s:%d] Entering ...\n", \
rms_rank, __FUNCTION__, __LINE__); \
} \
} while (0)
#define END_FUNC(flag) \
do { \
if (PTL_ELAN_DEBUG_FLAG & flag) { \
char hostname[32]; gethostname(hostname, 32); \
fprintf(stderr, "[%s:%s:%d] Completes ...\n", \
hostname, __FUNCTION__, __LINE__); \
char *rms_rank = getenv("RMS_RANK"); \
fprintf(stderr, "[proc%s:%s:%d] Completes ...\n", \
rms_rank, __FUNCTION__, __LINE__); \
} \
} while (0)
#define LOG_PRINT(flag, args...) \
do { \
if (PTL_ELAN_DEBUG_FLAG & flag) { \
char hostname[32]; gethostname(hostname, 32); \
fprintf(stderr, "[%s:%s:%d] ", \
hostname, __FUNCTION__, __LINE__); \
char *rms_rank = getenv("RMS_RANK"); \
fprintf(stderr, "[proc%s:%s:%d] ", \
rms_rank, __FUNCTION__, __LINE__); \
fprintf(stderr, args); \
} \
} while (0)

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

@ -6,7 +6,7 @@
#include "test_util.h"
#define MYBUFSIZE (4*1024*1024)
#define CHECK 1
#define CHECK 0
#define PONG 0
char s_buf[MYBUFSIZE];
@ -16,8 +16,6 @@ int skip = 0;
int
main (int argc, char *argv[])
{
char hostname[32];
int myid, numprocs, i, j;
double startwtime = 0.0, endwtime;
int namelen;
@ -26,6 +24,8 @@ main (int argc, char *argv[])
MPI_Status stat;
int sleep = 1;
/*while (sleep > 0);*/
struct timeval t_start, t_end;
loop = 2;
@ -51,11 +51,9 @@ main (int argc, char *argv[])
s_buf[i] = 'A';
}
gethostname(hostname, 32);
fprintf(stdout, "[%s:%s:%d] done with init and barrier\n",
hostname, __FUNCTION__, __LINE__);
fflush(stdout);
fprintf(stderr, "[proc%d:%s:%d] done with init, to loop %d \n",
myid, __FUNCTION__, __LINE__, loop);
fflush(stderr);
for (i = 0; i < loop + skip; i++) {
if (i == skip)
@ -73,8 +71,8 @@ main (int argc, char *argv[])
if (CHECK && myid != 0) {
for (j=0; j < size; j ++) {
if (r_buf[j] != 'A') {
fprintf(stderr, "[%s:%s] error from byte %d \n",
hostname, __FUNCTION__, j);
fprintf(stderr, "[proc%d:%s] error from byte %d \n",
myid, __FUNCTION__, j);
break;
} else {
r_buf[j] = '0';
@ -84,9 +82,9 @@ main (int argc, char *argv[])
}
gettimeofday (&t_end, 0);
fprintf(stdout, "[%s:%s:%d] done with pingpong\n",
hostname, __FUNCTION__, __LINE__);
fflush(stdout);
fprintf(stderr, "[proc%d:%s:%d] done with pingpong\n",
myid, __FUNCTION__, __LINE__);
fflush(stderr);
if (myid == 0) {
double latency;