Triton Repository branch, master, updated. 14faab690a1560c6b0ff631bf2d21a3dea4c99ba
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Triton Repository". The branch, master has been updated via 14faab690a1560c6b0ff631bf2d21a3dea4c99ba (commit) via 7d4f3aef04f97c2885b0c435b29a5127c1108457 (commit) from 9674af0769270760ace98dbbaac29fc3f484d752 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 14faab690a1560c6b0ff631bf2d21a3dea4c99ba Author: Phil Carns <[email protected]> Date: Wed Sep 22 17:13:06 2010 -0400 make fakess and placement 32-bit friendly commit 7d4f3aef04f97c2885b0c435b29a5127c1108457 Author: Phil Carns <[email protected]> Date: Wed Sep 22 15:38:26 2010 -0400 multi server support in rosd benchmark ----------------------------------------------------------------------- Summary of changes: code/src/fakess/fakess.ae | 24 +++++-- code/src/placement/placement.ae | 2 +- .../src/replicated-osd/tests/rosd-create-bench.aer | 74 ++++++++++++++------ 3 files changed, 70 insertions(+), 30 deletions(-) Diff of changes: diff --git a/code/src/fakess/fakess.ae b/code/src/fakess/fakess.ae index ca3cd91..49b51ed 100644 --- a/code/src/fakess/fakess.ae +++ b/code/src/fakess/fakess.ae @@ -8,6 +8,7 @@ #include "src/fakess/bqueue.hae" #include "src/fakess/fakess.hae" #include "src/common/resources/scheduling/sched.hae" +#include "triton-config.h" #include "src/common/triton-hash.h" @@ -200,7 +201,7 @@ triton_ret_t triton_fakess_node_add(triton_node_t node, { struct triton_hash_link *link; - printf("fakess: node_add(%lu.%lu)\n", node.u, node.l); + printf("fakess: node_add(%llu.%llu)\n", llu(node.u), llu(node.l)); link = triton_hash_search(fakess_nodes, &node); if (link) @@ -245,8 +246,8 @@ triton_ret_t triton_fakess_item_add(triton_node_t node, struct triton_state_table *state; triton_fakess_data_t *data; - printf("fakess: item_add(%lu.%lu, %s)\n", - node.u, node.l, key->string); + printf("fakess: item_add(%llu.%llu, %s)\n", + llu(node.u), llu(node.l), key->string); state = lookup_node(node); assert(state); @@ -322,8 +323,8 @@ __blocking triton_ret_t triton_fakess_announce(MPI_Comm comm) printf("announce():\n"); - length = sprintf(buffer, "ANNOUNCE: %lu %lu", - triton_fakess_self.u, triton_fakess_self.l); + length = sprintf(buffer, "ANNOUNCE: %llu %llu", + llu(triton_fakess_self.u), llu(triton_fakess_self.l)); for (i = 0; i < mpi_size; i++) { if (i != mpi_rank) @@ -359,8 +360,8 @@ static int serialize_post(triton_node_t node, char *buffer) { int result; - result = sprintf(buffer, "POST: %lu %lu %s %i", - node.u, node.l, key->string, length); + result = sprintf(buffer, "POST: %llu %llu %s %i", + llu(node.u), llu(node.l), key->string, length); /* printf("serialized: %s\n", buffer); */ @@ -409,7 +410,11 @@ static void process_announce(char *buffer, int p, triton_node_t node; int n; +#if SIZEOF_LONG_INT == 4 + n = sscanf(args, "%llu %llu", &node.u, &node.l); +#else n = sscanf(args, "%lu %lu", &node.u, &node.l); +#endif assert(n == 2); triton_fakess_node_add(node, sender, comm); } @@ -456,8 +461,13 @@ __blocking void process_post(char *buffer, int p, MPI_Status status; int n; +#if SIZEOF_LONG_INT == 4 + n = sscanf(args, "%llu %llu %s %i", + &node.u, &node.l, keystring, &length); +#else n = sscanf(args, "%lu %lu %s %i", &node.u, &node.l, keystring, &length); +#endif assert(n == 4); key = triton_string_malloc(keystring); diff --git a/code/src/placement/placement.ae b/code/src/placement/placement.ae index 5243fe5..5036c6b 100644 --- a/code/src/placement/placement.ae +++ b/code/src/placement/placement.ae @@ -12,7 +12,7 @@ void dump_nodes(int count, triton_node_t *closest) for (i = 0; i < count; i++) { node = closest[i]; - printf("\t %i.%i\n", node.u, node.l); + printf("\t %llu.%llu\n", llu(node.u), llu(node.l)); } } diff --git a/code/src/replicated-osd/tests/rosd-create-bench.aer b/code/src/replicated-osd/tests/rosd-create-bench.aer index 8e28ff0..85963a9 100644 --- a/code/src/replicated-osd/tests/rosd-create-bench.aer +++ b/code/src/replicated-osd/tests/rosd-create-bench.aer @@ -33,6 +33,7 @@ char db_path[PATH_MAX]; char log_path[PATH_MAX]; int coalescing = 0; int use_niids = 0; +int nservers = 0; __blocking void do_remote_server(void) { @@ -43,6 +44,7 @@ __blocking void do_remote_server(void) int32_t out; triton_addr_t svr; int nprocs; + int first_client = nservers; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); @@ -64,8 +66,8 @@ __blocking void do_remote_server(void) } pbranch { - /* wait for rank 1 to send a message indicating we are done */ - mpi_ret = triton_mpi_recv(&done_signal, 1, MPI_CHAR, 1, 0, MPI_COMM_WORLD, &status); + /* wait for first client rank to send done signal */ + mpi_ret = triton_mpi_recv(&done_signal, 1, MPI_CHAR, first_client, 0, MPI_COMM_WORLD, &status); aer_service_engine_stop(); } @@ -179,7 +181,7 @@ static void cb(void *up) void usage(void) { fprintf(stderr, - "Usage: rosd-create-bench <db path> <log path> <objects per proc> <concurrency> <bdb throttle> <coalescing> <use niids>\n"); + "Usage: rosd-create-bench <db path> <log path> <objects per proc> <concurrency> <bdb throttle> <coalescing> <use niids> <nservers>\n"); } int main(int argc, char *argv[]) { @@ -191,11 +193,14 @@ int main(int argc, char *argv[]) char done_signal; MPI_Group orig_group, client_group; MPI_Comm client_comm; - int server_rank = 0; + int* server_ranks = NULL; double test_start, test_end, create_elapsed, remove_elapsed; double elapsed_time, min_elapsed_time; double remove_elapsed_time, remove_min_elapsed_time; int scan_ret; + int nclients; + char rank_suffix[10]; + int i; ret = triton_zeroconf_init(); assert(ret == TRITON_SUCCESS); @@ -242,7 +247,7 @@ int main(int argc, char *argv[]) assert(ret == TRITON_SUCCESS); /* parse command line */ - if(argc != 8) + if(argc != 9) { usage(); return(-1); @@ -292,22 +297,44 @@ int main(int argc, char *argv[]) usage(); return(-1); } + scan_ret = sscanf(argv[8], "%d", &nservers); + if(scan_ret != 1 || nservers < 1) + { + usage(); + return(-1); + } + + server_ranks = (int*)malloc(nservers*sizeof(*server_ranks)); + assert(server_ranks); + for(i=0; i<nservers; i++) + { + server_ranks[i] = i; + } MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_size(MPI_COMM_WORLD, &nclients); + nclients -= nservers; - /* create a communicator for the "clients" (all but rank 0) */ + /* create a communicator for the "clients" */ mpi_ret = MPI_Comm_group(MPI_COMM_WORLD, &orig_group); assert(mpi_ret == MPI_SUCCESS); - mpi_ret = MPI_Group_excl(orig_group, 1, &server_rank, &client_group); + mpi_ret = MPI_Group_excl(orig_group, nservers, server_ranks, &client_group); assert(mpi_ret == MPI_SUCCESS); mpi_ret = MPI_Comm_create(MPI_COMM_WORLD, client_group, &client_comm); assert(mpi_ret == MPI_SUCCESS); - if(rank == 0) + if(rank < nservers) { ret = rosd_set_info(ROSD_NIID_ENABLED, use_niids); assert(ret == TRITON_SUCCESS); + /* tack on the rank number to the paths to avoid conflicts when + * running two svrs on one box + */ + sprintf(rank_suffix, "%d", rank); + strcat(log_path, rank_suffix); + strcat(db_path, rank_suffix); + ret = vosd_init(db_path, log_path, coalescing, coalescing, 4096, VOSD_INIT_FLAG_DATA_ODIRECT|VOSD_INIT_FLAG_DATA_SYNC); assert(ret == TRITON_SUCCESS); @@ -363,7 +390,7 @@ int main(int argc, char *argv[]) - if(rank != 0) + if(rank >= nservers) { MPI_Allreduce(&create_elapsed, &elapsed_time, 1, MPI_DOUBLE, MPI_MAX, client_comm); @@ -373,20 +400,21 @@ int main(int argc, char *argv[]) MPI_DOUBLE, MPI_MAX, client_comm); MPI_Allreduce(&remove_elapsed, &remove_min_elapsed_time, 1, MPI_DOUBLE, MPI_MIN, client_comm); - if(rank == 1) + if(rank == nservers) { - int nclients; - MPI_Comm_size(client_comm, &nclients); - - printf("# <op> <nclients> <objs/client> <concurrency> <min> <max> <rate> <niid enabled>\n"); - printf("create\t%d\t%d\t%d\t%f\t%f\t%f\t%d\n", - nclients, nobjects, nconcurrent, min_elapsed_time, elapsed_time, (double)nobjects*(double)(nclients)/elapsed_time, use_niids); - printf("remove\t%d\t%d\t%d\t%f\t%f\t%f\t%d\n", - nclients, nobjects, nconcurrent, remove_min_elapsed_time, remove_elapsed_time, (double)nobjects*(double)(nclients)/remove_elapsed_time, use_niids); - - /* send a message to rank 0 to tell it we are done */ - mpi_ret = MPI_Send(&done_signal, 1, MPI_CHAR, 0, 0, MPI_COMM_WORLD); - assert(mpi_ret == MPI_SUCCESS); + /* first non-server rank */ + printf("# <op> <nclients> <nservers> <objs/client> <concurrency> <min> <max> <rate> <niid enabled>\n"); + printf("create\t%d\t%d\t%d\t%d\t%f\t%f\t%f\t%d\n", + nclients, nservers, nobjects, nconcurrent, min_elapsed_time, elapsed_time, (double)nobjects*(double)(nclients)/elapsed_time, use_niids); + printf("remove\t%d\t%d\t%d\t%d\t%f\t%f\t%f\t%d\n", + nclients, nservers, nobjects, nconcurrent, remove_min_elapsed_time, remove_elapsed_time, (double)nobjects*(double)(nclients)/remove_elapsed_time, use_niids); + + /* send a message to each server to tell it we are done */ + for(i=0; i<nservers; i++) + { + mpi_ret = MPI_Send(&done_signal, 1, MPI_CHAR, i, 0, MPI_COMM_WORLD); + assert(mpi_ret == MPI_SUCCESS); + } } } else @@ -397,6 +425,8 @@ int main(int argc, char *argv[]) aer_service_finalize(); triton_msg_mpi_finalize(); triton_mpi_finalize(); + + free(server_ranks); return 0; } hooks/post-receive -- Triton Repository
participants (1)
-
noreply@mcs.anl.gov