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
67d30ee0
Commit
67d30ee0
authored
Sep 17, 2013
by
Philip Carns
Browse files
stub for example generator method
parent
11a81432
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Makefile.subdir
View file @
67d30ee0
...
...
@@ -101,4 +101,5 @@ src_libcodes_base_a_SOURCES = \
codes/timeline.h
\
src/logging/timeline.c
\
src/workload/codes-workload.c
\
src/workload/codes-workload-method.h
src/workload/codes-workload-method.h
\
src/workload/test-workload-method.c
src/workload/codes-workload-method.h
View file @
67d30ee0
...
...
@@ -15,9 +15,12 @@
#include
"ross.h"
#include
"codes/codes-workload.h"
int
codes_workload_load
(
const
char
*
type
,
const
char
*
params
,
int
rank
);
void
codes_workload_get_next
(
int
wkld_id
,
struct
codes_workload_op
*
op
);
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
wkld_id
,
struct
codes_workload_op
*
op
);
};
#endif
/* CODES_WORKLOAD_METHOD_H */
...
...
src/workload/test-workload-method.c
0 → 100644
View file @
67d30ee0
/*
* Copyright (C) 2013 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
/* Example of a workload generator that plugs into the codes workload
* generator API. This example just produces a hard-coded pattern for
* testing/validation purposes.
*/
#include
"ross.h"
#include
"codes/codes-workload.h"
#include
"codes-workload-method.h"
int
test_workload_load
(
const
char
*
params
,
int
rank
);
void
test_workload_get_next
(
int
wkld_id
,
struct
codes_workload_op
*
op
);
struct
codes_workload_method
test_workload_method
=
{
.
method_name
=
"test"
,
.
codes_workload_load
=
test_workload_load
,
.
codes_workload_get_next
=
test_workload_get_next
,
};
int
test_workload_load
(
const
char
*
params
,
int
rank
)
{
/* just use the rank of the caller as the identifier */
/* no params in this case; this example will work with any number of
* ranks
*/
return
rank
;
}
void
test_workload_get_next
(
int
wkld_id
,
struct
codes_workload_op
*
op
)
{
/* TODO: fill in a more complex example... */
op
->
op_type
=
CODES_WK_END
;
return
;
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ft=c ts=8 sts=4 sw=4 expandtab
*/
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