1
1
This commit essentially caches the invoking comm/win/file on the
ompi_request_t. This, paired with the req_type field, allows us to
retrieve the invoking MPI object and invoke the proper errhandler.

The patch is missing most updates for the MPI-2 one-sided stuff (i.e.,
the patch mainly fixes comms and files); I didn't really understand
that code and didn't want to hazard trying to figure it out when Brian
can probably do it much more quickly.

So #250 will still stay open, pending MPI-2 one-sided updates for this
stuff.

This commit was SVN r12339.

The following Trac tickets were found above:
  Ticket 250 --> https://svn.open-mpi.org/trac/ompi/ticket/250
Этот коммит содержится в:
Jeff Squyres 2006-10-27 12:35:27 +00:00
родитель e02114dcf3
Коммит 020efdf1f9
12 изменённых файлов: 99 добавлений и 6 удалений

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -35,6 +36,9 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
for (i = 0 ; i < count ; i++) {
mca_pml_cm_request_t *pml_request =
(mca_pml_cm_request_t*)requests[i];
if (OMPI_REQUEST_PML != requests[i]->req_type) {
continue;
}
if (NULL == pml_request) {
/* opal_output(0, "hmm, null request!\n"); */
continue;

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -29,6 +30,9 @@ int mca_pml_dr_start(size_t count, ompi_request_t** requests)
size_t i;
for(i=0; i<count; i++) {
mca_pml_base_request_t *pml_request = (mca_pml_base_request_t*)requests[i];
if (OMPI_REQUEST_PML != requests[i]->req_type) {
continue;
}
if(NULL == pml_request)
continue;

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -31,6 +32,9 @@ int mca_pml_ob1_start(size_t count, ompi_request_t** requests)
for(i=0; i<count; i++) {
mca_pml_base_request_t *pml_request = (mca_pml_base_request_t*)requests[i];
if (OMPI_REQUEST_PML != requests[i]->req_type) {
continue;
}
if(NULL == pml_request)
continue;

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -59,7 +60,15 @@ int MPI_Bsend_init(void *buf, int count, MPI_Datatype type,
}
if (MPI_PROC_NULL == dest) {
*request = &ompi_request_empty;
*request = OBJ_NEW(ompi_request_t);
/* Other fields were initialized by the constructor for
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = true;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
}

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -56,7 +57,15 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source,
}
if (MPI_PROC_NULL == source) {
*request = &ompi_request_empty;
*request = OBJ_NEW(ompi_request_t);
/* Other fields were initialized by the constructor for
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = true;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
}

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -60,7 +61,15 @@ int MPI_Rsend_init(void *buf, int count, MPI_Datatype type,
}
if (MPI_PROC_NULL == dest) {
*request = &ompi_request_empty;
*request = OBJ_NEW(ompi_request_t);
/* Other fields were initialized by the constructor for
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = true;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
}

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -62,7 +63,15 @@ int MPI_Send_init(void *buf, int count, MPI_Datatype type,
}
if (MPI_PROC_NULL == dest) {
*request = &ompi_request_empty;
*request = OBJ_NEW(ompi_request_t);
/* Other fields were initialized by the constructor for
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = true;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
}

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -60,7 +61,15 @@ int MPI_Ssend_init(void *buf, int count, MPI_Datatype type,
}
if (MPI_PROC_NULL == dest) {
*request = &ompi_request_empty;
*request = OBJ_NEW(ompi_request_t);
/* Other fields were initialized by the constructor for
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = true;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
}

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -21,6 +22,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/mca/pml/pml.h"
#include "ompi/request/request.h"
#include "ompi/errhandler/errhandler.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Start = PMPI_Start
@ -47,8 +49,14 @@ int MPI_Start(MPI_Request *request)
switch((*request)->req_type) {
case OMPI_REQUEST_PML:
return MCA_PML_CALL(start(1, request));
default:
break;
case OMPI_REQUEST_NOOP:
return MPI_SUCCESS;
break;
default:
OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST, FUNC_NAME);
}
}

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -20,6 +21,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/mca/pml/pml.h"
#include "ompi/request/request.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Startall = PMPI_Startall
@ -34,6 +36,8 @@ static const char FUNC_NAME[] = "MPI_Startall";
int MPI_Startall(int count, MPI_Request *requests)
{
int i;
if ( MPI_PARAM_CHECK ) {
int rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
@ -42,6 +46,13 @@ int MPI_Startall(int count, MPI_Request *requests)
} else if (count < 0) {
rc = MPI_ERR_ARG;
}
for (i = 0; i < count; ++i) {
if (OMPI_REQUEST_PML != requests[i]->req_type &&
OMPI_REQUEST_NOOP != requests[i]->req_type) {
rc = MPI_ERR_REQUEST;
break;
}
}
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
return MCA_PML_CALL(start(count, requests));

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -63,6 +64,13 @@ static int ompi_request_empty_free(ompi_request_t** request)
return OMPI_SUCCESS;
}
int ompi_request_persistent_proc_null_free(ompi_request_t** request)
{
(*request)->req_state = OMPI_REQUEST_INVALID;
OBJ_RELEASE(*request);
return OMPI_SUCCESS;
}
OBJ_CLASS_INSTANCE(
ompi_request_t,

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -183,6 +184,14 @@ OMPI_DECLSPEC extern ompi_status_public_t ompi_status_empty;
OMPI_DECLSPEC int ompi_request_init(void);
/**
* Free a persistent request to a MPI_PROC_NULL peer (there's no
* freelist to put it back to, so we have to actually OBJ_RELEASE it).
*/
OMPI_DECLSPEC int ompi_request_persistent_proc_null_free(ompi_request_t **request);
/**
* Shut down the MPI_Request subsystem; invoked during MPI_FINALIZE.
*/