Commit 00efe1c1 authored by David Rich's avatar David Rich Committed by Rob Latham
Browse files

A few more issues fixed (discovered while using kvgroup with ParSplice).

parent 56b30f64
Sample runs:
Notes on running tests:
test-mpi-group:
# using mpich
mpirun -np 4 -prepend-rank -outfile-pattern output/test-%r.log -errfile-pattern output/test-%r.log ./test/test-mpi-group ofi+tcp 2
......@@ -134,12 +134,16 @@ void kvgroup_client_recv_gid(ssg_group_id_t *gid, MPI_Comm comm)
{
char *serialized_gid = NULL;
size_t gid_size = 0;
int rank;
MPI_Comm_rank(comm, &rank);
// recv size first
MPI_Bcast(&gid_size, 1, MPI_UNSIGNED_LONG, 0, MPI_COMM_WORLD);
MPI_Bcast(&gid_size, 1, MPI_UNSIGNED_LONG, 0, comm);
std::cout << "kvgroup_client_recv_gid: comm rank " << rank << ", recv'd gid size " << gid_size << std::endl;
assert(gid_size != 0);
// then recv data
serialized_gid = (char*)malloc(gid_size);
MPI_Bcast(serialized_gid, gid_size, MPI_BYTE, 0, MPI_COMM_WORLD);
MPI_Bcast(serialized_gid, gid_size, MPI_BYTE, 0, comm);
ssg_group_id_deserialize(serialized_gid, gid_size, gid);
free(serialized_gid);
}
......@@ -68,12 +68,16 @@ void kvgroup_server_send_gid(ssg_group_id_t gid, MPI_Comm comm)
{
char *serialized_gid = NULL;
size_t gid_size = 0;
int rank;
MPI_Comm_rank(comm, &rank);
ssg_group_id_serialize(gid, &serialized_gid, &gid_size);
assert(serialized_gid != NULL && gid_size != 0);
std::cout << "kvgroup_server_send_gid: comm rank " << rank << ", sending gid size " << gid_size << std::endl;
// send size first
MPI_Bcast(&gid_size, 1, MPI_UNSIGNED_LONG, 0, MPI_COMM_WORLD);
MPI_Bcast(&gid_size, 1, MPI_UNSIGNED_LONG, 0, comm);
// then send data
MPI_Bcast(serialized_gid, gid_size, MPI_BYTE, 0, MPI_COMM_WORLD);
MPI_Bcast(serialized_gid, gid_size, MPI_BYTE, 0, comm);
free(serialized_gid);
}
......
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