2006-01-28 18:38:37 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
2011-10-04 18:50:31 +04:00
|
|
|
* Copyright (c) 2004-2011 The Trustees of the University of Tennessee.
|
2006-01-28 18:38:37 +03:00
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2007-07-19 02:56:33 +04:00
|
|
|
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2010-07-20 22:45:48 +04:00
|
|
|
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
2006-01-28 18:38:37 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
2007-07-19 02:56:33 +04:00
|
|
|
* One-sided Communication interface
|
2006-01-28 18:38:37 +03:00
|
|
|
*
|
2007-07-19 02:56:33 +04:00
|
|
|
* Interface for implementing the one-sided communication chapter of
|
|
|
|
* the MPI-2 standard. Similar in scope to the PML for point-to-point
|
|
|
|
* communication from MPI-1.
|
2006-01-28 18:38:37 +03:00
|
|
|
*/
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
#ifndef OMPI_MCA_OSC_OSC_H
|
|
|
|
#define OMPI_MCA_OSC_OSC_H
|
2006-01-28 18:38:37 +03:00
|
|
|
|
2010-07-20 22:45:48 +04:00
|
|
|
#include "opal_config.h"
|
|
|
|
|
|
|
|
#ifdef HAVE_STDDEF_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#endif
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/mca.h"
|
2006-01-28 18:38:37 +03:00
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
BEGIN_C_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************************************************************** */
|
|
|
|
|
2006-08-24 20:38:08 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
struct ompi_win_t;
|
|
|
|
struct ompi_info_t;
|
|
|
|
struct ompi_communicator_t;
|
|
|
|
struct ompi_group_t;
|
|
|
|
struct ompi_datatype_t;
|
|
|
|
struct ompi_op_t;
|
|
|
|
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/* ******************************************************************** */
|
2006-01-28 18:38:37 +03:00
|
|
|
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/**
|
|
|
|
* OSC component initialization
|
|
|
|
*
|
|
|
|
* Initialize the given one-sided component. This function should
|
|
|
|
* initialize any component-level data.
|
|
|
|
|
|
|
|
* @note The component framework is not lazily opened, so attempts
|
|
|
|
* should be made to minimize the amount of memory allocated during
|
|
|
|
* this function.
|
|
|
|
*
|
|
|
|
* @param[in] enable_progress_threads True if the component needs to
|
|
|
|
* support progress threads
|
|
|
|
* @param[in] enable_mpi_threads True if the component needs to
|
|
|
|
* support MPI_THREAD_MULTIPLE
|
|
|
|
*
|
2011-10-04 18:50:31 +04:00
|
|
|
* @retval OMPI_SUCCESS Component successfully initialized
|
|
|
|
* @retval OMPI_ERROR An unspecified error occurred
|
2007-07-19 02:56:33 +04:00
|
|
|
*/
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_component_init_fn_t)(bool enable_progress_threads,
|
2007-07-19 02:56:33 +04:00
|
|
|
bool enable_mpi_threads);
|
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/**
|
|
|
|
* OSC component finalization
|
|
|
|
*
|
|
|
|
* Finalize the given one-sided component. This function should clean
|
|
|
|
* up any component-level data allocated during component_init(). It
|
|
|
|
* should also clean up any data created during the lifetime of the
|
|
|
|
* component, including any modules that are outstanding.
|
|
|
|
*
|
2011-10-04 18:50:31 +04:00
|
|
|
* @retval OMPI_SUCCESS Component successfully finalized
|
|
|
|
* @retval OMPI_ERROR An unspecified error occurred
|
2007-07-19 02:56:33 +04:00
|
|
|
*/
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_component_finalize_fn_t)(void);
|
|
|
|
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/**
|
|
|
|
* OSC component query
|
|
|
|
*
|
|
|
|
* Query whether, given the info and comm, the component can be used
|
|
|
|
* for one-sided support. The ability to use the component for the
|
|
|
|
* window does not mean that the component will be selected. The win
|
|
|
|
* argument should not be modified during this call and no memory
|
|
|
|
* should be allocated that is associated with this window.
|
|
|
|
*
|
|
|
|
* @return The selection priority of the component
|
|
|
|
*
|
|
|
|
* @param[in] win The window handle, already filled in by MPI_WIN_CREATE()
|
|
|
|
* @param[in] info An info structure with hints from the user
|
|
|
|
* regarding the usage of the component
|
|
|
|
* @param[in] comm The communicator specified by the user for the
|
|
|
|
* basis of the group membership for the Window.
|
|
|
|
*
|
|
|
|
* @retval -1 The component can not be used for this window
|
|
|
|
* @retval >= 0 The priority of the component for this window
|
|
|
|
*/
|
|
|
|
typedef int (*ompi_osc_base_component_query_fn_t)(struct ompi_win_t *win,
|
2006-01-28 18:38:37 +03:00
|
|
|
struct ompi_info_t *info,
|
|
|
|
struct ompi_communicator_t *comm);
|
|
|
|
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/**
|
|
|
|
* OSC component select
|
|
|
|
*
|
|
|
|
* This component has been selected to provide one-sided services for
|
|
|
|
* the given window. The win->w_osc_module field can be updated and
|
|
|
|
* memory can be associated with this window. The module should be
|
|
|
|
* ready for use immediately upon return of this function, and the
|
|
|
|
* module is responsible for providing any required collective
|
|
|
|
* synchronization before the end of the call.
|
|
|
|
*
|
|
|
|
* @note The comm is the communicator specified from the user, so
|
|
|
|
* normal internal usage rules apply. In other words, if you need
|
|
|
|
* communication for the life of the window, you should call
|
|
|
|
* comm_dup() during this function.
|
|
|
|
*
|
|
|
|
* @param[in/out] win The window handle, already filled in by MPI_WIN_CREATE()
|
|
|
|
* @param[in] info An info structure with hints from the user
|
|
|
|
* regarding the usage of the component
|
|
|
|
* @param[in] comm The communicator specified by the user for the
|
|
|
|
* basis of the group membership for the Window.
|
|
|
|
*
|
2011-10-04 18:50:31 +04:00
|
|
|
* @retval OMPI_SUCCESS Component successfully selected
|
|
|
|
* @retval OMPI_ERROR An unspecified error occurred
|
2006-01-28 18:38:37 +03:00
|
|
|
*/
|
2007-07-19 02:56:33 +04:00
|
|
|
typedef int (*ompi_osc_base_component_select_fn_t)(struct ompi_win_t *win,
|
|
|
|
struct ompi_info_t *info,
|
|
|
|
struct ompi_communicator_t *comm);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* OSC component interface
|
|
|
|
*
|
|
|
|
* Component interface for the OSC framework. A public instance of
|
|
|
|
* this structure, called mca_osc_[component_name]_component, must
|
|
|
|
* exist in any OSC component.
|
|
|
|
*/
|
2008-07-29 02:40:57 +04:00
|
|
|
struct ompi_osc_base_component_2_0_0_t {
|
2007-07-19 02:56:33 +04:00
|
|
|
/** Base component description */
|
|
|
|
mca_base_component_t osc_version;
|
|
|
|
/** Base component data block */
|
2008-07-29 02:40:57 +04:00
|
|
|
mca_base_component_data_t osc_data;
|
2007-07-19 02:56:33 +04:00
|
|
|
/** Component initialization function */
|
|
|
|
ompi_osc_base_component_init_fn_t osc_init;
|
|
|
|
/** Query whether component is useable for give comm/info */
|
|
|
|
ompi_osc_base_component_query_fn_t osc_query;
|
|
|
|
/** Create module for the given window */
|
|
|
|
ompi_osc_base_component_select_fn_t osc_select;
|
|
|
|
/* Finalize the component infrastructure */
|
|
|
|
ompi_osc_base_component_finalize_fn_t osc_finalize;
|
|
|
|
};
|
2008-07-29 02:40:57 +04:00
|
|
|
typedef struct ompi_osc_base_component_2_0_0_t ompi_osc_base_component_2_0_0_t;
|
|
|
|
typedef ompi_osc_base_component_2_0_0_t ompi_osc_base_component_t;
|
2007-07-19 02:56:33 +04:00
|
|
|
|
|
|
|
|
|
|
|
/* ******************************************************************** */
|
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Free resources associated with win
|
|
|
|
*
|
|
|
|
* Free all resources associated with \c win. The component must
|
|
|
|
* provide the barrier semantics required by MPI-2 6.2.1. The caller
|
|
|
|
* will guarantee that no new calls into the module are made after the
|
|
|
|
* start of this call. It is possible that the window is locked by
|
2007-07-19 02:56:33 +04:00
|
|
|
* remote processes. win->w_flags will have OMPI_WIN_FREED set before
|
2006-01-28 18:38:37 +03:00
|
|
|
* this function is called.
|
2007-07-19 02:56:33 +04:00
|
|
|
*
|
|
|
|
* @param[in] win Window to free
|
|
|
|
*
|
2011-10-04 18:50:31 +04:00
|
|
|
* @retval OMPI_SUCCESS Component successfully selected
|
|
|
|
* @retval OMPI_ERROR An unspecified error occurred
|
2006-01-28 18:38:37 +03:00
|
|
|
*/
|
|
|
|
typedef int (*ompi_osc_base_module_free_fn_t)(struct ompi_win_t *win);
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_put_fn_t)(void *origin_addr,
|
|
|
|
int origin_count,
|
|
|
|
struct ompi_datatype_t *origin_dt,
|
|
|
|
int target,
|
2010-07-20 22:45:48 +04:00
|
|
|
OPAL_PTRDIFF_TYPE target_disp,
|
2006-01-28 18:38:37 +03:00
|
|
|
int target_count,
|
|
|
|
struct ompi_datatype_t *target_dt,
|
|
|
|
struct ompi_win_t *win);
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_get_fn_t)(void *origin_addr,
|
|
|
|
int origin_count,
|
|
|
|
struct ompi_datatype_t *origin_dt,
|
|
|
|
int target,
|
2010-07-20 22:45:48 +04:00
|
|
|
OPAL_PTRDIFF_TYPE target_disp,
|
2006-01-28 18:38:37 +03:00
|
|
|
int target_count,
|
|
|
|
struct ompi_datatype_t *target_dt,
|
|
|
|
struct ompi_win_t *win);
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_accumulate_fn_t)(void *origin_addr,
|
|
|
|
int origin_count,
|
|
|
|
struct ompi_datatype_t *origin_dt,
|
|
|
|
int target,
|
2010-07-20 22:45:48 +04:00
|
|
|
OPAL_PTRDIFF_TYPE target_disp,
|
2006-01-28 18:38:37 +03:00
|
|
|
int target_count,
|
|
|
|
struct ompi_datatype_t *target_dt,
|
|
|
|
struct ompi_op_t *op,
|
|
|
|
struct ompi_win_t *win);
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_fence_fn_t)(int assert, struct ompi_win_t *win);
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_start_fn_t)(struct ompi_group_t *group,
|
|
|
|
int assert,
|
|
|
|
struct ompi_win_t *win);
|
2007-07-19 02:56:33 +04:00
|
|
|
|
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_complete_fn_t)(struct ompi_win_t *win);
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_post_fn_t)(struct ompi_group_t *group,
|
|
|
|
int assert,
|
|
|
|
struct ompi_win_t *win);
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_wait_fn_t)(struct ompi_win_t *win);
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_test_fn_t)(struct ompi_win_t *win,
|
2006-01-31 05:44:08 +03:00
|
|
|
int *flag);
|
2006-01-28 18:38:37 +03:00
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_lock_fn_t)(int lock_type,
|
|
|
|
int target,
|
|
|
|
int assert,
|
|
|
|
struct ompi_win_t *win);
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
typedef int (*ompi_osc_base_module_unlock_fn_t)(int target,
|
|
|
|
struct ompi_win_t *win);
|
|
|
|
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/* ******************************************************************** */
|
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
|
|
|
|
/**
|
2007-07-19 02:56:33 +04:00
|
|
|
* OSC module instance
|
|
|
|
*
|
|
|
|
* Module interface to the OSC system. An instance of this module is
|
|
|
|
* attached to each window. The window contains a pointer to the base
|
|
|
|
* module instead of a base module itself so that the component is
|
|
|
|
* free to create a structure that inherits this one for use as the
|
|
|
|
* module structure.
|
2006-01-28 18:38:37 +03:00
|
|
|
*/
|
|
|
|
struct ompi_osc_base_module_1_0_0_t {
|
2007-07-19 02:56:33 +04:00
|
|
|
/** Free resources associated with the window */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_free_fn_t osc_free;
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/** Implement MPI_PUT */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_put_fn_t osc_put;
|
2007-07-19 02:56:33 +04:00
|
|
|
/** Implement MPI_GET */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_get_fn_t osc_get;
|
2007-07-19 02:56:33 +04:00
|
|
|
/** Implement MPI_ACCUMULATE */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_accumulate_fn_t osc_accumulate;
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/** Implement MPI_WIN_FENCE */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_fence_fn_t osc_fence;
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/* Implement MPI_WIN_START */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_start_fn_t osc_start;
|
2007-07-19 02:56:33 +04:00
|
|
|
/* Implement MPI_WIN_COMPLETE */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_complete_fn_t osc_complete;
|
2007-07-19 02:56:33 +04:00
|
|
|
/* Implement MPI_WIN_POST */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_post_fn_t osc_post;
|
2007-07-19 02:56:33 +04:00
|
|
|
/* Implement MPI_WIN_WAIT */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_wait_fn_t osc_wait;
|
2007-07-19 02:56:33 +04:00
|
|
|
/* Implement MPI_WIN_TEST */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_test_fn_t osc_test;
|
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/* Implement MPI_WIN_LOCK */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_lock_fn_t osc_lock;
|
2007-07-19 02:56:33 +04:00
|
|
|
/* Implement MPI_WIN_UNLOCK */
|
2006-01-28 18:38:37 +03:00
|
|
|
ompi_osc_base_module_unlock_fn_t osc_unlock;
|
|
|
|
};
|
2007-07-19 02:56:33 +04:00
|
|
|
typedef struct ompi_osc_base_module_1_0_0_t ompi_osc_base_module_1_0_0_t;
|
|
|
|
typedef ompi_osc_base_module_1_0_0_t ompi_osc_base_module_t;
|
2006-01-28 18:38:37 +03:00
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
|
|
|
|
/* ******************************************************************** */
|
|
|
|
|
|
|
|
|
2008-07-29 02:40:57 +04:00
|
|
|
/** Macro for use in components that are of type osc */
|
|
|
|
#define OMPI_OSC_BASE_VERSION_2_0_0 \
|
|
|
|
MCA_BASE_VERSION_2_0_0, \
|
|
|
|
"osc", 2, 0, 0
|
2006-01-28 18:38:37 +03:00
|
|
|
|
2006-08-24 20:38:08 +04:00
|
|
|
|
2007-07-19 02:56:33 +04:00
|
|
|
/* ******************************************************************** */
|
|
|
|
|
|
|
|
|
|
|
|
END_C_DECLS
|
|
|
|
|
2006-08-24 20:38:08 +04:00
|
|
|
|
2006-01-28 18:38:37 +03:00
|
|
|
#endif /* OMPI_OSC_H */
|