Commit 1c7cf161 authored by Shane Snyder's avatar Shane Snyder

rearrange header files

parent 2daf8f23
......@@ -15,8 +15,7 @@ CLEANFILES = $(bin_SCRIPTS)
MAINTAINERCLEANFILES =
EXTRA_DIST =
BUILT_SOURCES =
include_HEADERS = include/ssg.h include/ssg-margo.h
EXTRA_HEADERS = include/ssg-mpi.h
include_HEADERS = include/ssg.h
EXTRA_DIST += prepare.sh
......@@ -26,10 +25,6 @@ AM_CFLAGS =
AM_LIBS =
if HAVE_MPI
include_HEADERS += include/ssg-mpi.h
endif
noinst_HEADERS += ssg-config.h
lib_LTLIBRARIES += src/libssg.la
......
/*
* Copyright (c) 2016 UChicago Argonne, LLC
*
* See COPYRIGHT in top-level directory.
*/
#pragma once
// lookup integrated into margo
#include <mpi.h>
#include <margo.h>
#include "ssg.h"
#ifdef __cplusplus
extern "C" {
#endif
// set up barrier data structures. Separate call to resolve the margo -> barrier
// race condition - call this before kicking off the progress loop with margo
void ssg_register_barrier(ssg_t s, hg_class_t *hgcl);
// set/get the margo instance id used in margo communication calls
void ssg_set_margo_id(ssg_t s, margo_instance_id mid);
margo_instance_id ssg_get_margo_id(ssg_t s);
// a "margo-aware" version of hg_lookup - still looks up everyone in one go.
// requires ssg_set_margo_id to have been called.
hg_return_t ssg_lookup_margo(ssg_t s);
// perform a naive N-1 barrier using margo.
// requires ssg_set_margo_id to have been called.
// NOTE: rank must be set on all ranks prior to calling this. I.e. should init
// the rank prior to starting up margo
hg_return_t ssg_barrier_margo(ssg_t s);
#ifdef __cplusplus
}
#endif
/**
* vim: ft=c sw=4 ts=4 sts=4 tw=80 expandtab
*/
/*
* Copyright (c) 2016 UChicago Argonne, LLC
*
* See COPYRIGHT in top-level directory.
*/
#pragma once
// mpi based initialization for ssg
#ifdef __cplusplus
extern "C" {
#endif
#include <mpi.h>
#include <na.h>
#include "ssg.h"
// mpi based (no config file) - all participants (defined by the input
// communicator) do a global address exchange
// in this case, the caller has already initialized HG with its address
ssg_t ssg_init_mpi(hg_class_t *hgcl, MPI_Comm comm);
#ifdef __cplusplus
}
#endif
/**
* vim: ft=c sw=4 ts=4 sts=4 tw=80 expandtab
*/
......@@ -16,6 +16,11 @@ extern "C" {
#endif
#include <mercury.h>
#include <margo.h>
#ifdef HAVE_MPI
#include <mpi.h>
#endif
// using pointer so that we can use proc (proc has to allocate in this case)
typedef struct ssg *ssg_t;
......@@ -38,6 +43,13 @@ typedef struct ssg *ssg_t;
// config entries
ssg_t ssg_init_config(hg_class_t *hgcl, const char * fname, int is_member);
#ifdef HAVE_MPI
// mpi based (no config file) - all participants (defined by the input
// communicator) do a global address exchange
// in this case, the caller has already initialized HG with its address
ssg_t ssg_init_mpi(hg_class_t *hgcl, MPI_Comm comm);
#endif
// in the config-file initialization, rank determination is deferred until
// lookup. In the case where the rank is needed but you don't want to
// necessarily look up everyone, this call will resolve the rank. In the MPI
......@@ -85,6 +97,24 @@ hg_return_t hg_proc_ssg_t(hg_proc_t proc, ssg_t *s);
// and sets errno
int ssg_dump(const ssg_t s, const char *fname);
// set up barrier data structures. Separate call to resolve the margo -> barrier
// race condition - call this before kicking off the progress loop with margo
void ssg_register_barrier(ssg_t s, hg_class_t *hgcl);
// set/get the margo instance id used in margo communication calls
void ssg_set_margo_id(ssg_t s, margo_instance_id mid);
margo_instance_id ssg_get_margo_id(ssg_t s);
// a "margo-aware" version of hg_lookup - still looks up everyone in one go.
// requires ssg_set_margo_id to have been called.
hg_return_t ssg_lookup_margo(ssg_t s);
// perform a naive N-1 barrier using margo.
// requires ssg_set_margo_id to have been called.
// NOTE: rank must be set on all ranks prior to calling this. I.e. should init
// the rank prior to starting up margo
hg_return_t ssg_barrier_margo(ssg_t s);
#ifdef __cplusplus
}
#endif
......
......@@ -7,6 +7,7 @@
#pragma once
#include <ssg-config.h>
#include <mercury_types.h>
#include <abt.h>
#include <margo.h>
......
......@@ -4,6 +4,8 @@
* See COPYRIGHT in top-level directory.
*/
#include <ssg-config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
......@@ -13,18 +15,14 @@
#include <string.h>
#include <assert.h>
#include <mercury.h>
#include <mercury_proc.h>
#include <mercury_macros.h>
#include <ssg-config.h>
#include <abt.h>
#include <margo.h>
#include <ssg.h>
#include <ssg-margo.h>
#include "def.h"
#ifdef HAVE_MPI
#include <ssg-mpi.h>
#endif
#define DO_DEBUG 0
#define DEBUG(...) \
do { \
......
......@@ -4,20 +4,16 @@
* See COPYRIGHT in top-level directory.
*/
#include <ssg-config.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <margo.h>
#include <abt.h>
#include <mercury.h>
#include <abt.h>
#include <margo.h>
#include <ssg.h>
#include <ssg-margo.h>
#include <ssg-config.h>
#ifdef HAVE_MPI
#include <ssg-mpi.h>
#endif
#define DIE_IF(cond_expr, err_fmt, ...) \
do { \
......
......@@ -4,6 +4,8 @@
* See COPYRIGHT in top-level directory.
*/
#include <ssg-config.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
......@@ -12,14 +14,8 @@
#include <abt.h>
#include <mercury.h>
#include <ssg.h>
#include <ssg-margo.h>
#include <ssg-config.h>
#include "rpc.h"
#ifdef HAVE_MPI
#include <ssg-mpi.h>
#endif
#define DIE_IF(cond_expr, err_fmt, ...) \
do { \
if (cond_expr) { \
......
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