Commit 67d30ee0 authored by Philip Carns's avatar Philip Carns

stub for example generator method

parent 11a81432
......@@ -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
......@@ -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 */
......
/*
* 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
*/
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