Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ssg
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sds
ssg
Commits
204f14c7
Commit
204f14c7
authored
May 16, 2017
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement group_create fns for ssg api
parent
07775bdc
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
322 additions
and
283 deletions
+322
-283
include/ssg.h
include/ssg.h
+15
-13
src/ssg-internal.h
src/ssg-internal.h
+17
-15
src/ssg.c
src/ssg.c
+290
-255
No files found.
include/ssg.h
View file @
204f14c7
...
...
@@ -28,7 +28,7 @@ extern "C" {
#define SSG_SUCCESS 0
/* TODO: define some errors? */
#define SSG_GROUP_NULL 0
#define SSG_GROUP_
ID_
NULL 0
/* XXX: actually define what these are */
typedef
int
ssg_group_id_t
;
...
...
@@ -57,17 +57,19 @@ void ssg_finalize(
/**
* Creates an SSG group from a given list of HG address strings.
* @params[in] group_name Name of the SSG group
* @params[in] hg_addr_strs Array of HG address strings for each group member
* @returns SSG group ID on success, SSG_GROUP_NULL otherwise
* @params[in] group_name Name of the SSG group
* @params[in] group_addr_strs Array of HG address strings for each group member
* @params[in] group_size Number of group members
* @returns SSG group ID on success, SSG_GROUP_ID_NULL otherwise
*
* NOTE: The HG address string of the caller of this function must be present in
* the list of address strings given in '
hg_addr_strs'. That is, the caller of
* this function is required to be a member of the SSG group that is created.
* the list of address strings given in '
group_addr_strs'. That is, the caller
*
of
this function is required to be a member of the SSG group that is created.
*/
ssg_group_id_t
ssg_group_create
(
const
char
*
group_name
,
const
char
*
const
hg_addr_strs
[]);
const
char
*
group_name
,
const
char
*
const
group_addr_strs
[],
int
group_size
);
/**
* Creates an SSG group from a given config file containing the HG address strings
...
...
@@ -75,25 +77,25 @@ ssg_group_id_t ssg_group_create(
* @params[in] group_name Name of the SSG group
* @params[in] file_name Name of the config file containing the corresponding
* HG address strings for this group
* @returns SSG group ID on success, SSG_GROUP_NULL otherwise
* @returns SSG group ID on success, SSG_GROUP_
ID_
NULL otherwise
*
* NOTE: The HG address string of the caller of this function must be present in
* the list of address strings given in the config file. That is, the caller of
* this function is required to be a member of the SSG group that is created.
*/
ssg_group_id_t
ssg_group_create_config
(
const
char
*
group_name
,
const
char
*
file_name
);
const
char
*
group_name
,
const
char
*
file_name
);
#ifdef HAVE_MPI
/**
* Creates an SSG group from a given MPI communicator.
* @params[in] group_name Name of the SSG group
* @params[in] comm MPI communicator containing group members
* @returns SSG group ID on success, SSG_GROUP_NULL otherwise
* @returns SSG group ID on success, SSG_GROUP_
ID_
NULL otherwise
*/
ssg_group_id_t
ssg_group_create_mpi
(
const
char
*
group_name
,
const
char
*
group_name
,
MPI_Comm
comm
);
#endif
...
...
src/ssg-internal.h
View file @
204f14c7
...
...
@@ -12,29 +12,33 @@ extern "C" {
#include <stdint.h>
#include <inttypes.h>
#include <mercury.h>
#include <abt.h>
#include <margo.h>
#include <ssg.h>
#if USE_SWIM_FD
#include "swim-fd/swim-fd.h"
#endif
// debug printing macro for SSG
/* debug printing macro for SSG */
/* TODO: direct debug output to file? */
#ifdef DEBUG
#define SSG_DEBUG(__
s
, __fmt, ...) do { \
#define SSG_DEBUG(__
g
, __fmt, ...) do { \
double __now = ABT_get_wtime(); \
fprintf(
__s->dbg_strm
, "%.6lf <%d>: " __fmt, \
__now, __
s->view.
self_rank, ## __VA_ARGS__); \
fflush(
__s->dbg_strm
); \
fprintf(
stdout
, "%.6lf <%d>: " __fmt, \
__now, __
g->
self_rank, ## __VA_ARGS__); \
fflush(
stdout
); \
} while(0)
#else
#define SSG_DEBUG(__
s
, __fmt, ...) do { \
#define SSG_DEBUG(__
g
, __fmt, ...) do { \
} while(0)
#endif
typedef
struct
ssg_group
ssg_group_t
;
typedef
struct
ssg_group_view
ssg_group_view_t
;
typedef
struct
ssg_member_state
ssg_member_state_t
;
typedef
struct
ssg_view
ssg_view_t
;
struct
ssg_member_state
{
...
...
@@ -42,23 +46,21 @@ struct ssg_member_state
int
is_member
;
};
struct
ssg_view
struct
ssg_
group_
view
{
int
self_rank
;
int
group_size
;
ssg_member_state_t
*
member_states
;
};
struct
ssg
struct
ssg
_group
{
margo_instance_id
mid
;
ssg_view_t
view
;
char
*
name
;
ssg_group_id_t
id
;
int
self_rank
;
ssg_group_view_t
view
;
#if USE_SWIM_FD
swim_context_t
*
swim_ctx
;
#endif
#ifdef DEBUG
FILE
*
dbg_strm
;
#endif
};
#ifdef __cplusplus
...
...
src/ssg.c
View file @
204f14c7
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment