32 #ifndef RFC_WINDOW_TRANSFER_H
33 #define RFC_WINDOW_TRANSFER_H
139 MPI_Comm com,
const char *pre=NULL,
140 const char *format=NULL);
157 void set_tags(
const COM::Attribute *tag);
196 void wait_all(
int n, MPI_Request *requests);
197 void wait_any(
int n, MPI_Request *requests,
int *index, MPI_Status *stat=NULL);
209 std::vector<int> &displs)
const {
210 RFC_assertion( !displs.empty() && counts.size()>=displs.size()-1);
212 for (
int i=1, size=displs.size();
i<size; ++
i) {
213 displs[
i] = displs[
i-1]+counts[
i-1];
236 template <
class _Tag>
247 const COM::Attribute *a = win.
attribute( aname);
248 _id = a->id();
_dim = a->size_of_components();
251 :
_id(a->
id()),
_dim(a->size_of_components()) {}
279 template <
class _Tag>
int COMMPI_Comm_rank(MPI_Comm c)
void replicate_data(const Facial_data_const &data, bool replicate_coor)
Replicate the given data from remote processes onto local process.
RFC_Data_const< Tag_facial > Facial_data_const
RFC_Pane_transfer & pane(const int pid)
std::vector< int > _num_panes
std::map< int, RFC_Pane_transfer * > _replic_panes
RFC_Window_transfer(COM::Window *b, int color, MPI_Comm com, const char *pre=NULL, const char *format=NULL)
void wait_any(int n, MPI_Request *requests, int *index, MPI_Status *stat=NULL)
const Real * coordinates() const
RFC_Data_const(const RFC_Window_transfer &win, const char *aname)
void delete_facial_buffers()
std::vector< int > _recv_faces
void counts_to_displs(const std::vector< int > &counts, std::vector< int > &displs) const
bool is_valid(const RFC_Pane_transfer *p, int i) const
const RFC_Window_transfer * window() const
void set_tags(const COM::Attribute *tag)
const Attribute * attribute(const char *f) const
Retrieve an attribute object from the base using the attribute name.
void wait_all(int n, MPI_Request *requests)
std::vector< Real > _coor_buf
virtual ~RFC_Pane_transfer()
Value_const get_value(const RFC_Pane_transfer *p, int v) const
Value_const get_value(const Real *buf, int v) const
Base * _base
Reference to its base object.
void barrier() const
Block until all processes of the window have reached here.
RFC_Pane_transfer(COM::Pane *b, int c)
std::map< int, std::vector< Real > > _send_buffers
int color() const
The color of the window for overlay or for data transfer (BLUE or GREEN).
Facial_data facial_buffer(int)
int size_of_faces() const
The total number of faces in the pane.
Value_const get_value(const Real *buf, int v) const
const std::string _prefix
RFC_Data(COM::Attribute *a)
RFC_Data_const< Tag_nodal > Nodal_data_const
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Real * pointer(int i)
Get the address of a given attribute with id i.
RFC_Data_const(const COM::Attribute *a)
int COMMPI_Comm_size(MPI_Comm c)
The base implementation of RFC_Pane.
RFC_Data_const< _Tag > Base
#define RFC_END_NAME_SPACE
Const_pointer begin() const
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to ** copy
void clear_replicated_data()
Clear all the replicate data but keep metadata.
void reduce_maxabs_to_all(Nodal_data &)
Const_pointer end() const
void incident_faces(std::map< int, std::vector< int > > &) const
Obtain the list of incident faces in each pane of the opposite mesh.
RFC_Data< Tag_facial > Facial_data
std::map< int, std::pair< int, int > > _pane_map
void delete_nodal_buffers()
bool replicated() const
Returns whether replication has been performed.
RFC_Window_transfer * window()
RFC_Data(RFC_Window_transfer &win, const char *aname)
RFC_Data< Tag_nodal > Nodal_data
#define RFC_BEGIN_NAME_SPACE
RFC_Data_const(int i, int d)
Const_pointer end() const
void set_value(RFC_Pane_transfer *p, int v, const Value_const &vec)
Contains declarations of MPI subroutines used in Roccom.
Value_nonconst get_value(RFC_Pane_transfer *p, int v)
const Real * get_emm(int f) const
Nodal_data nodal_buffer(int)
void incident_panes(std::vector< int > &pane_ids)
Determine the remote panes that are incident with local panes.
void init_nodal_buffers(const Nodal_data &nd, int n, bool init_emm)
void allreduce(Real *x, MPI_Op op) const
Value_nonconst get_value(Real *buf, int v) const
void set_value(Real *buf, int v, const Value_const &vec)
const Real * coordinates() const
Reusable implementation for derived class of RFC_Window_base.
void init_facial_buffers(const Facial_data &nd, int)
void replicate_metadata(int *pane_ids, int n)
Replicate the metadata of a remote pane only the local process.
std::vector< Real > _emm_buffer
std::vector< std::vector< Real > > _buffer
Const_pointer begin() const
Array_n_const Value_const
std::map< int, std::vector< int > > _send_nodes
const Real * pointer(int i) const
Value_const get_value(const RFC_Pane_transfer *p, int v) const
virtual ~RFC_Window_transfer()
void init_recv_buffer(int pane_id, int from_rank)
std::vector< int > _emm_offset
Array_n_const Value_const
std::set< std::pair< int, RFC_Pane_transfer * > > _panes_to_send
std::vector< MPI_Request > _msg_requests
bool need_recv(int i) const
void reduce_to_all(Nodal_data &, MPI_Op)
RFC_Window_derived< RFC_Pane_transfer > Base
bool is_root() const
Check whether the process has rank 0.
std::map< int, std::vector< int > > _send_faces
RFC_Window_transfer * _window
std::vector< Real > _data_buf
void init_send_buffer(int pane_id, int to_rank)
void allreduce(Array_n &arr, MPI_Op op) const
std::vector< int > _recv_nodes