Commit 7611338c authored by Jonathan Jenkins's avatar Jonathan Jenkins

rename "bgp" workload generator to "iolang"

parent 64e2c33e
......@@ -15,7 +15,7 @@
#include "ross.h"
#define MAX_NAME_LENGTH_WKLD 512
typedef struct bgp_params bgp_params;
typedef struct iolang_params iolang_params;
typedef struct darshan_params darshan_params;
typedef struct recorder_params recorder_params;
typedef struct codes_workload_info codes_workload_info;
......@@ -25,7 +25,7 @@ typedef struct scala_trace_params scala_trace_params;
typedef struct dumpi_trace_params dumpi_trace_params;
struct bgp_params
struct iolang_params
{
/* the rank count is defined in the workload config file */
int num_cns;
......
......@@ -96,9 +96,7 @@ IO kernel language, and in-development ScalaTrace
The synthetic IO language is a simple, interpreted set of IO and basic
arithmetic commands meant to simplify the specification and running of
application workloads. In the code it's currently called the "bgp" workload
generator but that is just a historical artifact - in the future it will be
refactored/renamed.
application workloads.
The input for the workload generator consists of an IO kernel metadata file and
a number of IO kernel files. The former specifies a set of kernel files to run
......
......@@ -12,7 +12,7 @@
static char type[128] = {'\0'};
static darshan_params d_params = {"", 0};
static bgp_params b_params = {0, 0, "", ""};
static iolang_params i_params = {0, 0, "", ""};
static recorder_params r_params = {"", 0};
static int n = -1;
......@@ -34,7 +34,7 @@ void usage(){
fprintf(stderr,
"Usage: codes-workload-dump --type TYPE --num-ranks N "
"[--d-log LOG --d-aggregator-cnt CNT]\n"
"--type: type of workload (\"darshan_io_workload\", \"bgp_io_workload\", etc.)\n"
"--type: type of workload (\"darshan_io_workload\", \"iolang_workload\", etc.)\n"
"--num-ranks: number of ranks to process (if not set, it is set by the workload)\n"
"--d-log: darshan log file\n"
"--d-aggregator-cnt: number of aggregators for collective I/O in darshan\n"
......@@ -104,13 +104,13 @@ int main(int argc, char *argv[])
d_params.aggregator_cnt = atol(optarg);
break;
case 'm':
strcpy(b_params.io_kernel_meta_path, optarg);
strcpy(i_params.io_kernel_meta_path, optarg);
break;
case 'r':
b_params.num_cns = atoi(optarg);
i_params.num_cns = atoi(optarg);
break;
case 'p':
b_params.use_relpath = 1;
i_params.use_relpath = 1;
break;
case 'd':
strcpy(r_params.trace_dir_path, optarg);
......@@ -147,24 +147,24 @@ int main(int argc, char *argv[])
wparams = (char*)&d_params;
}
}
else if (strcmp(type, "bgp_io_workload") == 0){
if (b_params.num_cns == 0){
else if (strcmp(type, "iolang_workload") == 0){
if (i_params.num_cns == 0){
if (n == -1){
fprintf(stderr, "Expected \"--i-rank-cnt\" or \"--num-ranks\" argument for bgp io workload\n");
fprintf(stderr, "Expected \"--i-rank-cnt\" or \"--num-ranks\" argument for iolang workload\n");
usage();
return 1;
}
else{
b_params.num_cns = n;
i_params.num_cns = n;
}
}
else if (b_params.io_kernel_meta_path[0] == '\0'){
fprintf(stderr, "Expected \"--i-meta\" argument for bgp io workload\n");
else if (i_params.io_kernel_meta_path[0] == '\0'){
fprintf(stderr, "Expected \"--i-meta\" argument for iolang workload\n");
usage();
return 1;
}
wparams = (char *)&b_params;
wparams = (char *)&i_params;
}
else if (strcmp(type, "recorder_io_workload") == 0){
if (r_params.trace_dir_path[0] == '\0'){
......
......@@ -14,7 +14,7 @@
* could make generators optional via autoconf tests etc. if needed
*/
extern struct codes_workload_method test_workload_method;
extern struct codes_workload_method bgp_io_workload_method;
extern struct codes_workload_method iolang_workload_method;
extern struct codes_workload_method scala_trace_workload_method;
#ifdef USE_DUMPI
extern struct codes_workload_method dumpi_trace_workload_method;
......@@ -29,7 +29,7 @@ extern struct codes_workload_method recorder_io_workload_method;
static struct codes_workload_method *method_array[] =
{
&test_workload_method,
&bgp_io_workload_method,
&iolang_workload_method,
&scala_trace_workload_method,
#ifdef USE_DUMPI
&dumpi_trace_workload_method,
......
......@@ -21,30 +21,30 @@
the BG/P storage model */
/* load the workload file */
int bgp_io_workload_load(const char* params, int rank);
int iolang_io_workload_load(const char* params, int rank);
/* get next operation */
void bgp_io_workload_get_next(int rank, struct codes_workload_op *op);
void iolang_io_workload_get_next(int rank, struct codes_workload_op *op);
/* mapping from bg/p operation enums to CODES workload operations enum */
static int convertTypes(int inst);
static int hash_rank_compare(void *key, struct qhash_head *link);
typedef struct codes_bgp_wrkld_state_per_rank codes_bgp_wrkld_state_per_rank;
typedef struct codes_iolang_wrkld_state_per_rank codes_iolang_wrkld_state_per_rank;
static struct qhash_table *rank_tbl = NULL;
static int rank_tbl_pop = 0;
int num_ranks = -1;
/* implements the codes workload method */
struct codes_workload_method bgp_io_workload_method =
struct codes_workload_method iolang_workload_method =
{
.method_name = "bgp_io_workload",
.codes_workload_load = bgp_io_workload_load,
.codes_workload_get_next = bgp_io_workload_get_next,
.method_name = "iolang_workload",
.codes_workload_load = iolang_io_workload_load,
.codes_workload_get_next = iolang_io_workload_get_next,
};
/* state of the I/O workload that each simulated compute node/MPI rank will have */
struct codes_bgp_wrkld_state_per_rank
struct codes_iolang_wrkld_state_per_rank
{
int rank;
CodesIOKernelContext codes_context;
......@@ -55,18 +55,18 @@ struct codes_bgp_wrkld_state_per_rank
};
/* loads the workload file for each simulated MPI rank/ compute node LP */
int bgp_io_workload_load(const char* params, int rank)
int iolang_io_workload_load(const char* params, int rank)
{
int t = -1;
bgp_params* b_param = (bgp_params*)params;
iolang_params* i_param = (iolang_params*)params;
/* we have to get the number of compute nodes/ranks from the bg/p model parameters
* because the number of ranks are specified in the bgp config file not the
* because the number of ranks are specified in the iolang config file not the
* workload files */
if(num_ranks == -1)
num_ranks = b_param->num_cns;
num_ranks = i_param->num_cns;
codes_bgp_wrkld_state_per_rank* wrkld_per_rank = NULL;
codes_iolang_wrkld_state_per_rank* wrkld_per_rank = NULL;
if(!rank_tbl)
{
rank_tbl = qhash_init(hash_rank_compare, quickhash_32bit_hash, RANK_HASH_TABLE_SIZE);
......@@ -81,11 +81,11 @@ int bgp_io_workload_load(const char* params, int rank)
wrkld_per_rank->codes_pstate = CodesIOKernel_pstate_new();
wrkld_per_rank->rank = rank;
t = codes_kernel_helper_bootstrap(b_param->io_kernel_path,
b_param->io_kernel_meta_path,
t = codes_kernel_helper_bootstrap(i_param->io_kernel_path,
i_param->io_kernel_meta_path,
rank,
num_ranks,
b_param->use_relpath,
i_param->use_relpath,
&(wrkld_per_rank->codes_context),
&(wrkld_per_rank->codes_pstate),
&(wrkld_per_rank->task_info),
......@@ -126,11 +126,11 @@ static int convertTypes(int inst)
}
/* Gets the next operation specified in the workload file for the simulated MPI rank */
void bgp_io_workload_get_next(int rank, struct codes_workload_op *op)
void iolang_io_workload_get_next(int rank, struct codes_workload_op *op)
{
/* If the number of simulated compute nodes per LP is initialized only then we get the next operation
else we return an error code may be? */
codes_bgp_wrkld_state_per_rank* next_wrkld;
codes_iolang_wrkld_state_per_rank* next_wrkld;
struct qhash_head *hash_link = NULL;
hash_link = qhash_search(rank_tbl, &rank);
if(!hash_link)
......@@ -138,7 +138,7 @@ void bgp_io_workload_get_next(int rank, struct codes_workload_op *op)
op->op_type = CODES_WK_END;
return;
}
next_wrkld = qhash_entry(hash_link, struct codes_bgp_wrkld_state_per_rank, hash_link);
next_wrkld = qhash_entry(hash_link, struct codes_iolang_wrkld_state_per_rank, hash_link);
int type = codes_kernel_helper_parse_input(next_wrkld->codes_pstate, &(next_wrkld->codes_context),&(next_wrkld->next_event));
op->op_type = convertTypes(type);
......@@ -210,9 +210,9 @@ void bgp_io_workload_get_next(int rank, struct codes_workload_op *op)
static int hash_rank_compare(void *key, struct qhash_head *link)
{
int *in_rank = (int *)key;
codes_bgp_wrkld_state_per_rank *tmp;
codes_iolang_wrkld_state_per_rank *tmp;
tmp = qhash_entry(link, codes_bgp_wrkld_state_per_rank, hash_link);
tmp = qhash_entry(link, codes_iolang_wrkld_state_per_rank, hash_link);
if (tmp->rank == *in_rank)
return 1;
......
......@@ -151,20 +151,20 @@ int load_workload(char *conf_path, int rank)
return codes_workload_load(workload_type, (char *)&d_params, rank);
}
else if (strcmp(workload_type, "bgp_io_workload") == 0)
else if (strcmp(workload_type, "iolang_workload") == 0)
{
struct bgp_params b_params;
struct iolang_params i_params;
char rank_count[10];
/* get the bgp i/o params from the config file */
/* get the iolang i/o params from the config file */
configuration_get_value(&config, "PARAMS", "io_kernel_meta_path",
NULL, b_params.io_kernel_meta_path, MAX_NAME_LENGTH_WKLD);
NULL, i_params.io_kernel_meta_path, MAX_NAME_LENGTH_WKLD);
configuration_get_value(&config, "PARAMS", "rank_count", NULL, rank_count, 10);
strcpy(b_params.io_kernel_path, "");
b_params.num_cns = atoi(rank_count);
b_params.use_relpath = 1;
strcpy(i_params.io_kernel_path, "");
i_params.num_cns = atoi(rank_count);
i_params.use_relpath = 1;
return codes_workload_load(workload_type, (char *)&b_params, rank);
return codes_workload_load(workload_type, (char *)&i_params, rank);
}
else if (strcmp(workload_type, "recorder_io_workload") == 0) {
struct recorder_params r_params;
......
......@@ -304,9 +304,9 @@ static void handle_client_op_loop_event(
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)
if(strcmp(workload_type, "iolang_workload") == 0)
{
ns->wkld_id = codes_workload_load("bgp_io_workload", (char*)&bgparams, ns->my_rank);
ns->wkld_id = codes_workload_load("iolang_workload", (char*)&ioparams, ns->my_rank);
}
assert(ns->wkld_id > -1);
......
......@@ -12,7 +12,7 @@
extern tw_lptype client_lp;
char workload_type[MAX_NAME_LENGTH_WKLD];
struct bgp_params bgparams;
struct iolang_params ioparams;
void cn_op_complete(tw_lp *lp, tw_stime svc_time, tw_lpid gid);
void cn_op_complete_rc(tw_lp *lp);
......
......@@ -38,13 +38,13 @@ void workload_set_params()
char io_kernel_meta_path[MAX_NAME_LENGTH_WKLD];
configuration_get_value(&config, "PARAMS", "workload_type", NULL, workload_type, MAX_NAME_LENGTH_WKLD);
if(strcmp(workload_type,"bgp_io_workload") == 0)
if(strcmp(workload_type,"iolang_workload") == 0)
{
strcpy(bgparams.io_kernel_path,"");
bgparams.num_cns = NUM_CLIENTS;
strcpy(ioparams.io_kernel_path,"");
ioparams.num_cns = NUM_CLIENTS;
configuration_get_value(&config, "PARAMS", "io_kernel_meta_path", NULL, io_kernel_meta_path, MAX_NAME_LENGTH_WKLD);
strcpy(bgparams.io_kernel_meta_path, io_kernel_meta_path);
strcpy(ioparams.io_kernel_meta_path, io_kernel_meta_path);
}
}
......
#PARAMS
#{
# workload_type = "bgp_io_workload";
# workload_type = "iolang_workload";
# io_kernel_meta_path = "/home/shane/software/codes/wkld_test/meta.txt";
# bgp_config_file = "/home/shane/software/codes/wkld_test/bgp.base.config.txt";
# rank_count = "8";
#}
......
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