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
72afe222
Commit
72afe222
authored
May 17, 2017
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
port swim module over to new interface changes
parent
dcd3fc52
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
165 additions
and
148 deletions
+165
-148
src/ssg-internal.h
src/ssg-internal.h
+5
-7
src/ssg.c
src/ssg.c
+7
-13
src/swim-fd/swim-fd-internal.h
src/swim-fd/swim-fd-internal.h
+8
-3
src/swim-fd/swim-fd-ping.c
src/swim-fd/swim-fd-ping.c
+80
-72
src/swim-fd/swim-fd.c
src/swim-fd/swim-fd.c
+60
-49
src/swim-fd/swim-fd.h
src/swim-fd/swim-fd.h
+3
-2
tests/ssg-test-simple.c
tests/ssg-test-simple.c
+2
-2
No files found.
src/ssg-internal.h
View file @
72afe222
...
...
@@ -17,10 +17,7 @@ extern "C" {
#include <abt.h>
#include <margo.h>
#include <ssg.h>
#if USE_SWIM_FD
#include "swim-fd/swim-fd.h"
#endif
#include "ssg.h"
/* debug printing macro for SSG */
/* TODO: direct debug output to file? */
...
...
@@ -58,11 +55,12 @@ struct ssg_group
ssg_group_id_t
id
;
int
self_rank
;
ssg_group_view_t
view
;
#if USE_SWIM_FD
swim_context_t
*
swim_ctx
;
#endif
void
*
fd_ctx
;
/* failure detector context (currently just SWIM) */
};
/* XXX: is this right? can this be a global? */
extern
margo_instance_id
ssg_mid
;
#ifdef __cplusplus
}
#endif
src/ssg.c
View file @
72afe222
...
...
@@ -4,7 +4,7 @@
* See COPYRIGHT in top-level directory.
*/
#include
<ssg-config.h>
#include
"ssg-config.h"
#include <sys/types.h>
#include <sys/stat.h>
...
...
@@ -19,7 +19,7 @@
#include <abt.h>
#include <margo.h>
#include
<ssg.h>
#include
"ssg.h"
#include "ssg-internal.h"
#if USE_SWIM_FD
#include "swim-fd/swim-fd.h"
...
...
@@ -32,7 +32,7 @@ static const char ** ssg_setup_addr_str_list(
char
*
buf
,
int
num_addrs
);
/* XXX: is this right? can this be a global? */
static
margo_instance_id
ssg_mid
=
MARGO_INSTANCE_NULL
;
margo_instance_id
ssg_mid
=
MARGO_INSTANCE_NULL
;
/***************************************************
*** SSG runtime intialization/shutdown routines ***
...
...
@@ -145,24 +145,18 @@ ssg_group_id_t ssg_group_create(
}
SSG_DEBUG
(
g
,
"group lookup successful (size=%d)
\n
"
,
group_size
);
#if 0
#if USE_SWIM_FD
/
/ initialize swim failure detector
/
* initialize swim failure detector */
// TODO: we should probably barrier or sync somehow to avoid rpc failures
// due to timing skew of different ranks initializing swim
s->swim_ctx = swim_init(s, 1);
if (s->swim_ctx == NULL)
{
ssg_finalize(s);
s = NULL;
}
#endif
g
->
fd_ctx
=
(
void
*
)
swim_init
(
g
,
1
);
if
(
g
->
fd_ctx
==
NULL
)
goto
fini
;
#endif
/* TODO: last step => add reference to this group to SSG runtime state */
/* don't free these pointers on success */
//
self_addr = HG_ADDR_NULL; /* TODO: free this in ssg_group_destroy */
self_addr
=
HG_ADDR_NULL
;
/* TODO: free this in ssg_group_destroy */
g
=
NULL
;
fini:
if
(
hgcl
&&
self_addr
!=
HG_ADDR_NULL
)
HG_Addr_free
(
hgcl
,
self_addr
);
...
...
src/swim-fd/swim-fd-internal.h
View file @
72afe222
...
...
@@ -12,6 +12,7 @@ extern "C" {
#include <ssg.h>
/* SWIM protocol parameter defaults */
#define SWIM_DEF_PROTOCOL_PERIOD_LEN 2000.0
/* milliseconds */
#define SWIM_DEF_SUSPECT_TIMEOUT 5
/* protocol period lengths */
#define SWIM_DEF_SUBGROUP_SIZE 2
...
...
@@ -19,6 +20,8 @@ extern "C" {
#define SWIM_MAX_PIGGYBACK_ENTRIES 8
#define SWIM_MAX_PIGGYBACK_TX_COUNT 50
#define SWIM_MEMBER_RANK_UNKNOWN (-1)
typedef
int64_t
swim_member_id_t
;
typedef
uint8_t
swim_member_status_t
;
typedef
uint32_t
swim_member_inc_nr_t
;
...
...
@@ -64,21 +67,23 @@ struct swim_context
/* SWIM ping function prototypes */
void
swim_register_ping_rpcs
(
ssg_
t
s
);
ssg_
group_t
*
g
);
void
swim_dping_send_ult
(
void
*
t_arg
);
void
swim_iping_send_ult
(
void
*
t_arg
);
#if 0
/* SWIM membership update function prototypes */
void swim_retrieve_membership_updates(
ssg_
t
s
,
ssg_
group_t *g
,
swim_member_update_t *updates,
int update_count);
void swim_apply_membership_updates(
ssg_
t
s
,
ssg_
group_t *g
,
swim_member_update_t *updates,
int update_count);
#endif
#ifdef __cplusplus
}
...
...
src/swim-fd/swim-fd-ping.c
View file @
72afe222
This diff is collapsed.
Click to expand it.
src/swim-fd/swim-fd.c
View file @
72afe222
This diff is collapsed.
Click to expand it.
src/swim-fd/swim-fd.h
View file @
72afe222
...
...
@@ -10,13 +10,14 @@
extern
"C"
{
#endif
#include <ssg.h>
#include "ssg.h"
#include "ssg-internal.h"
/* opaque swim context type */
typedef
struct
swim_context
swim_context_t
;
swim_context_t
*
swim_init
(
ssg_
t
s
,
ssg_
group_t
*
g
,
int
active
);
void
swim_finalize
(
...
...
tests/ssg-test-simple.c
View file @
72afe222
...
...
@@ -135,8 +135,8 @@ int main(int argc, char *argv[])
if
(
sleep_time
>
0
)
margo_thread_sleep
(
mid
,
sleep_time
*
1000
.
0
);
cleanup:
/* cleanup */
/** cleanup **/
ssg_group_destroy
(
g_id
);
ssg_finalize
();
...
...
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