Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
59322599
Commit
59322599
authored
Sep 17, 2013
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
glue together test method and shim layer
parent
67d30ee0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
9 deletions
+38
-9
codes/codes-workload.h
codes/codes-workload.h
+2
-2
src/workload/codes-workload-method.h
src/workload/codes-workload-method.h
+1
-1
src/workload/codes-workload.c
src/workload/codes-workload.c
+32
-2
src/workload/test-workload-method.c
src/workload/test-workload-method.c
+3
-4
No files found.
codes/codes-workload.h
View file @
59322599
...
...
@@ -85,10 +85,10 @@ int codes_workload_load(const char* type, const char* params, int rank);
* 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
,
struct
codes_workload_op
*
op
);
void
codes_workload_get_next
(
int
wkld_id
,
int
rank
,
struct
codes_workload_op
*
op
);
/* Reverse of the above function. */
void
codes_workload_get_next_rc
(
int
wkld_id
,
const
struct
codes_workload_op
*
op
);
void
codes_workload_get_next_rc
(
int
wkld_id
,
int
rank
,
const
struct
codes_workload_op
*
op
);
/* 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
...
...
src/workload/codes-workload-method.h
View file @
59322599
...
...
@@ -19,7 +19,7 @@ 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
);
void
(
*
codes_workload_get_next
)(
int
rank
,
struct
codes_workload_op
*
op
);
};
#endif
/* CODES_WORKLOAD_METHOD_H */
...
...
src/workload/codes-workload.c
View file @
59322599
...
...
@@ -4,23 +4,53 @@
*
*/
#include <assert.h>
#include "ross.h"
#include "codes/codes-workload.h"
#include "codes-workload-method.h"
/* list of available methods. These are statically compiled for now, but we
* could make generators optional via autoconf tests etc. if needed
*/
extern
struct
codes_workload_method
test_workload_method
;
static
struct
codes_workload_method
*
method_array
[]
=
{
&
test_workload_method
,
NULL
};
int
codes_workload_load
(
const
char
*
type
,
const
char
*
params
,
int
rank
)
{
int
i
;
int
ret
;
for
(
i
=
0
;
method_array
[
i
]
!=
NULL
;
i
++
)
{
if
(
strcmp
(
method_array
[
i
]
->
method_name
,
type
)
==
0
)
{
ret
=
method_array
[
i
]
->
codes_workload_load
(
params
,
rank
);
if
(
ret
<
0
)
{
return
(
-
1
);
}
return
(
i
);
}
}
fprintf
(
stderr
,
"Error: failed to find workload generator %s
\n
"
,
type
);
return
(
-
1
);
}
void
codes_workload_get_next
(
int
wkld_id
,
struct
codes_workload_op
*
op
)
void
codes_workload_get_next
(
int
wkld_id
,
int
rank
,
struct
codes_workload_op
*
op
)
{
method_array
[
wkld_id
]
->
codes_workload_get_next
(
rank
,
op
);
return
;
}
void
codes_workload_get_next_rc
(
int
wkld_id
,
const
struct
codes_workload_op
*
op
)
void
codes_workload_get_next_rc
(
int
wkld_id
,
int
rank
,
const
struct
codes_workload_op
*
op
)
{
/* TODO: fill this in */
assert
(
0
);
return
;
}
...
...
src/workload/test-workload-method.c
View file @
59322599
...
...
@@ -14,7 +14,7 @@
#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
);
void
test_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
);
struct
codes_workload_method
test_workload_method
=
{
...
...
@@ -25,14 +25,13 @@ struct codes_workload_method test_workload_method =
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
;
return
(
0
)
;
}
void
test_workload_get_next
(
int
wkld_id
,
struct
codes_workload_op
*
op
)
void
test_workload_get_next
(
int
rank
,
struct
codes_workload_op
*
op
)
{
/* TODO: fill in a more complex example... */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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