Fenix @develop
 
Loading...
Searching...
No Matches
fenix_data_member.hpp
1/*
2//@HEADER
3// ************************************************************************
4//
5//
6// _|_|_|_| _|_|_|_| _| _| _|_|_| _| _|
7// _| _| _|_| _| _| _| _|
8// _|_|_| _|_|_| _| _| _| _| _|
9// _| _| _| _|_| _| _| _|
10// _| _|_|_|_| _| _| _|_|_| _| _|
11//
12//
13//
14//
15// Copyright (C) 2016 Rutgers University and Sandia Corporation
16//
17// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18// the U.S. Government retains certain rights in this software.
19//
20// Redistribution and use in source and binary forms, with or without
21// modification, are permitted provided that the following conditions are
22// met:
23//
24// 1. Redistributions of source code must retain the above copyright
25// notice, this list of conditions and the following disclaimer.
26//
27// 2. Redistributions in binary form must reproduce the above copyright
28// notice, this list of conditions and the following disclaimer in the
29// documentation and/or other materials provided with the distribution.
30//
31// 3. Neither the name of the Corporation nor the names of the
32// contributors may be used to endorse or promote products derived from
33// this software without specific prior written permission.
34//
35// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
36// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
38// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
39// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
40// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
41// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
42// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
43// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46//
47// Author Marc Gamell, Eric Valenzuela, Keita Teranishi, Manish Parashar
48// Michael Heroux, and Matthew Whitlock
49//
50// Questions? Contact Keita Teranishi (knteran@sandia.gov) and
51// Marc Gamell (mgamell@cac.rutgers.edu)
52//
53// ************************************************************************
54//@HEADER
55*/
56#ifndef __FENIX_DATA_MEMBER_H__
57#define __FENIX_DATA_MEMBER_H__
58
59#include <mpi.h>
60#include "fenix_data_packet.hpp"
61#include "fenix_util.hpp"
62
63
64#define __FENIX_DEFAULT_MEMBER_SIZE 512
65
66typedef struct __fenix_member_entry {
67 int memberid;
68 enum states state;
69 void *user_data;
70 int datatype_size;
71 int current_count;
73
74typedef struct __fenix_member {
75 size_t count;
76 size_t total_size;
77 fenix_member_entry_t *member_entry;
79
80typedef struct __member_entry_packet {
81 int memberid;
82 int datatype_size;
83 int current_count;
85
86fenix_member_t *__fenix_data_member_init( );
87void __fenix_data_member_destroy( fenix_member_t *member ) ;
88
89void __fenix_ensure_member_capacity( fenix_member_t *m );
90void __fenix_ensure_version_capacity_from_member( fenix_member_t *m );
91
92fenix_member_entry_t* __fenix_data_member_add_entry(fenix_member_t* member,
93 int memberid, void* data, int count, int datatype_size);
94
95int __fenix_data_member_send_metadata(int groupid, int memberid, int dest_rank);
96int __fenix_data_member_recv_metadata(int groupid, int src_rank,
98
99int __fenix_search_memberid(fenix_member_t* member, int memberid);
100int __fenix_find_next_member_position(fenix_member_t *m);
101
102void __fenix_data_member_reinit(fenix_member_t *m, fenix_two_container_packet_t packet,
103 enum states mystatus);
104#endif // FENIX_DATA_MEMBER_H
Definition fenix_data_member.hpp:66
Definition fenix_data_member.hpp:74
Definition fenix_data_member.hpp:80
Definition fenix_data_packet.hpp:60