Commit 05a4fb8e authored by Rob Latham's avatar Rob Latham

test creating/view a group with separate processes

Processes in separate address spaces exercise some RMA paths more aggressively,
and also ensure we have RMA credientials set up
parent 4a19b43d
......@@ -7,7 +7,9 @@ check_PROGRAMS += \
tests/ssg-launch-double-mid-group \
tests/ssg-observe-group \
tests/ssg-join-leave-group \
tests/ssg-test-fail
tests/ssg-test-fail \
tests/ssg-test-separate-group-create.c \
tests/ssg-test-separate-group-attach.c
EXTRA_DIST += \
tests/test-util.sh
......
#include <mpi.h>
#include <ssg.h>
#include <assert.h>
int main(int argc, char **argv)
{
char ssg_group_buf[256];
int ret;
ssg_group_id_t gid;
margo_instance_id mid;
MPI_Init(&argc, &argv);
mid = margo_init(argv[1], MARGO_CLIENT_MODE, 0, 1);
ssg_init();
int count=1;
int actual=0;
ret = ssg_group_id_load(argv[2], &count, &actual, &gid);
assert (ret == SSG_SUCCESS);
fprintf(stderr, " attaching...\n");
ret = ssg_group_observe(mid, gid);
fprintf(stderr, " attached...\n");
fprintf(stderr, " dumping...\n");
ssg_group_dump(gid);
fprintf(stderr, " dumped...\n");
ssg_group_unobserve(gid);
margo_finalize(mid);
MPI_Finalize();
}
#include <ssg.h>
#include <ssg-mpi.h>
#define GROUP_NAME "test-group"
#define ASSERT(__cond, __msg, ...) { if(!(__cond)) { fprintf(stderr, "[%s:%d] " __msg, __FILE__, __LINE__, __VA_ARGS__); exit(-1); } }
static void finalized_ssg_group_cb(void* data)
{
ssg_group_id_t gid = *((ssg_group_id_t*)data);
ssg_group_destroy(gid);
}
int main(int argc, char **argv)
{
int ret, rank;
ssg_group_id_t gid;
margo_instance_id mid;
mid = margo_init(argv[1], MARGO_SERVER_MODE, 0, 1);
margo_enable_remote_shutdown(mid);
hg_addr_t my_address;
margo_addr_self(mid, &my_address);
char addr_str[128];
size_t addr_str_size = 128;
margo_addr_to_string(mid, addr_str, &addr_str_size, my_address);
margo_addr_free(mid,my_address);
printf("Server running at address %s\n", addr_str);
MPI_Init(&argc, &argv);
ret = ssg_init();
ASSERT(ret == 0, "ssg_init failed (ret = %d)\n", ret);
gid = ssg_group_create_mpi(mid, GROUP_NAME, MPI_COMM_WORLD, NULL, NULL, NULL);
ASSERT(gid != SSG_GROUP_ID_NULL, "ssg_group_create_mpi() failed\n", gid);
margo_push_finalize_callback(mid, &finalized_ssg_group_cb, (void*)&gid);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (rank == 0)
ssg_group_id_store(argv[2], gid, 1);
fprintf(stderr, " just hanging out...\n");
margo_wait_for_finalize(mid);
ssg_group_destroy(gid);
margo_finalize(mid);
MPI_Finalize();
}
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