2004-07-14 18:11:03 +04:00
|
|
|
// -*- c++ -*-
|
|
|
|
//
|
2005-11-05 22:57:48 +03:00
|
|
|
// Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
// University Research and Technology
|
|
|
|
// Corporation. All rights reserved.
|
|
|
|
// Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
// of Tennessee Research Foundation. All rights
|
|
|
|
// reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
// Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
// University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
// Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
// All rights reserved.
|
2007-01-10 02:48:39 +03:00
|
|
|
// Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
// $COPYRIGHT$
|
|
|
|
//
|
|
|
|
// Additional copyrights may follow
|
|
|
|
//
|
2004-07-14 18:11:03 +04:00
|
|
|
// $HEADER$
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Miscellany
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
inline MPI::Errhandler
|
|
|
|
MPI::Win::Create_errhandler(MPI::Win::Errhandler_fn* function)
|
|
|
|
{
|
|
|
|
MPI_Errhandler errhandler;
|
2006-12-31 02:41:42 +03:00
|
|
|
(void) MPI_Win_create_errhandler((MPI_Win_errhandler_fn *) ompi_mpi_cxx_win_errhandler_intercept,
|
2004-07-14 18:11:03 +04:00
|
|
|
&errhandler);
|
2006-12-31 02:41:42 +03:00
|
|
|
MPI::Errhandler temp(errhandler);
|
|
|
|
temp.win_handler_fn = (void(*)(MPI::Win&, int* , ...)) function;
|
|
|
|
return temp;
|
2004-07-14 18:11:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline MPI::Errhandler
|
|
|
|
MPI::Win:: Get_errhandler() const
|
|
|
|
{
|
2006-12-31 02:41:42 +03:00
|
|
|
return *my_errhandler;
|
2004-07-14 18:11:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// One sided communication
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Accumulate(const void* origin_addr, int origin_count,
|
|
|
|
const MPI::Datatype& origin_datatype, int target_rank,
|
|
|
|
MPI::Aint target_disp, int target_count,
|
|
|
|
const MPI::Datatype& target_datatype,
|
|
|
|
const MPI::Op& op) const
|
|
|
|
{
|
2005-11-30 06:22:27 +03:00
|
|
|
(void) MPI_Accumulate(const_cast<void *>(origin_addr), origin_count, origin_datatype,
|
2004-07-14 18:11:03 +04:00
|
|
|
target_rank, target_disp, target_count,
|
|
|
|
target_datatype, op, mpi_win);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Complete() const
|
|
|
|
{
|
|
|
|
(void) MPI_Win_complete(mpi_win);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline MPI::Win
|
|
|
|
MPI::Win::Create(const void* base, MPI::Aint size,
|
|
|
|
int disp_unit, const MPI::Info& info,
|
|
|
|
const MPI::Intracomm& comm)
|
|
|
|
{
|
|
|
|
MPI_Win newwin;
|
2005-11-30 06:22:27 +03:00
|
|
|
(void) MPI_Win_create(const_cast<void *>(base), size, disp_unit, info, comm, &newwin);
|
2004-07-14 18:11:03 +04:00
|
|
|
return newwin;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Fence(int assert) const
|
|
|
|
{
|
|
|
|
(void) MPI_Win_fence(assert, mpi_win);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Get(const void *origin_addr, int origin_count,
|
|
|
|
const MPI::Datatype& origin_datatype,
|
|
|
|
int target_rank, MPI::Aint target_disp,
|
|
|
|
int target_count,
|
|
|
|
const MPI::Datatype& target_datatype) const
|
|
|
|
{
|
2005-11-30 06:22:27 +03:00
|
|
|
(void) MPI_Get(const_cast<void *>(origin_addr), origin_count, origin_datatype,
|
2004-07-14 18:11:03 +04:00
|
|
|
target_rank, target_disp,
|
|
|
|
target_count, target_datatype, mpi_win);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline MPI::Group
|
|
|
|
MPI::Win::Get_group() const
|
|
|
|
{
|
|
|
|
MPI_Group mpi_group;
|
|
|
|
(void) MPI_Win_get_group(mpi_win, &mpi_group);
|
|
|
|
return mpi_group;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Lock(int lock_type, int rank, int assert) const
|
|
|
|
{
|
|
|
|
(void) MPI_Win_lock(lock_type, rank, assert, mpi_win);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Post(const MPI::Group& group, int assert) const
|
|
|
|
{
|
|
|
|
(void) MPI_Win_post(group, assert, mpi_win);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Put(const void* origin_addr, int origin_count,
|
|
|
|
const MPI::Datatype& origin_datatype,
|
|
|
|
int target_rank, MPI::Aint target_disp,
|
|
|
|
int target_count,
|
|
|
|
const MPI::Datatype& target_datatype) const
|
|
|
|
{
|
2005-11-30 06:22:27 +03:00
|
|
|
(void) MPI_Put(const_cast<void *>(origin_addr), origin_count, origin_datatype,
|
2004-07-14 18:11:03 +04:00
|
|
|
target_rank, target_disp, target_count,
|
|
|
|
target_datatype, mpi_win);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Start(const MPI::Group& group, int assert) const
|
|
|
|
{
|
|
|
|
(void) MPI_Win_start(group, assert, mpi_win);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline bool
|
|
|
|
MPI::Win::Test() const
|
|
|
|
{
|
|
|
|
int flag;
|
|
|
|
MPI_Win_test(mpi_win, &flag);
|
2006-08-28 22:51:09 +04:00
|
|
|
return OPAL_INT_TO_BOOL(flag);
|
2004-07-14 18:11:03 +04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Unlock(int rank) const
|
|
|
|
{
|
|
|
|
(void) MPI_Win_unlock(rank, mpi_win);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Wait() const
|
|
|
|
{
|
|
|
|
(void) MPI_Win_wait(mpi_win);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// External Interfaces
|
|
|
|
//
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Call_errhandler(int errorcode) const
|
|
|
|
{
|
|
|
|
(void) MPI_Win_call_errhandler(mpi_win, errorcode);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Delete_attr(int win_keyval)
|
|
|
|
{
|
|
|
|
(void) MPI_Win_delete_attr(mpi_win, win_keyval);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline bool
|
2007-01-10 02:48:39 +03:00
|
|
|
MPI::Win::Get_attr(int win_keyval, void* attribute_val) const
|
2004-07-14 18:11:03 +04:00
|
|
|
{
|
|
|
|
int ret;
|
2007-01-10 02:48:39 +03:00
|
|
|
(void) MPI_Win_get_attr(mpi_win, win_keyval, attribute_val, &ret);
|
2006-08-28 22:51:09 +04:00
|
|
|
return OPAL_INT_TO_BOOL(ret);
|
2004-07-14 18:11:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Get_name(char* win_name, int& resultlen) const
|
|
|
|
{
|
|
|
|
(void) MPI_Win_get_name(mpi_win, win_name, &resultlen);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MPI::Win::Set_name(const char* win_name)
|
|
|
|
{
|
2005-11-30 06:22:27 +03:00
|
|
|
(void) MPI_Win_set_name(mpi_win, const_cast<char *>(win_name));
|
2004-07-14 18:11:03 +04:00
|
|
|
}
|
|
|
|
|