drake  1.0.0
include/drake/mapping.h File Reference
#include <stddef.h>
#include <drake/processor.h>
#include <drake/schedule.h>
#include <pelib/structure.h>
Include dependency graph for mapping.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mapping

Defines

#define DRAKE_MAPPING_OUT_WARMUP   "x [*,*]\n"
#define DRAKE_MAPPING_OUT_NODE_COLUMN_WIDTH   6
#define DRAKE_MAPPING_OUT_PROC_COLUMN_WIDTH   4
#define DRAKE_MAPPING_OUT_AFFECT   " :="
#define DRAKE_MAPPING_OUT_ENDING   ";"
#define STRUCT_T   mapping_t
#define DONE_mapping_t   1

Typedefs

typedef struct mapping mapping_t

Functions

int drake_mapping_insert_task (mapping_t *, processor_id, task_t *)
 Insert a new task to this mapping.
int drake_mapping_remove_task (mapping_t *, task_id)
 Removes a task from this mapping.
int drake_mapping_find_processor_index (mapping_t *, processor_id)
 Finds the index of processor in the mapping processor array, from the processor's ID.
processor_id drake_mapping_find_processor (mapping_t *, task_id)
 Finds the processor (its processor_id) which handles the task pointed by the task_id parameter.
int drake_mapping_insert_processor (mapping_t *, processor_t *)
 Inserts a new processor in the mapping.
int drake_mapping_remove_processor (mapping_t *, int)
 Not implemented. Removes a processor from the mapping.
int drake_mapping_violations (mapping_t *)
char * drake_mapping_drawstr (mapping_t *, char *)
int drake_mapping_draw (mapping_t *, FILE *)
 Draws the mapping to a .fig file in the appropriate format.
mapping_tdrake_mapping_loadfile (mapping_t *mapping, FILE *ilp_mapping_file)
 Reads a mapping from the output of the ILP solver.
mapping_tdrake_mapping_loadstr (mapping_t *, char *)
 Reads a mapping from a string in the same format than produced by ilp solver.
mapping_tdrake_mapping_loadfilterstr (mapping_t *mapping, char *str, int(filter)(task_t *))
mapping_tdrake_mapping_loadfilterfile (mapping_t *mapping, FILE *ilp_mapping_file, int(filter)(task_t *))
task_tdrake_mapping_find_task (mapping_t *mapping, task_id id)

Define Documentation

#define DONE_mapping_t   1

Definition at line 53 of file mapping.h.

#define DRAKE_MAPPING_OUT_AFFECT   " :="

Definition at line 32 of file mapping.h.

#define DRAKE_MAPPING_OUT_ENDING   ";"

Definition at line 33 of file mapping.h.

Definition at line 30 of file mapping.h.

Definition at line 31 of file mapping.h.

#define DRAKE_MAPPING_OUT_WARMUP   "x [*,*]\n"

Definition at line 29 of file mapping.h.

#define STRUCT_T   mapping_t

Definition at line 51 of file mapping.h.


Typedef Documentation

typedef struct mapping mapping_t

space-less alias for struct mapping

Definition at line 49 of file mapping.h.


Function Documentation

int drake_mapping_draw ( mapping_t ,
FILE *   
)

Draws the mapping to a .fig file in the appropriate format.

Definition at line 417 of file mapping.c.

char* drake_mapping_drawstr ( mapping_t ,
char *   
)

Generates AMPL output mapping matrix from an instance of mapping_t and place it in a string

Parameters:
mappingInstance of mapping_t
strString that receives the mapping in AMPL output format

Definition at line 348 of file mapping.c.

Finds the processor (its processor_id) which handles the task pointed by the task_id parameter.

Definition at line 149 of file mapping.c.

Finds the index of processor in the mapping processor array, from the processor's ID.

Definition at line 136 of file mapping.c.

task_t* drake_mapping_find_task ( mapping_t mapping,
task_id  id 
)

Find a task in a mapping, using its task id

Parameters:
mappingmapping to search in
idId of the task to find

Definition at line 396 of file mapping.c.

Inserts a new processor in the mapping.

Definition at line 164 of file mapping.c.

Insert a new task to this mapping.

Definition at line 99 of file mapping.c.

mapping_t* drake_mapping_loadfile ( mapping_t mapping,
FILE *  ilp_mapping_file 
)

Reads a mapping from the output of the ILP solver.

Initializes a mapping_t structure and fills it with a mapping file obtained from the ILP solver the parameter mapping should not be initialized, and the same pointer should receive the result of this function

Parameters:
mappingMapping that will point to the data read
ilp_mapping_fileFile from where to read the mapping calculated by the ilp solver

Definition at line 325 of file mapping.c.

mapping_t* drake_mapping_loadfilterfile ( mapping_t mapping,
FILE *  ilp_mapping_file,
int(filter)(task_t *)   
)

Similar to drake_mapping_readfile, but filter tasks according to a given user filter function

Parameters:
mappingMapping that will point to the data read
ilp_mapping_fileFile from where to read the mapping calculated by the ilp solver
filterPointer to a user function that returns 0 if the task should be kept, non zero otherwise.

Definition at line 331 of file mapping.c.

mapping_t* drake_mapping_loadfilterstr ( mapping_t mapping,
char *  str,
int(filter)(task_t *)   
)

Reads a mapping from a string similarly to drake_mapping_readfile(), and filter tasks according to filter function

Parameters:
mappingMapping that will point to the data read
strMapping string obtained from the ILP solver
filterPointer to a user function that returns 0 if the task should be kept, non zero otherwise.

Definition at line 311 of file mapping.c.

mapping_t* drake_mapping_loadstr ( mapping_t ,
char *   
)

Reads a mapping from a string in the same format than produced by ilp solver.

Definition at line 305 of file mapping.c.

int drake_mapping_remove_processor ( mapping_t ,
int   
)

Not implemented. Removes a processor from the mapping.

Definition at line 193 of file mapping.c.

Removes a task from this mapping.

Definition at line 117 of file mapping.c.

Returns 0 if any mapping inconsistency was detected

Definition at line 201 of file mapping.c.