Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
codes
codes
Commits
7611338c
Commit
7611338c
authored
Mar 12, 2015
by
Jonathan Jenkins
Browse files
rename "bgp" workload generator to "iolang"
parent
64e2c33e
Changes
10
Hide whitespace changes
Inline
Side-by-side
codes/codes-workload.h
View file @
7611338c
...
...
@@ -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
;
...
...
doc/GETTING_STARTED
View file @
7611338c
...
...
@@ -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
...
...
src/workload/codes-workload-dump.c
View file @
7611338c
...
...
@@ -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'
){
...
...
src/workload/codes-workload.c
View file @
7611338c
...
...
@@ -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
,
...
...
src/workload/methods/codes-bgp-io-wrkld.c
View file @
7611338c
...
...
@@ -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
;
...
...
tests/workload/codes-workload-mpi-replay.c
View file @
7611338c
...
...
@@ -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
;
...
...
tests/workload/codes-workload-test-cn-lp.c
View file @
7611338c
...
...
@@ -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
*
)
&
bg
params
,
ns
->
my_rank
);
ns
->
wkld_id
=
codes_workload_load
(
"
iolang
_workload"
,
(
char
*
)
&
io
params
,
ns
->
my_rank
);
}
assert
(
ns
->
wkld_id
>
-
1
);
...
...
tests/workload/codes-workload-test-cn-lp.h
View file @
7611338c
...
...
@@ -12,7 +12,7 @@
extern
tw_lptype
client_lp
;
char
workload_type
[
MAX_NAME_LENGTH_WKLD
];
struct
bgp
_params
bg
params
;
struct
iolang
_params
io
params
;
void
cn_op_complete
(
tw_lp
*
lp
,
tw_stime
svc_time
,
tw_lpid
gid
);
void
cn_op_complete_rc
(
tw_lp
*
lp
);
...
...
tests/workload/codes-workload-test.c
View file @
7611338c
...
...
@@ -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
(
bg
params
.
io_kernel_path
,
""
);
bg
params
.
num_cns
=
NUM_CLIENTS
;
strcpy
(
io
params
.
io_kernel_path
,
""
);
io
params
.
num_cns
=
NUM_CLIENTS
;
configuration_get_value
(
&
config
,
"PARAMS"
,
"io_kernel_meta_path"
,
NULL
,
io_kernel_meta_path
,
MAX_NAME_LENGTH_WKLD
);
strcpy
(
bg
params
.
io_kernel_meta_path
,
io_kernel_meta_path
);
strcpy
(
io
params
.
io_kernel_meta_path
,
io_kernel_meta_path
);
}
}
...
...
tests/workload/codes-workload-test.conf
View file @
7611338c
#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";
#}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment