|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
* (C) 2001 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifndef MPIR_WIN_H_INCLUDED
|
|
Packit Service |
c5cf8c |
#define MPIR_WIN_H_INCLUDED
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*S
|
|
Packit Service |
c5cf8c |
MPIR_Win - Description of the Window Object data structure.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Module:
|
|
Packit Service |
c5cf8c |
Win-DS
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Notes:
|
|
Packit Service |
c5cf8c |
The following 3 keyvals are defined for attributes on all MPI
|
|
Packit Service |
c5cf8c |
Window objects\:
|
|
Packit Service |
c5cf8c |
.vb
|
|
Packit Service |
c5cf8c |
MPI_WIN_SIZE
|
|
Packit Service |
c5cf8c |
MPI_WIN_BASE
|
|
Packit Service |
c5cf8c |
MPI_WIN_DISP_UNIT
|
|
Packit Service |
c5cf8c |
.ve
|
|
Packit Service |
c5cf8c |
These correspond to the values in 'length', 'start_address', and
|
|
Packit Service |
c5cf8c |
'disp_unit'.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
The communicator in the window is the same communicator that the user
|
|
Packit Service |
c5cf8c |
provided to 'MPI_Win_create' (not a dup). However, each intracommunicator
|
|
Packit Service |
c5cf8c |
has a special context id that may be used if MPI communication is used
|
|
Packit Service |
c5cf8c |
by the implementation to implement the RMA operations.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
There is no separate window group; the group of the communicator should be
|
|
Packit Service |
c5cf8c |
used.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Question:
|
|
Packit Service |
c5cf8c |
Should a 'MPID_Win' be defined after 'MPIR_Segment' in case the device
|
|
Packit Service |
c5cf8c |
wants to
|
|
Packit Service |
c5cf8c |
store a queue of pending put/get operations, described with 'MPIR_Segment'
|
|
Packit Service |
c5cf8c |
(or 'MPIR_Request')s?
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
S*/
|
|
Packit Service |
c5cf8c |
struct MPIR_Win {
|
|
Packit Service |
c5cf8c |
MPIR_OBJECT_HEADER; /* adds handle and ref_count fields */
|
|
Packit Service |
c5cf8c |
MPID_Thread_mutex_t mutex;
|
|
Packit Service |
c5cf8c |
MPIR_Errhandler *errhandler; /* Pointer to the error handler structure */
|
|
Packit Service |
c5cf8c |
void *base;
|
|
Packit Service |
c5cf8c |
MPI_Aint size;
|
|
Packit Service |
c5cf8c |
int disp_unit; /* Displacement unit of *local* window */
|
|
Packit Service |
c5cf8c |
MPIR_Attribute *attributes;
|
|
Packit Service |
c5cf8c |
MPIR_Comm *comm_ptr; /* Pointer to comm of window (dup) */
|
|
Packit Service |
c5cf8c |
#ifdef USE_THREADED_WINDOW_CODE
|
|
Packit Service |
c5cf8c |
/* These were causing compilation errors. We need to figure out how to
|
|
Packit Service |
c5cf8c |
* integrate threads into MPICH before including these fields. */
|
|
Packit Service |
c5cf8c |
/* FIXME: The test here should be within a test for threaded support */
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_PTHREAD_H
|
|
Packit Service |
c5cf8c |
pthread_t wait_thread_id; /* id of thread handling MPI_Win_wait */
|
|
Packit Service |
c5cf8c |
pthread_t passive_target_thread_id; /* thread for passive target RMA */
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_WINTHREADS)
|
|
Packit Service |
c5cf8c |
HANDLE wait_thread_id;
|
|
Packit Service |
c5cf8c |
HANDLE passive_target_thread_id;
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
/* These are COPIES of the values so that addresses to them
|
|
Packit Service |
c5cf8c |
* can be returned as attributes. They are initialized by the
|
|
Packit Service |
c5cf8c |
* MPI_Win_get_attr function.
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* These values are constant for the lifetime of the window, so
|
|
Packit Service |
c5cf8c |
* this is thread-safe.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
int copyDispUnit;
|
|
Packit Service |
c5cf8c |
MPI_Aint copySize;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
char name[MPI_MAX_OBJECT_NAME];
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPIR_Win_flavor_t create_flavor;
|
|
Packit Service |
c5cf8c |
MPIR_Win_model_t model;
|
|
Packit Service |
c5cf8c |
MPIR_Win_flavor_t copyCreateFlavor;
|
|
Packit Service |
c5cf8c |
MPIR_Win_model_t copyModel;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Other, device-specific information */
|
|
Packit Service |
c5cf8c |
#ifdef MPID_DEV_WIN_DECL
|
|
Packit Service |
c5cf8c |
MPID_DEV_WIN_DECL
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
};
|
|
Packit Service |
c5cf8c |
extern MPIR_Object_alloc_t MPIR_Win_mem;
|
|
Packit Service |
c5cf8c |
/* Preallocated win objects */
|
|
Packit Service |
c5cf8c |
extern MPIR_Win MPIR_Win_direct[];
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int MPIR_Type_is_rma_atomic(MPI_Datatype type);
|
|
Packit Service |
c5cf8c |
int MPIR_Compare_equal(const void *a, const void *b, MPI_Datatype type);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#endif /* MPIR_WIN_H_INCLUDED */
|