Commit a95782bd authored by Misbah Mubarak's avatar Misbah Mubarak

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);
if(strcmp(workload_type, "test") == 0)
ns->wkld_id = codes_workload_load("test", NULL, ns->my_rank); 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);
} }
...@@ -330,6 +338,9 @@ static void handle_client_op_loop_event( ...@@ -330,6 +338,9 @@ static void handle_client_op_loop_event(
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);
...@@ -346,12 +357,13 @@ static void handle_client_op_loop_event( ...@@ -346,12 +357,13 @@ static void handle_client_op_loop_event(
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) ");
//assert(0);
return;
break; 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