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
Elsa Gonsiorowski
codes
Commits
722c1fc4
Commit
722c1fc4
authored
Jun 17, 2015
by
Jonathan Jenkins
Browse files
add application id parameter to workload functions
currently ignored by all
parent
37ae6615
Changes
11
Hide whitespace changes
Inline
Side-by-side
codes/codes-workload.h
View file @
722c1fc4
...
...
@@ -186,19 +186,21 @@ struct codes_workload_op
struct
{
int
num_bytes
;
}
collective
;
struct
{
int
count
;
int16_t
*
req_ids
;
}
waits
;
struct
{
int16_t
req_id
;
}
wait
;
struct
{
int
count
;
int16_t
*
req_ids
;
}
waits
;
struct
{
int16_t
req_id
;
}
wait
;
}
u
;
};
/* load and initialize workload of of type "type" with parameters specified by
* "params". The rank is the caller's relative rank within the collection
* of processes that will participate in this workload.
* of processes that will participate in this workload. The app_id is the
* "application" that the rank is participating in, used to differentiate
* between multiple, concurrent workloads
*
* This function is intended to be called by a compute node LP in a model
* and may be called multiple times over the course of a
...
...
@@ -207,22 +209,41 @@ struct codes_workload_op
* Returns and identifier that can be used to retrieve operations later.
* Returns -1 on failure.
*/
int
codes_workload_load
(
const
char
*
type
,
const
char
*
params
,
int
rank
);
int
codes_workload_load
(
const
char
*
type
,
const
char
*
params
,
int
app_id
,
int
rank
);
/* Retrieves the next I/O operation to execute. the wkld_id is the
* identifier returned by the init() function. The op argument is a pointer
* to a structure to be filled in with I/O operation information.
*/
void
codes_workload_get_next
(
int
wkld_id
,
int
rank
,
struct
codes_workload_op
*
op
);
void
codes_workload_get_next
(
int
wkld_id
,
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
);
/* Reverse of the above function. */
void
codes_workload_get_next_rc
(
int
wkld_id
,
int
rank
,
const
struct
codes_workload_op
*
op
);
void
codes_workload_get_next_rc
(
int
wkld_id
,
int
app_id
,
int
rank
,
const
struct
codes_workload_op
*
op
);
/* Retrieve the number of ranks contained in a workload */
int
codes_workload_get_rank_cnt
(
const
char
*
type
,
const
char
*
params
);
int
codes_workload_get_rank_cnt
(
const
char
*
type
,
const
char
*
params
,
int
app_id
);
/* for debugging/logging: print an individual operation to the specified file */
void
codes_workload_print_op
(
FILE
*
f
,
struct
codes_workload_op
*
op
,
int
rank
);
void
codes_workload_print_op
(
FILE
*
f
,
struct
codes_workload_op
*
op
,
int
app_id
,
int
rank
);
/* NOTE: there is deliberately no finalize function; we don't have any
* reliable way to tell when a workload is truly done and will not
...
...
@@ -236,6 +257,7 @@ void codes_workload_print_op(FILE *f, struct codes_workload_op *op, int rank);
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*
* vim: ft=c ts=8 sts=4 sw=4 expandtab
...
...
src/workload/codes-workload-dump.c
View file @
722c1fc4
...
...
@@ -215,7 +215,7 @@ int main(int argc, char *argv[])
/* if num_ranks not set, pull it from the workload */
if
(
n
==
-
1
){
n
=
codes_workload_get_rank_cnt
(
type
,
wparams
);
n
=
codes_workload_get_rank_cnt
(
type
,
wparams
,
0
);
if
(
n
==
-
1
)
{
fprintf
(
stderr
,
"Unable to get rank count from workload. "
...
...
@@ -227,11 +227,11 @@ int main(int argc, char *argv[])
for
(
i
=
0
;
i
<
n
;
i
++
){
struct
codes_workload_op
op
;
printf
(
"loading %s, %d
\n
"
,
type
,
i
);
int
id
=
codes_workload_load
(
type
,
wparams
,
i
);
int
id
=
codes_workload_load
(
type
,
wparams
,
0
,
i
);
assert
(
id
!=
-
1
);
do
{
codes_workload_get_next
(
id
,
i
,
&
op
);
codes_workload_print_op
(
stdout
,
&
op
,
i
);
codes_workload_get_next
(
id
,
0
,
i
,
&
op
);
codes_workload_print_op
(
stdout
,
&
op
,
0
,
i
);
switch
(
op
.
op_type
)
{
...
...
src/workload/codes-workload-method.h
View file @
722c1fc4
...
...
@@ -18,9 +18,9 @@
struct
codes_workload_method
{
char
*
method_name
;
/* name of the generator */
int
(
*
codes_workload_load
)(
const
char
*
params
,
int
rank
);
void
(
*
codes_workload_get_next
)(
int
rank
,
struct
codes_workload_op
*
op
);
int
(
*
codes_workload_get_rank_cnt
)(
const
char
*
params
);
int
(
*
codes_workload_load
)(
const
char
*
params
,
int
app_id
,
int
rank
);
void
(
*
codes_workload_get_next
)(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
);
int
(
*
codes_workload_get_rank_cnt
)(
const
char
*
params
,
int
app_id
);
};
#endif
/* CODES_WORKLOAD_METHOD_H */
...
...
src/workload/codes-workload.c
View file @
722c1fc4
...
...
@@ -67,7 +67,11 @@ struct rank_queue
static
struct
rank_queue
*
ranks
=
NULL
;
int
codes_workload_load
(
const
char
*
type
,
const
char
*
params
,
int
rank
)
int
codes_workload_load
(
const
char
*
type
,
const
char
*
params
,
int
app_id
,
int
rank
)
{
int
i
;
int
ret
;
...
...
@@ -78,7 +82,7 @@ int codes_workload_load(const char* type, const char* params, int rank)
if
(
strcmp
(
method_array
[
i
]
->
method_name
,
type
)
==
0
)
{
/* load appropriate workload generator */
ret
=
method_array
[
i
]
->
codes_workload_load
(
params
,
rank
);
ret
=
method_array
[
i
]
->
codes_workload_load
(
params
,
app_id
,
rank
);
if
(
ret
<
0
)
{
return
(
-
1
);
...
...
@@ -110,7 +114,11 @@ int codes_workload_load(const char* type, const char* params, int rank)
return
(
-
1
);
}
void
codes_workload_get_next
(
int
wkld_id
,
int
rank
,
struct
codes_workload_op
*
op
)
void
codes_workload_get_next
(
int
wkld_id
,
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
)
{
struct
rank_queue
*
tmp
;
struct
rc_op
*
tmp_op
;
...
...
@@ -133,18 +141,20 @@ void codes_workload_get_next(int wkld_id, int rank, struct codes_workload_op *op
*
op
=
tmp_op
->
op
;
free
(
tmp_op
);
//printf("codes_workload_get_next re-issuing reversed operation.\n");
return
;
}
/* ask generator for the next operation */
//printf("codes_workload_get_next issuing new operation.\n");
method_array
[
wkld_id
]
->
codes_workload_get_next
(
rank
,
op
);
method_array
[
wkld_id
]
->
codes_workload_get_next
(
rank
,
app_id
,
op
);
return
;
}
void
codes_workload_get_next_rc
(
int
wkld_id
,
int
rank
,
const
struct
codes_workload_op
*
op
)
void
codes_workload_get_next_rc
(
int
wkld_id
,
int
app_id
,
int
rank
,
const
struct
codes_workload_op
*
op
)
{
struct
rank_queue
*
tmp
;
struct
rc_op
*
tmp_op
;
...
...
@@ -167,7 +177,10 @@ void codes_workload_get_next_rc(int wkld_id, int rank, const struct codes_worklo
return
;
}
int
codes_workload_get_rank_cnt
(
const
char
*
type
,
const
char
*
params
)
int
codes_workload_get_rank_cnt
(
const
char
*
type
,
const
char
*
params
,
int
app_id
)
{
int
i
;
int
rank_cnt
;
...
...
@@ -176,7 +189,8 @@ int codes_workload_get_rank_cnt(const char* type, const char* params)
{
if
(
strcmp
(
method_array
[
i
]
->
method_name
,
type
)
==
0
)
{
rank_cnt
=
method_array
[
i
]
->
codes_workload_get_rank_cnt
(
params
);
rank_cnt
=
method_array
[
i
]
->
codes_workload_get_rank_cnt
(
params
,
app_id
);
assert
(
rank_cnt
>
0
);
return
(
rank_cnt
);
}
...
...
@@ -186,41 +200,46 @@ int codes_workload_get_rank_cnt(const char* type, const char* params)
return
(
-
1
);
}
void
codes_workload_print_op
(
FILE
*
f
,
struct
codes_workload_op
*
op
,
int
rank
){
void
codes_workload_print_op
(
FILE
*
f
,
struct
codes_workload_op
*
op
,
int
app_id
,
int
rank
)
{
switch
(
op
->
op_type
){
case
CODES_WK_END
:
fprintf
(
f
,
"op: rank:%d type:end
\n
"
,
rank
);
fprintf
(
f
,
"op:
app:%d
rank:%d type:end
\n
"
,
app_id
,
rank
);
break
;
case
CODES_WK_DELAY
:
fprintf
(
f
,
"op: rank:%d type:delay seconds:%lf
\n
"
,
fprintf
(
f
,
"op:
app:%d
rank:%d type:delay seconds:%lf
\n
"
,
rank
,
op
->
u
.
delay
.
seconds
);
break
;
case
CODES_WK_BARRIER
:
fprintf
(
f
,
"op: rank:%d type:barrier count:%d root:%d
\n
"
,
fprintf
(
f
,
"op:
app:%d
rank:%d type:barrier count:%d root:%d
\n
"
,
rank
,
op
->
u
.
barrier
.
count
,
op
->
u
.
barrier
.
root
);
break
;
case
CODES_WK_OPEN
:
fprintf
(
f
,
"op: rank:%d type:open file_id:%lu flag:%d
\n
"
,
fprintf
(
f
,
"op:
app:%d
rank:%d type:open file_id:%lu flag:%d
\n
"
,
rank
,
op
->
u
.
open
.
file_id
,
op
->
u
.
open
.
create_flag
);
break
;
case
CODES_WK_CLOSE
:
fprintf
(
f
,
"op: rank:%d type:close file_id:%lu
\n
"
,
fprintf
(
f
,
"op:
app:%d
rank:%d type:close file_id:%lu
\n
"
,
rank
,
op
->
u
.
close
.
file_id
);
break
;
case
CODES_WK_WRITE
:
fprintf
(
f
,
"op: rank:%d type:write "
fprintf
(
f
,
"op:
app:%d
rank:%d type:write "
"file_id:%lu off:%lu size:%lu
\n
"
,
rank
,
op
->
u
.
write
.
file_id
,
op
->
u
.
write
.
offset
,
op
->
u
.
write
.
size
);
break
;
case
CODES_WK_READ
:
fprintf
(
f
,
"op: rank:%d type:read "
fprintf
(
f
,
"op:
app:%d
rank:%d type:read "
"file_id:%lu off:%lu size:%lu
\n
"
,
rank
,
op
->
u
.
read
.
file_id
,
op
->
u
.
read
.
offset
,
op
->
u
.
read
.
size
);
break
;
case
CODES_WK_SEND
:
fprintf
(
f
,
"op: rank:%d type:send "
fprintf
(
f
,
"op:
app:%d
rank:%d type:send "
"src:%d dst:%d bytes:%d type:%d count:%d tag:%d
\n
"
,
rank
,
op
->
u
.
send
.
source_rank
,
op
->
u
.
send
.
dest_rank
,
...
...
@@ -228,7 +247,7 @@ void codes_workload_print_op(FILE *f, struct codes_workload_op *op, int rank){
op
->
u
.
send
.
count
,
op
->
u
.
send
.
tag
);
break
;
case
CODES_WK_RECV
:
fprintf
(
f
,
"op: rank:%d type:recv "
fprintf
(
f
,
"op:
app:%d
rank:%d type:recv "
"src:%d dst:%d bytes:%d type:%d count:%d tag:%d
\n
"
,
rank
,
op
->
u
.
recv
.
source_rank
,
op
->
u
.
recv
.
dest_rank
,
...
...
@@ -236,7 +255,7 @@ void codes_workload_print_op(FILE *f, struct codes_workload_op *op, int rank){
op
->
u
.
recv
.
count
,
op
->
u
.
recv
.
tag
);
break
;
case
CODES_WK_ISEND
:
fprintf
(
f
,
"op: rank:%d type:isend "
fprintf
(
f
,
"op:
app:%d
rank:%d type:isend "
"src:%d dst:%d bytes:%d type:%d count:%d tag:%d
\n
"
,
rank
,
op
->
u
.
send
.
source_rank
,
op
->
u
.
send
.
dest_rank
,
...
...
@@ -244,7 +263,7 @@ void codes_workload_print_op(FILE *f, struct codes_workload_op *op, int rank){
op
->
u
.
send
.
count
,
op
->
u
.
send
.
tag
);
break
;
case
CODES_WK_IRECV
:
fprintf
(
f
,
"op: rank:%d type:irecv "
fprintf
(
f
,
"op:
app:%d
rank:%d type:irecv "
"src:%d dst:%d bytes:%d type:%d count:%d tag:%d
\n
"
,
rank
,
op
->
u
.
recv
.
source_rank
,
op
->
u
.
recv
.
dest_rank
,
...
...
@@ -252,53 +271,53 @@ void codes_workload_print_op(FILE *f, struct codes_workload_op *op, int rank){
op
->
u
.
recv
.
count
,
op
->
u
.
recv
.
tag
);
break
;
case
CODES_WK_BCAST
:
fprintf
(
f
,
"op: rank:%d type:bcast "
fprintf
(
f
,
"op:
app:%d
rank:%d type:bcast "
"bytes:%d
\n
"
,
rank
,
op
->
u
.
collective
.
num_bytes
);
break
;
case
CODES_WK_ALLGATHER
:
fprintf
(
f
,
"op: rank:%d type:allgather "
fprintf
(
f
,
"op:
app:%d
rank:%d type:allgather "
"bytes:%d
\n
"
,
rank
,
op
->
u
.
collective
.
num_bytes
);
break
;
case
CODES_WK_ALLGATHERV
:
fprintf
(
f
,
"op: rank:%d type:allgatherv "
fprintf
(
f
,
"op:
app:%d
rank:%d type:allgatherv "
"bytes:%d
\n
"
,
rank
,
op
->
u
.
collective
.
num_bytes
);
break
;
case
CODES_WK_ALLTOALL
:
fprintf
(
f
,
"op: rank:%d type:alltoall "
fprintf
(
f
,
"op:
app:%d
rank:%d type:alltoall "
"bytes:%d
\n
"
,
rank
,
op
->
u
.
collective
.
num_bytes
);
break
;
case
CODES_WK_ALLTOALLV
:
fprintf
(
f
,
"op: rank:%d type:alltoallv "
fprintf
(
f
,
"op:
app:%d
rank:%d type:alltoallv "
"bytes:%d
\n
"
,
rank
,
op
->
u
.
collective
.
num_bytes
);
break
;
case
CODES_WK_REDUCE
:
fprintf
(
f
,
"op: rank:%d type:reduce "
fprintf
(
f
,
"op:
app:%d
rank:%d type:reduce "
"bytes:%d
\n
"
,
rank
,
op
->
u
.
collective
.
num_bytes
);
break
;
case
CODES_WK_ALLREDUCE
:
fprintf
(
f
,
"op: rank:%d type:allreduce "
fprintf
(
f
,
"op:
app:%d
rank:%d type:allreduce "
"bytes:%d
\n
"
,
rank
,
op
->
u
.
collective
.
num_bytes
);
break
;
case
CODES_WK_COL
:
fprintf
(
f
,
"op: rank:? type:collective "
"bytes:%d
\n
"
,
op
->
u
.
collective
.
num_bytes
);
fprintf
(
f
,
"op: app:%d rank:%d type:collective "
"bytes:%d
\n
"
,
app_id
,
rank
,
op
->
u
.
collective
.
num_bytes
);
break
;
case
CODES_WK_WAITALL
:
fprintf
(
f
,
"op: app:%d rank:%d type:waitall "
"num reqs: :%d
\n
"
,
op
->
u
.
waits
.
count
);
break
;
case
CODES_WK_WAIT
:
fprintf
(
f
,
"op: app:%d rank:%d type:wait "
"num reqs: :%d
\n
"
,
op
->
u
.
wait
.
req_id
);
break
;
case
CODES_WK_WAITSOME
:
fprintf
(
f
,
"op: app:%d rank:%d type:waitsome "
"num reqs: :%d
\n
"
,
op
->
u
.
waits
.
count
);
break
;
case
CODES_WK_WAITANY
:
fprintf
(
f
,
"op: app:%d rank:%d type:waitany "
"num reqs: :%d
\n
"
,
op
->
u
.
waits
.
count
);
break
;
case
CODES_WK_WAITALL
:
fprintf
(
f
,
"op: rank:? type:waitall "
"num reqs: :%d
\n
"
,
op
->
u
.
waits
.
count
);
break
;
case
CODES_WK_WAIT
:
fprintf
(
f
,
"op: rank:? type:wait "
"num reqs: :%d
\n
"
,
op
->
u
.
wait
.
req_id
);
break
;
case
CODES_WK_WAITSOME
:
fprintf
(
f
,
"op: rank:? type:waitsome "
"num reqs: :%d
\n
"
,
op
->
u
.
waits
.
count
);
break
;
case
CODES_WK_WAITANY
:
fprintf
(
f
,
"op: rank:? type:waitany "
"num reqs: :%d
\n
"
,
op
->
u
.
waits
.
count
);
break
;
case
CODES_WK_IGNORE
:
break
;
default:
...
...
@@ -312,6 +331,7 @@ void codes_workload_print_op(FILE *f, struct codes_workload_op *op, int rank){
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*
* vim: ft=c ts=8 sts=4 sw=4 expandtab
...
...
src/workload/methods/codes-darshan-io-wrkld.c
View file @
722c1fc4
...
...
@@ -44,9 +44,9 @@ struct rank_io_context
};
/* Darshan workload generator's implementation of the CODES workload API */
static
int
darshan_io_workload_load
(
const
char
*
params
,
int
rank
);
static
void
darshan_io_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
);
static
int
darshan_io_workload_get_rank_cnt
(
const
char
*
params
);
static
int
darshan_io_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
);
static
void
darshan_io_workload_get_next
(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
);
static
int
darshan_io_workload_get_rank_cnt
(
const
char
*
params
,
int
app_id
);
static
int
darshan_rank_hash_compare
(
void
*
key
,
struct
qhash_head
*
link
);
/* Darshan I/O op data structure access (insert, remove) abstraction */
...
...
@@ -105,7 +105,7 @@ static struct qhash_table *rank_tbl = NULL;
static
int
rank_tbl_pop
=
0
;
/* load the workload generator for this rank, given input params */
static
int
darshan_io_workload_load
(
const
char
*
params
,
int
rank
)
static
int
darshan_io_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
)
{
darshan_params
*
d_params
=
(
darshan_params
*
)
params
;
darshan_fd
logfile_fd
;
...
...
@@ -201,7 +201,7 @@ static int darshan_io_workload_load(const char *params, int rank)
}
/* pull the next event (independent or collective) for this rank from its event context */
static
void
darshan_io_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
)
static
void
darshan_io_workload_get_next
(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
)
{
int64_t
my_rank
=
(
int64_t
)
rank
;
struct
qhash_head
*
hash_link
=
NULL
;
...
...
@@ -252,7 +252,7 @@ static void darshan_io_workload_get_next(int rank, struct codes_workload_op *op)
return
;
}
static
int
darshan_io_workload_get_rank_cnt
(
const
char
*
params
)
static
int
darshan_io_workload_get_rank_cnt
(
const
char
*
params
,
int
app_id
)
{
darshan_params
*
d_params
=
(
darshan_params
*
)
params
;
darshan_fd
logfile_fd
;
...
...
@@ -1718,6 +1718,7 @@ static void file_sanity_check(
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*
* vim: ft=c ts=8 sts=4 sw=4 expandtab
...
...
src/workload/methods/codes-dumpi-trace-nw-wrkld.c
View file @
722c1fc4
...
...
@@ -43,10 +43,10 @@ typedef struct dumpi_op_data_array
}
dumpi_op_data_array
;
/* load the trace */
int
dumpi_trace_nw_workload_load
(
const
char
*
params
,
int
rank
);
int
dumpi_trace_nw_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
);
/* dumpi implementation of get next operation in the workload */
void
dumpi_trace_nw_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
);
void
dumpi_trace_nw_workload_get_next
(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
);
/* get number of bytes from the workload data type and count */
int
get_num_bytes
(
dumpi_datatype
dt
);
...
...
@@ -499,7 +499,7 @@ static int hash_rank_compare(void *key, struct qhash_head *link)
return
0
;
}
int
dumpi_trace_nw_workload_load
(
const
char
*
params
,
int
rank
)
int
dumpi_trace_nw_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
)
{
libundumpi_callbacks
callbacks
;
libundumpi_cbpair
callarr
[
DUMPI_END_OF_STREAM
];
...
...
@@ -681,7 +681,7 @@ int get_num_bytes(dumpi_datatype dt)
}
}
void
dumpi_trace_nw_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
)
void
dumpi_trace_nw_workload_get_next
(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
)
{
rank_mpi_context
*
temp_data
;
struct
qhash_head
*
hash_link
=
NULL
;
...
...
@@ -725,6 +725,7 @@ struct codes_workload_method dumpi_trace_workload_method =
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*
* vim: ft=c ts=8 sts=4 sw=4 expandtab
...
...
src/workload/methods/codes-iolang-wrkld.c
View file @
722c1fc4
...
...
@@ -21,10 +21,10 @@
the BG/P storage model */
/* load the workload file */
int
iolang_io_workload_load
(
const
char
*
params
,
int
rank
);
int
iolang_io_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
);
/* get next operation */
void
iolang_io_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
);
void
iolang_io_workload_get_next
(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
);
/* mapping from bg/p operation enums to CODES workload operations enum */
static
int
convertTypes
(
int
inst
);
...
...
@@ -55,7 +55,7 @@ struct codes_iolang_wrkld_state_per_rank
};
/* loads the workload file for each simulated MPI rank/ compute node LP */
int
iolang_io_workload_load
(
const
char
*
params
,
int
rank
)
int
iolang_io_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
)
{
int
t
=
-
1
;
iolang_params
*
i_param
=
(
struct
iolang_params
*
)
params
;
...
...
@@ -126,7 +126,7 @@ static int convertTypes(int inst)
}
/* Gets the next operation specified in the workload file for the simulated MPI rank */
void
iolang_io_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
)
void
iolang_io_workload_get_next
(
int
app_id
,
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? */
...
...
src/workload/methods/codes-recorder-io-wrkld.c
View file @
722c1fc4
...
...
@@ -54,8 +54,8 @@ struct rank_traces_context
};
/* CODES workload API functions for workloads generated from recorder traces*/
static
int
recorder_io_workload_load
(
const
char
*
params
,
int
rank
);
static
void
recorder_io_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
);
static
int
recorder_io_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
);
static
void
recorder_io_workload_get_next
(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
);
/* helper functions for recorder workload CODES API */
static
int
hash_rank_compare
(
void
*
key
,
struct
qhash_head
*
link
);
...
...
@@ -73,7 +73,7 @@ static struct qhash_table *rank_tbl = NULL;
static
int
rank_tbl_pop
=
0
;
/* load the workload generator for this rank, given input params */
static
int
recorder_io_workload_load
(
const
char
*
params
,
int
rank
)
static
int
recorder_io_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
)
{
recorder_params
*
r_params
=
(
recorder_params
*
)
params
;
struct
rank_traces_context
*
newv
=
NULL
;
...
...
@@ -337,7 +337,7 @@ static int recorder_io_workload_load(const char *params, int rank)
}
/* pull the next trace (independent or collective) for this rank from its trace context */
static
void
recorder_io_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
)
static
void
recorder_io_workload_get_next
(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
)
{
struct
qhash_head
*
hash_link
=
NULL
;
struct
rank_traces_context
*
tmp
=
NULL
;
...
...
src/workload/methods/test-workload-method.c
View file @
722c1fc4
...
...
@@ -15,8 +15,8 @@
#include
"codes/codes-workload.h"
#include
"src/workload/codes-workload-method.h"
static
int
test_workload_load
(
const
char
*
params
,
int
rank
);
static
void
test_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
);
static
int
test_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
);
static
void
test_workload_get_next
(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
);
/* state information for each rank that is retrieving requests */
struct
wkload_stream_state
...
...
@@ -38,7 +38,7 @@ struct codes_workload_method test_workload_method =
.
codes_workload_get_next
=
test_workload_get_next
,
};
static
int
test_workload_load
(
const
char
*
params
,
int
rank
)
static
int
test_workload_load
(
const
char
*
params
,
int
app_id
,
int
rank
)
{
/* no params in this case; this example will work with any number of
* ranks
...
...
@@ -88,7 +88,7 @@ static int test_workload_load(const char* params, int rank)
}
/* find the next workload operation to issue for this rank */
static
void
test_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
)
static
void
test_workload_get_next
(
int
app_id
,
int
rank
,
struct
codes_workload_op
*
op
)
{
struct
wkload_stream_state
*
tmp
=
wkload_streams
;
struct
wkload_stream_state
*
tmp2
=
wkload_streams
;
...
...
tests/workload/codes-workload-mpi-replay.c
View file @
722c1fc4
...
...
@@ -149,7 +149,7 @@ int load_workload(char *conf_path, int rank)
configuration_get_value
(
&
config
,
"PARAMS"
,
"aggregator_count"
,
NULL
,
aggregator_count
,
10
);
d_params
.
aggregator_cnt
=
atol
(
aggregator_count
);
return
codes_workload_load
(
workload_type
,
(
char
*
)
&
d_params
,
rank
);
return
codes_workload_load
(
workload_type
,
(
char
*
)
&
d_params
,
0
,
rank
);
}
else
if
(
strcmp
(
workload_type
,
"iolang_workload"
)
==
0
)
{
...
...
@@ -164,7 +164,7 @@ int load_workload(char *conf_path, int rank)
i_params
.
num_cns
=
atoi
(
rank_count
);
i_params
.
use_relpath
=
1
;
return
codes_workload_load
(
workload_type
,
(
char
*
)
&
i_params
,
rank
);
return
codes_workload_load
(
workload_type
,
(
char
*
)
&
i_params
,
0
,
rank
);
}
else
if
(
strcmp
(
workload_type
,
"recorder_io_workload"
)
==
0
)
{
struct
recorder_params
r_params
;
...
...
@@ -176,7 +176,7 @@ int load_workload(char *conf_path, int rank)
configuration_get_value
(
&
config
,
"PARAMS"
,
"nprocs"
,
NULL
,
nprocs
,
10
);
r_params
.
nprocs
=
atol
(
nprocs
);
return
codes_workload_load
(
workload_type
,
(
char
*
)
&
r_params
,
rank
);
return
codes_workload_load
(
workload_type
,
(
char
*
)
&
r_params
,
0
,
rank
);
}
else
...
...
@@ -264,7 +264,7 @@ int main(int argc, char *argv[])
while
(
1
)
{
/* get the next replay operation from the workload generator */
codes_workload_get_next
(
workload_id
,
myrank
,
&
next_op
);
codes_workload_get_next
(
workload_id
,
0
,
myrank
,
&
next_op
);
if
(
next_op
.
op_type
!=
CODES_WK_END
)
{
...
...
tests/workload/codes-workload-test-cn-lp.c
View file @
722c1fc4
...
...
@@ -221,7 +221,7 @@ static void handle_client_op_loop_rev_event(
tw_lp
*
lp
)
{
codes_workload_get_next_rc
(
ns
->
wkld_id
,
ns
->
my_rank
,
&
m
->
op_rc
);
codes_workload_get_next_rc
(
ns
->
wkld_id
,
0
,
ns
->
my_rank
,
&
m
->
op_rc
);
switch
(
m
->
op_rc
.
op_type
)
{
...
...
@@ -302,11 +302,11 @@ static void handle_client_op_loop_event(
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
,
0
,
ns
->
my_rank
);
else
if
(
strcmp
(
workload_type
,
"iolang_workload"
)
==
0
)
{
ns
->
wkld_id
=
codes_workload_load
(
"iolang_workload"
,
(
char
*
)
&
ioparams
,
ns
->
my_rank
);
ns
->
wkld_id
=
codes_workload_load
(
"iolang_workload"
,
(
char
*
)
&
ioparams
,
0
,
ns
->
my_rank
);
}
assert
(
ns
->
wkld_id
>
-
1
);
...
...
@@ -316,7 +316,7 @@ static void handle_client_op_loop_event(
* inbound message for this function, so that we have it saved for
* reverse computation if needed.
*/
codes_workload_get_next
(
ns
->
wkld_id
,
ns
->
my_rank
,
&
m
->
op_rc
);