1
1

ompi/request: Add ompi_request_persistent_noop_create

Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
Этот коммит содержится в:
KAWASHIMA Takahiro 2018-02-20 09:52:25 +09:00
родитель 9a63dacf1c
Коммит e72f510daf
7 изменённых файлов: 46 добавлений и 57 удалений

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

@ -15,6 +15,7 @@
* reserved. * reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -74,16 +75,8 @@ int MPI_Bsend_init(const void *buf, int count, MPI_Datatype type,
} }
if (MPI_PROC_NULL == dest) { if (MPI_PROC_NULL == dest) {
*request = OBJ_NEW(ompi_request_t); rc = ompi_request_persistent_noop_create(request);
/* Other fields were initialized by the constructor for OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = REQUEST_COMPLETED;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
} }
OPAL_CR_ENTER_LIBRARY(); OPAL_CR_ENTER_LIBRARY();

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

@ -12,6 +12,7 @@
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -70,16 +71,8 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source,
} }
if (MPI_PROC_NULL == source) { if (MPI_PROC_NULL == source) {
*request = OBJ_NEW(ompi_request_t); rc = ompi_request_persistent_noop_create(request);
/* Other fields were initialized by the constructor for OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = REQUEST_COMPLETED;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
} }
OPAL_CR_ENTER_LIBRARY(); OPAL_CR_ENTER_LIBRARY();

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

@ -15,6 +15,7 @@
* reserved. * reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -75,16 +76,8 @@ int MPI_Rsend_init(const void *buf, int count, MPI_Datatype type,
} }
if (MPI_PROC_NULL == dest) { if (MPI_PROC_NULL == dest) {
*request = OBJ_NEW(ompi_request_t); rc = ompi_request_persistent_noop_create(request);
/* Other fields were initialized by the constructor for OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = REQUEST_COMPLETED;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
} }
OPAL_CR_ENTER_LIBRARY(); OPAL_CR_ENTER_LIBRARY();

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

@ -15,6 +15,7 @@
* reserved. * reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -75,16 +76,8 @@ int MPI_Send_init(const void *buf, int count, MPI_Datatype type,
} }
if (MPI_PROC_NULL == dest) { if (MPI_PROC_NULL == dest) {
*request = OBJ_NEW(ompi_request_t); rc = ompi_request_persistent_noop_create(request);
/* Other fields were initialized by the constructor for OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = REQUEST_COMPLETED;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
} }
OPAL_CR_ENTER_LIBRARY(); OPAL_CR_ENTER_LIBRARY();

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

@ -15,6 +15,7 @@
* reserved. * reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -75,16 +76,8 @@ int MPI_Ssend_init(const void *buf, int count, MPI_Datatype type,
} }
if (MPI_PROC_NULL == dest) { if (MPI_PROC_NULL == dest) {
*request = OBJ_NEW(ompi_request_t); rc = ompi_request_persistent_noop_create(request);
/* Other fields were initialized by the constructor for OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
ompi_request_t */
(*request)->req_type = OMPI_REQUEST_NOOP;
(*request)->req_status = ompi_request_empty.req_status;
(*request)->req_complete = REQUEST_COMPLETED;
(*request)->req_state = OMPI_REQUEST_INACTIVE;
(*request)->req_persistent = true;
(*request)->req_free = ompi_request_persistent_proc_null_free;
return MPI_SUCCESS;
} }
OPAL_CR_ENTER_LIBRARY(); OPAL_CR_ENTER_LIBRARY();

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

@ -17,6 +17,7 @@
* reserved. * reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -86,7 +87,7 @@ static int ompi_request_empty_free(ompi_request_t** request)
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
int ompi_request_persistent_proc_null_free(ompi_request_t** request) static int ompi_request_persistent_noop_free(ompi_request_t** request)
{ {
OMPI_REQUEST_FINI(*request); OMPI_REQUEST_FINI(*request);
(*request)->req_state = OMPI_REQUEST_INVALID; (*request)->req_state = OMPI_REQUEST_INVALID;
@ -185,3 +186,26 @@ int ompi_request_finalize(void)
OBJ_DESTRUCT( &ompi_request_f_to_c_table ); OBJ_DESTRUCT( &ompi_request_f_to_c_table );
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
int ompi_request_persistent_noop_create(ompi_request_t** request)
{
ompi_request_t *req;
req = OBJ_NEW(ompi_request_t);
if (NULL == req) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
/* Other fields were initialized by the constructor for
ompi_request_t */
req->req_type = OMPI_REQUEST_NOOP;
req->req_status = ompi_request_empty.req_status;
req->req_complete = REQUEST_COMPLETED;
req->req_state = OMPI_REQUEST_INACTIVE;
req->req_persistent = true;
req->req_free = ompi_request_persistent_noop_free;
*request = req;
return OMPI_SUCCESS;
}

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

@ -15,6 +15,7 @@
* Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights * Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -348,17 +349,16 @@ OMPI_DECLSPEC extern ompi_request_fns_t ompi_request_functions;
*/ */
int ompi_request_init(void); 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. * Shut down the MPI_Request subsystem; invoked during MPI_FINALIZE.
*/ */
int ompi_request_finalize(void); int ompi_request_finalize(void);
/**
* Create a persistent request that does nothing (e.g., to MPI_PROC_NULL).
*/
int ompi_request_persistent_noop_create(ompi_request_t **request);
/** /**
* Cancel a pending request. * Cancel a pending request.
*/ */