Commit e5eea894 authored by Jonathan Jenkins's avatar Jonathan Jenkins

renames - no more dumpi

parent 3f69dcad
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
* *
* Example: * Example:
* *
* job 0 1 2 (<-- jobmap defined "local" IDs) * job 0 1 2 (<-- jobmap defined "job" IDs)
* rank 0 1 2 0 1 0 1 2 3 (<-- jobmap defined "local" IDs) * rank 0 1 2 0 1 0 1 2 3 (<-- jobmap defined "job local" IDs)
* ID 0 1 2 3 4 5 6 7 8 (<-- LP relative "global" ID) * ID 0 1 2 3 4 5 6 7 8 (<-- LP relative "global" IDs)
* LP A B C D E F G H I (<-- provided by codes-mapping) * LP A B C D E F G H I (<-- provided by codes-mapping)
* */ * */
...@@ -26,14 +26,14 @@ enum codes_jobmap_type { ...@@ -26,14 +26,14 @@ enum codes_jobmap_type {
/* the "dummy" jobmap is an example implementation. It simply specifies N /* the "dummy" jobmap is an example implementation. It simply specifies N
* jobs, with exactly one rank per job, with a trivial mapping */ * jobs, with exactly one rank per job, with a trivial mapping */
CODES_JOBMAP_DUMMY, CODES_JOBMAP_DUMMY,
CODES_JOBMAP_DUMPI CODES_JOBMAP_LIST
}; };
struct codes_jobmap_params_dummy { struct codes_jobmap_params_dummy {
int num_jobs; int num_jobs;
}; };
struct codes_jobmap_params_dumpi { struct codes_jobmap_params_list {
char *alloc_file; char *alloc_file;
}; };
......
...@@ -25,7 +25,7 @@ codes_jobmap_configure(enum codes_jobmap_type t, void const * params) ...@@ -25,7 +25,7 @@ codes_jobmap_configure(enum codes_jobmap_type t, void const * params)
case CODES_JOBMAP_DUMMY: case CODES_JOBMAP_DUMMY:
c->impl = &jobmap_dummy_impl; c->impl = &jobmap_dummy_impl;
break; break;
case CODES_JOBMAP_DUMPI: case CODES_JOBMAP_LIST:
c->impl = &jobmap_list_impl; c->impl = &jobmap_list_impl;
break; break;
default: default:
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
return -1; \ return -1; \
}while(0) }while(0)
struct workload_params { struct joblist {
int num_jobs; int num_jobs;
int *num_rank_job; int *num_rank_job;
int **lp_arrays; int **lp_arrays;
...@@ -23,8 +23,8 @@ struct workload_params { ...@@ -23,8 +23,8 @@ struct workload_params {
static int jobmap_list_configure(void const * params, void ** ctx) static int jobmap_list_configure(void const * params, void ** ctx)
{ {
struct codes_jobmap_params_dumpi const * p = params; struct codes_jobmap_params_list const * p = params;
struct workload_params *wp = malloc(sizeof(*wp)); struct joblist *wp = malloc(sizeof(*wp));
assert(wp); assert(wp);
FILE *alloc_file_name = fopen(p->alloc_file, "r"); FILE *alloc_file_name = fopen(p->alloc_file, "r");
...@@ -99,7 +99,7 @@ static int jobmap_list_configure(void const * params, void ** ctx) ...@@ -99,7 +99,7 @@ static int jobmap_list_configure(void const * params, void ** ctx)
static struct codes_jobmap_id jobmap_list_to_local(int id, void const * ctx) static struct codes_jobmap_id jobmap_list_to_local(int id, void const * ctx)
{ {
struct codes_jobmap_id rtn; struct codes_jobmap_id rtn;
struct workload_params *wp = (struct workload_params*)ctx; struct joblist *wp = (struct joblist*)ctx;
for(int i=0; i<wp->num_jobs; i++) for(int i=0; i<wp->num_jobs; i++)
{ {
...@@ -124,7 +124,7 @@ static struct codes_jobmap_id jobmap_list_to_local(int id, void const * ctx) ...@@ -124,7 +124,7 @@ static struct codes_jobmap_id jobmap_list_to_local(int id, void const * ctx)
static int jobmap_list_to_global(struct codes_jobmap_id id, void const * ctx) static int jobmap_list_to_global(struct codes_jobmap_id id, void const * ctx)
{ {
struct workload_params *wp = (struct workload_params*)ctx; struct joblist *wp = (struct joblist*)ctx;
if (id.job < wp->num_jobs) if (id.job < wp->num_jobs)
return wp->lp_arrays[id.job][id.rank]; return wp->lp_arrays[id.job][id.rank];
...@@ -134,7 +134,7 @@ static int jobmap_list_to_global(struct codes_jobmap_id id, void const * ctx) ...@@ -134,7 +134,7 @@ static int jobmap_list_to_global(struct codes_jobmap_id id, void const * ctx)
int jobmap_list_get_num_jobs(void const * ctx) int jobmap_list_get_num_jobs(void const * ctx)
{ {
struct workload_params *wp = (struct workload_params*)ctx; struct joblist *wp = (struct joblist*)ctx;
return wp->num_jobs; return wp->num_jobs;
} }
...@@ -142,7 +142,7 @@ int jobmap_list_get_num_jobs(void const * ctx) ...@@ -142,7 +142,7 @@ int jobmap_list_get_num_jobs(void const * ctx)
static void jobmap_list_destroy(void * ctx) static void jobmap_list_destroy(void * ctx)
{ {
struct workload_params *wp = (struct workload_params*)ctx; struct joblist *wp = (struct joblist*)ctx;
for(int i=0; i<wp->num_jobs; i++){ for(int i=0; i<wp->num_jobs; i++){
free(wp->lp_arrays[i]); free(wp->lp_arrays[i]);
} }
......
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