Commit 215822d1 authored by Shane Snyder's avatar Shane Snyder

add stubbed out group access functions

parent fdad728e
......@@ -17,17 +17,19 @@
extern "C" {
#endif
#include <mercury.h>
#include <margo.h>
#ifdef HAVE_MPI
#include <mpi.h>
#endif
#include <mercury.h>
#include <margo.h>
/* SSG return codes */
#define SSG_SUCCESS 0
#define SSG_ERROR (-1)
typedef uint64_t ssg_member_id_t;
/* SSG group identifier datatype */
/* TODO: this shouldn't be visible ... we can't use a typical
* opaque pointer since we want to be able to xmit these to
......@@ -150,18 +152,38 @@ int ssg_group_attach(
int ssg_group_detach(
ssg_group_id_t group_id);
#if 0
/*** SSG group membership view access routines */
/*********************************
*** SSG group access routines ***
*********************************/
// get my rank in the group
int ssg_get_group_rank(const ssg_t s);
/**
* Obtains the caller's group rank in an SSG group.
*
* @param[in] group_id SSG group ID
* @returns caller's group rank on success, SSG_RANK_UNKNOWN otherwise
*/
ssg_member_id_t ssg_get_group_self_id(
ssg_group_id_t group_id);
// get the size of the group
int ssg_get_group_size(const ssg_t s);
/**
* Obtains the size of an SSG group.
*
* @param[in] group_id SSG group ID
* @returns size of the group on success, 0 otherwise
*/
int ssg_get_group_size(
ssg_group_id_t group_id);
// get the HG address for the group member at the given rank
hg_addr_t ssg_get_addr(const ssg_t s, int rank);
#endif
/**
* Obtains the HG address of a given rank in an SSG group.
*
* @param[in] group_id SSG group ID
* @param[in] rank SSG group rank
* @returns HG address of given group rank on success, HG_ADDR_NULL otherwise
*/
hg_addr_t ssg_get_addr(
ssg_group_id_t group_id,
ssg_member_id_t member_id);
#ifdef __cplusplus
}
......
......@@ -24,8 +24,8 @@ extern "C" {
#ifdef DEBUG
#define SSG_DEBUG(__g, __fmt, ...) do { \
double __now = ABT_get_wtime(); \
fprintf(stdout, "%.6lf <%s:%d>: " __fmt, __now, \
__g->name, __g->self_rank, ## __VA_ARGS__); \
fprintf(stdout, "%.6lf <%s:%"PRIu64">: " __fmt, __now, \
__g->group_name, __g->self_id, ## __VA_ARGS__); \
fflush(stdout); \
} while(0)
#else
......@@ -39,7 +39,7 @@ extern void hashlittle2(const void *key, size_t length, uint32_t *pc, uint32_t *
#define SSG_MAGIC_NR 17321588
typedef struct ssg_group ssg_group_t;
typedef struct ssg_group_view ssg_group_view_t;
typedef struct ssg_view ssg_view_t;
typedef struct ssg_member_state ssg_member_state_t;
struct ssg_member_state
......@@ -48,18 +48,18 @@ struct ssg_member_state
int is_member;
};
struct ssg_group_view
struct ssg_view
{
int group_size;
int size;
ssg_member_state_t *member_states;
};
struct ssg_group
{
char *name;
ssg_group_id_t id;
int self_rank;
ssg_group_view_t view;
char *group_name;
ssg_group_id_t group_id;
ssg_member_id_t self_id;
ssg_view_t group_view;
void *fd_ctx; /* failure detector context (currently just SWIM) */
};
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment