Commit a95782bd authored by Misbah Mubarak's avatar Misbah Mubarak
Browse files

Updating the workload test to use the config file for the 'bgp_io_workload'...

Updating the workload test to use the config file for the 'bgp_io_workload' and 'test' workload types. Loads the workload file for the bgp_io_workload type. Tests for remaining operations are to be added
parent aa606824
...@@ -13,16 +13,17 @@ ...@@ -13,16 +13,17 @@
#define CODES_WORKLOAD_H #define CODES_WORKLOAD_H
#include "ross.h" #include "ross.h"
#define MAX_NAME_LENGTH 512
typedef struct bgp_params bgp_params; typedef struct bgp_params bgp_params;
struct bgp_params struct bgp_params
{ {
int num_cns_per_lp; int num_cns_per_lp;
char* io_kernel_meta_path; char io_kernel_meta_path[MAX_NAME_LENGTH];
char* bgp_config_file; char bgp_config_file[MAX_NAME_LENGTH];
char* io_kernel_path; char io_kernel_path[MAX_NAME_LENGTH];
char* io_kernel_def_path; char io_kernel_def_path[MAX_NAME_LENGTH];
}; };
/* supported I/O operations */ /* supported I/O operations */
......
1- To run the test use:
mpirun -np 4 ./codes-workload-test --sync=2 codes-workload-test.conf
2- To modify the codes-workload-test.conf file, change the 'workload_type' parameters. If using bgp_io_workload type, change the io_kernel_meta_path and bgp_config_file parameters according to your local path.
3- Currently, the bgp_io_workload type only loads the workload file. TODO: read the operations inside the workload file one by one, load the appropriate parameters and display them correctly.
...@@ -299,7 +299,15 @@ static void handle_client_op_loop_event( ...@@ -299,7 +299,15 @@ static void handle_client_op_loop_event(
{ {
/* first operation; initialize the desired workload generator */ /* first operation; initialize the desired workload generator */
printf("codes_workload_load on gid: %ld\n", lp->gid); printf("codes_workload_load on gid: %ld\n", lp->gid);
ns->wkld_id = codes_workload_load("test", NULL, ns->my_rank);
if(strcmp(workload_type, "test") == 0)
ns->wkld_id = codes_workload_load("test", NULL, ns->my_rank);
else
if(strcmp(workload_type, "bgp_io_workload") == 0)
{
ns->wkld_id = codes_workload_load("bgp_io_workload", (char*)&bgparams, ns->my_rank);
}
assert(ns->wkld_id > -1); assert(ns->wkld_id > -1);
} }
...@@ -307,7 +315,7 @@ static void handle_client_op_loop_event( ...@@ -307,7 +315,7 @@ static void handle_client_op_loop_event(
* inbound message for this function, so that we have it saved for * inbound message for this function, so that we have it saved for
* reverse computation if needed. * reverse computation if needed.
*/ */
codes_workload_get_next(ns->wkld_id, ns->my_rank, &m->op_rc); codes_workload_get_next(ns->wkld_id, ns->my_rank, &m->op_rc);
/* NOTE: in this test model the LP is doing its own math to find the LP /* NOTE: in this test model the LP is doing its own math to find the LP
* ID of servers just to do something simple. It knows that compute * ID of servers just to do something simple. It knows that compute
...@@ -316,42 +324,46 @@ static void handle_client_op_loop_event( ...@@ -316,42 +324,46 @@ static void handle_client_op_loop_event(
switch(m->op_rc.op_type) switch(m->op_rc.op_type)
{ {
/* this first set of operation types are handled exclusively by the /* this first set of operation types are handled exclusively by the
* client * client
*/ */
case CODES_WK_END: case CODES_WK_END:
ns->completion_time = tw_now(lp); ns->completion_time = tw_now(lp);
printf("Client rank %d completed workload.\n", ns->my_rank); printf("Client rank %d completed workload.\n", ns->my_rank);
/* stop issuing events; we are done */ /* stop issuing events; we are done */
return; return;
break; break;
case CODES_WK_BARRIER: case CODES_WK_BARRIER:
printf("Client rank %d hit barrier.\n", ns->my_rank); printf("Client rank %d hit barrier.\n", ns->my_rank);
cn_enter_barrier(lp, m->op_rc.u.barrier.root, m->op_rc.u.barrier.count); cn_enter_barrier(lp, m->op_rc.u.barrier.root, m->op_rc.u.barrier.count);
return; return;
break; break;
/*case CODES_WK_WRITE:
printf("Client rank %d initiate write operation size %d offset %d .\n", ns->my_rank, (int)m->op_rc.u.write.size, (int)m->op_rc.u.write.offset);
break;*/
case CODES_WK_DELAY: case CODES_WK_DELAY:
printf("Client rank %d will delay for %f seconds.\n", ns->my_rank, printf("Client rank %d will delay for %f seconds.\n", ns->my_rank,
m->op_rc.u.delay.seconds); m->op_rc.u.delay.seconds);
cn_delay(lp, m->op_rc.u.delay.seconds); cn_delay(lp, m->op_rc.u.delay.seconds);
return; return;
break; break;
/* "normal" io operations: we just calculate the destination and /* "normal" io operations: we just calculate the destination and
* then continue after the switch block to send the specified * then continue after the switch block to send the specified
* operation to a server. * operation to a server.
*/ */
case CODES_WK_OPEN: case CODES_WK_OPEN:
printf("Client rank %d will issue an open request.\n", ns->my_rank); printf("Client rank %d will issue an open request.\n", ns->my_rank);
dest_svr_id = g_num_clients + m->op_rc.u.open.file_id % g_num_servers; dest_svr_id = g_num_clients + m->op_rc.u.open.file_id % g_num_servers;
break; break;
default: default:
assert(0); //printf(" \n Operation not supported anymore (I/O language specific operations) ");
break; //assert(0);
} return;
break;
}
svr_op_start(lp, dest_svr_id, &m->op_rc); svr_op_start(lp, dest_svr_id, &m->op_rc);
return; return;
} }
......
...@@ -6,11 +6,14 @@ ...@@ -6,11 +6,14 @@
#ifndef CODES_WORKLOAD_TEST_CN_LP_H #ifndef CODES_WORKLOAD_TEST_CN_LP_H
#define CODES_WORKLOAD_TEST_CN_LP_H #define CODES_WORKLOAD_TEST_CN_LP_H
#define MAX_NAME_LENGTH 512
#include <ross.h> #include <ross.h>
#include "codes/codes-workload.h" #include "codes/codes-workload.h"
extern tw_lptype client_lp; extern tw_lptype client_lp;
char workload_type[MAX_NAME_LENGTH];
struct bgp_params bgparams;
void cn_op_complete(tw_lp *lp, tw_stime svc_time, tw_lpid gid); void cn_op_complete(tw_lp *lp, tw_stime svc_time, tw_lpid gid);
void cn_op_complete_rc(tw_lp *lp); void cn_op_complete_rc(tw_lp *lp);
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "codes/lp-io.h" #include "codes/lp-io.h"
#include "codes/codes.h" #include "codes/codes.h"
#include "codes/codes-workload.h" #include "codes/codes-workload.h"
#include "codes/configuration.h"
#include "codes-workload-test-svr-lp.h" #include "codes-workload-test-svr-lp.h"
#include "codes-workload-test-cn-lp.h" #include "codes-workload-test-cn-lp.h"
...@@ -30,6 +31,31 @@ const tw_optdef app_opt[] = { ...@@ -30,6 +31,31 @@ const tw_optdef app_opt[] = {
TWOPT_END() TWOPT_END()
}; };
static int num_clients_per_lp = -1;
void workload_set_params()
{
config_lpgroups_t paramconf;
char io_kernel_meta_path[MAX_NAME_LENGTH];
char bgp_config_file[MAX_NAME_LENGTH];
configuration_get_lpgroups(&config, "PARAMS", &paramconf);
configuration_get_value(&config, "PARAMS", "workload_type", workload_type, MAX_NAME_LENGTH);
if(strcmp(workload_type,"bgp_io_workload") == 0)
{
strcpy(bgparams.io_kernel_path,"");
strcpy(bgparams.io_kernel_def_path, "");
configuration_get_value(&config, "PARAMS", "io_kernel_meta_path", io_kernel_meta_path, MAX_NAME_LENGTH);
strcpy(bgparams.io_kernel_meta_path, io_kernel_meta_path);
configuration_get_value(&config, "PARAMS", "bgp_config_file", bgp_config_file, MAX_NAME_LENGTH);
strcpy(bgparams.bgp_config_file, bgp_config_file);
bgparams.num_cns_per_lp = num_clients_per_lp;
}
}
int main( int main(
int argc, int argc,
char **argv) char **argv)
...@@ -55,8 +81,19 @@ int main( ...@@ -55,8 +81,19 @@ int main(
exit(-1); exit(-1);
} }
if(argc < 2)
{
printf("\n Usage: mpirun <args> --sync=2/3 mapping_file_name.conf (optional --nkp) ");
exit(-1);
}
lps_per_proc = (NUM_SERVERS+NUM_CLIENTS) / nprocs; lps_per_proc = (NUM_SERVERS+NUM_CLIENTS) / nprocs;
num_clients_per_lp = NUM_CLIENTS / nprocs;
configuration_load(argv[2], MPI_COMM_WORLD, &config);
tw_define_lps(lps_per_proc, 512, 0); tw_define_lps(lps_per_proc, 512, 0);
for(i=0; i<lps_per_proc; i++) for(i=0; i<lps_per_proc; i++)
...@@ -77,6 +114,7 @@ int main( ...@@ -77,6 +114,7 @@ int main(
return(-1); return(-1);
} }
workload_set_params();
tw_run(); tw_run();
ret = lp_io_flush(handle, MPI_COMM_WORLD); ret = lp_io_flush(handle, MPI_COMM_WORLD);
......
PARAMS
{
workload_type = "bgp_io_workload";
io_kernel_meta_path = "/home/mubarm/codes_radix/codes-base/tests/workload/hybrid.meta.txt";
bgp_config_file = "/home/mubarm/codes_radix/codes-base/tests/workload/bgp.base.config";
}
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