re-implemented wait
This commit was SVN r915.
Этот коммит содержится в:
родитель
3364dc51e2
Коммит
96f263403a
@ -81,7 +81,7 @@ typedef int (*mca_pml_base_progress_fn_t)(void);
|
|||||||
|
|
||||||
typedef int (*mca_pml_base_irecv_init_fn_t)(
|
typedef int (*mca_pml_base_irecv_init_fn_t)(
|
||||||
void *buf,
|
void *buf,
|
||||||
size_t size,
|
size_t count,
|
||||||
struct lam_datatype_t *datatype,
|
struct lam_datatype_t *datatype,
|
||||||
int src,
|
int src,
|
||||||
int tag,
|
int tag,
|
||||||
@ -91,7 +91,7 @@ typedef int (*mca_pml_base_irecv_init_fn_t)(
|
|||||||
|
|
||||||
typedef int (*mca_pml_base_irecv_fn_t)(
|
typedef int (*mca_pml_base_irecv_fn_t)(
|
||||||
void *buf,
|
void *buf,
|
||||||
size_t size,
|
size_t count,
|
||||||
struct lam_datatype_t *datatype,
|
struct lam_datatype_t *datatype,
|
||||||
int src,
|
int src,
|
||||||
int tag,
|
int tag,
|
||||||
@ -101,7 +101,7 @@ typedef int (*mca_pml_base_irecv_fn_t)(
|
|||||||
|
|
||||||
typedef int (*mca_pml_base_recv_fn_t)(
|
typedef int (*mca_pml_base_recv_fn_t)(
|
||||||
void *buf,
|
void *buf,
|
||||||
size_t size,
|
size_t count,
|
||||||
struct lam_datatype_t *datatype,
|
struct lam_datatype_t *datatype,
|
||||||
int src,
|
int src,
|
||||||
int tag,
|
int tag,
|
||||||
@ -111,7 +111,7 @@ typedef int (*mca_pml_base_recv_fn_t)(
|
|||||||
|
|
||||||
typedef int (*mca_pml_base_isend_init_fn_t)(
|
typedef int (*mca_pml_base_isend_init_fn_t)(
|
||||||
void *buf,
|
void *buf,
|
||||||
size_t size,
|
size_t count,
|
||||||
struct lam_datatype_t *datatype,
|
struct lam_datatype_t *datatype,
|
||||||
int dst,
|
int dst,
|
||||||
int tag,
|
int tag,
|
||||||
@ -122,7 +122,7 @@ typedef int (*mca_pml_base_isend_init_fn_t)(
|
|||||||
|
|
||||||
typedef int (*mca_pml_base_isend_fn_t)(
|
typedef int (*mca_pml_base_isend_fn_t)(
|
||||||
void *buf,
|
void *buf,
|
||||||
size_t size,
|
size_t count,
|
||||||
struct lam_datatype_t *datatype,
|
struct lam_datatype_t *datatype,
|
||||||
int dst,
|
int dst,
|
||||||
int tag,
|
int tag,
|
||||||
@ -133,7 +133,7 @@ typedef int (*mca_pml_base_isend_fn_t)(
|
|||||||
|
|
||||||
typedef int (*mca_pml_base_send_fn_t)(
|
typedef int (*mca_pml_base_send_fn_t)(
|
||||||
void *buf,
|
void *buf,
|
||||||
size_t size,
|
size_t count,
|
||||||
struct lam_datatype_t *datatype,
|
struct lam_datatype_t *datatype,
|
||||||
int dst,
|
int dst,
|
||||||
int tag,
|
int tag,
|
||||||
@ -159,7 +159,7 @@ typedef int (*mca_pml_base_wait_fn_t)(
|
|||||||
);
|
);
|
||||||
|
|
||||||
typedef int (*mca_pml_base_wait_all_fn_t)(
|
typedef int (*mca_pml_base_wait_all_fn_t)(
|
||||||
int count, /* size of request/status arrays */
|
int count, /* count of request/status arrays */
|
||||||
lam_request_t** request, /* array of requests */
|
lam_request_t** request, /* array of requests */
|
||||||
lam_status_public_t *status /* array of statuses */
|
lam_status_public_t *status /* array of statuses */
|
||||||
);
|
);
|
||||||
|
@ -33,8 +33,8 @@ struct mca_pml_teg_t {
|
|||||||
mca_ptl_t** teg_ptls;
|
mca_ptl_t** teg_ptls;
|
||||||
size_t teg_num_ptls;
|
size_t teg_num_ptls;
|
||||||
|
|
||||||
lam_list_t teg_procs;
|
lam_list_t teg_procs;
|
||||||
lam_mutex_t teg_lock;
|
lam_mutex_t teg_lock;
|
||||||
|
|
||||||
int teg_free_list_num; /* initial size of free list */
|
int teg_free_list_num; /* initial size of free list */
|
||||||
int teg_free_list_max; /* maximum size of free list */
|
int teg_free_list_max; /* maximum size of free list */
|
||||||
|
@ -10,35 +10,51 @@ int mca_pml_teg_wait(
|
|||||||
int *index,
|
int *index,
|
||||||
lam_status_public_t* status)
|
lam_status_public_t* status)
|
||||||
{
|
{
|
||||||
#if 0
|
int c, i;
|
||||||
mca_pml_base_request_t* pml_request = *(mca_pml_base_request_t**)request;
|
int completed = -1;
|
||||||
if(pml_request->req_mpi_done == false) {
|
mca_pml_base_request_t* pml_request;
|
||||||
|
|
||||||
/* poll for completion - primarily for benchmarks */
|
/* poll for completion */
|
||||||
int i;
|
for(c=0; completed < 0 && c < mca_pml_teg.teg_poll_iterations; c++) {
|
||||||
for(i=0; i<mca_pml_teg.teg_poll_iterations && pml_request->req_mpi_done == false; i++)
|
for(i=0; i<count; i++) {
|
||||||
; /* do nothing */
|
pml_request = (mca_pml_base_request_t*)request[i];
|
||||||
|
if(pml_request == NULL)
|
||||||
/* if not complete - sleep on condition variable until a request completes */
|
continue;
|
||||||
if(pml_request->req_mpi_done == false) {
|
if(pml_request->req_mpi_done == true) {
|
||||||
lam_mutex_lock(&mca_pml_teg.teg_request_lock);
|
completed = i;
|
||||||
mca_pml_teg.teg_request_waiting++;
|
break;
|
||||||
while(pml_request->req_mpi_done == false)
|
}
|
||||||
lam_condition_wait(&mca_pml_teg.teg_request_cond, &mca_pml_teg.teg_request_lock);
|
|
||||||
mca_pml_teg.teg_request_waiting--;
|
|
||||||
lam_mutex_unlock(&mca_pml_teg.teg_request_lock);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(completed < 0) {
|
||||||
|
/* give up and sleep until completion */
|
||||||
|
lam_mutex_lock(&mca_pml_teg.teg_request_lock);
|
||||||
|
mca_pml_teg.teg_request_waiting++;
|
||||||
|
while(completed < 0) {
|
||||||
|
for(i=0; i<count; i++) {
|
||||||
|
pml_request = (mca_pml_base_request_t*)request[i];
|
||||||
|
if(pml_request->req_mpi_done == true) {
|
||||||
|
completed = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
lam_condition_wait(&mca_pml_teg.teg_request_cond, &mca_pml_teg.teg_request_lock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mca_pml_teg.teg_request_waiting--;
|
||||||
|
lam_mutex_unlock(&mca_pml_teg.teg_request_lock);
|
||||||
|
}
|
||||||
|
|
||||||
/* return request to pool */
|
/* return request to pool */
|
||||||
if(pml_request->req_persistent == false) {
|
if(pml_request->req_persistent == false) {
|
||||||
mca_pml_teg_free(request);
|
mca_pml_teg_free(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != NULL) {
|
if (status != NULL) {
|
||||||
*status = pml_request->req_status;
|
*status = pml_request->req_status;
|
||||||
}
|
}
|
||||||
#endif
|
if (index != NULL) {
|
||||||
|
*index = completed;
|
||||||
|
}
|
||||||
return LAM_SUCCESS;
|
return LAM_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ int MPI_Isend(void *buf, int count, MPI_Datatype type, int dest,
|
|||||||
if (dest == MPI_PROC_NULL) {
|
if (dest == MPI_PROC_NULL) {
|
||||||
return MPI_SUCCESS;
|
return MPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( MPI_PARAM_CHECK ) {
|
if ( MPI_PARAM_CHECK ) {
|
||||||
int rc = MPI_SUCCESS;
|
int rc = MPI_SUCCESS;
|
||||||
if (lam_mpi_finalized) {
|
if (lam_mpi_finalized) {
|
||||||
@ -44,7 +44,7 @@ int MPI_Isend(void *buf, int count, MPI_Datatype type, int dest,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return mca_pml.pml_isend(buf,count,type,dest,tag,MCA_PML_BASE_SEND_STANDARD,comm,request);
|
return mca_pml.pml_isend(buf,count,type,dest,tag,MCA_PML_BASE_SEND_STANDARD,comm,request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user