d49b07b390
A new global structure (ompi_request_functions) holding all the pointers to the wait/test functions have been added. ompi_request_wait* and ompi_request_test* have been #defined to be replaced by ompi_request_functions.req_wait. The default implementations of the wait/test functions names have been changed from ompi_request_% to ompi_request_default_%. Those functions are static initializer of the ompi_request_functions structure. To modify the defaults, a components 1) copy the ompi_request_functions structure (the type ompi_request_fns_t can be used to declare a suitable variable), 2) change some of the functions according to its needs. This is best done at MPI_init time when there is no threads. Should this component be unloaded it have to restore the defaults. The ompi_request_default_* functions should never be called directly anywhere in the code. If a component needs to access the previously defined implementation of wait, it should call its local copy of the function. Component implementors should keep in mind that another component might have already changed the defaults and needs to be called. This commit was SVN r16862.
72 строки
2.4 KiB
C
72 строки
2.4 KiB
C
/*
|
|
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
|
* of Tennessee Research Foundation. All rights
|
|
* reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#ifndef OMPI_REQUEST_DEFAULT_H
|
|
#define OMPI_REQUEST_DEFAULT_H
|
|
|
|
#include "ompi/request/request.h"
|
|
|
|
BEGIN_C_DECLS
|
|
|
|
/** Defaults implementations for all request completions
|
|
*/
|
|
int ompi_request_default_test(
|
|
ompi_request_t ** rptr,
|
|
int *completed,
|
|
ompi_status_public_t * status );
|
|
|
|
int ompi_request_default_test_any(
|
|
size_t count,
|
|
ompi_request_t ** requests,
|
|
int *index,
|
|
int *completed,
|
|
ompi_status_public_t * status);
|
|
|
|
int ompi_request_default_test_all(
|
|
size_t count,
|
|
ompi_request_t ** requests,
|
|
int *completed,
|
|
ompi_status_public_t * statuses);
|
|
|
|
int ompi_request_default_test_some(
|
|
size_t count,
|
|
ompi_request_t ** requests,
|
|
int * outcount,
|
|
int * indices,
|
|
ompi_status_public_t * statuses);
|
|
|
|
int ompi_request_default_wait(
|
|
ompi_request_t ** req_ptr,
|
|
ompi_status_public_t * status);
|
|
|
|
int ompi_request_default_wait_any(
|
|
size_t count,
|
|
ompi_request_t ** requests,
|
|
int *index,
|
|
ompi_status_public_t * status);
|
|
|
|
int ompi_request_default_wait_all(
|
|
size_t count,
|
|
ompi_request_t ** requests,
|
|
ompi_status_public_t * statuses);
|
|
|
|
int ompi_request_default_wait_some(
|
|
size_t count,
|
|
ompi_request_t ** requests,
|
|
int * outcount,
|
|
int * indices,
|
|
ompi_status_public_t * statuses);
|
|
|
|
END_C_DECLS
|
|
|
|
#endif
|
|
|