PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include "genC.h"
#include "linear.h"
#include "resources.h"
#include "database.h"
#include "ri.h"
#include "ri-util.h"
#include "pipsdbm.h"
#include "misc.h"
#include "properties.h"
#include "task_private.h"
#include "task_parallelization.h"
#include "prettyprint.h"
Go to the source code of this file.
Data Structures | |
struct | ctx_pragma |
ctx_pragma_t: on_cluster on which cluster the pragma may be run (=-1 if run on all cluster) synchro if the communication between cluster are synchro (true) or asynchro(false) if on_cluster=-1 we don't care about the value of synchro d_... More... | |
struct | ctx_task |
ctx_task_t: pragma information from the pragma task_id id of the task private list of entity, private variables for the task More... | |
Macros | |
#define | PRAGMA_DISTRIBUTED "distributed" |
Typedefs | |
typedef struct ctx_pragma | ctx_pragma_t |
ctx_pragma_t: on_cluster on which cluster the pragma may be run (=-1 if run on all cluster) synchro if the communication between cluster are synchro (true) or asynchro(false) if on_cluster=-1 we don't care about the value of synchro d_... More... | |
typedef struct ctx_task | ctx_task_t |
ctx_task_t: pragma information from the pragma task_id id of the task private list of entity, private variables for the task More... | |
Functions | |
void | print_task (task t) |
Pass: TASK_MAPPING Debug mode: MPI_GENERATION_DEBUG_LEVEL Resource generated: More... | |
string | task_to_string (task t, bool pretty_print) |
static void | print_ctx_pragma (const ctx_pragma_t ctx) |
static ctx_pragma_t | init_ctx_pragma () |
init a ctx_pragma_t by default ctx.on_cluster = -1 run on all cluster ctx.synchro = true com synchro More... | |
static string | pragma_parameter_unknown_message (string s) |
** More... | |
static bool | pragma_PRAGMA_DISTRIBUTED_p (pragma p) |
Test if the pragma is a PRAGMA_DISTRIBUTED check the first element f the pragma. More... | |
static ctx_pragma_t | pragma_parse_PRAGMA_DISTRIBUTED (pragma p) |
parse the pragma to generate a ctx_pragma_t need to checked that the pragma sended is a PRAGMA_DISTRIBUTED before More... | |
static ctx_pragma_t | ctx_pragma_merge (ctx_pragma_t ctx1, ctx_pragma_t ctx2) |
Merge value of 2 ctx_pragma_t, the 2 ctx_pragma_t can't conflict on value. More... | |
static void | print_ctx_task (const ctx_task_t ctx) |
static void | compute_private_entity_list (statement st, ctx_task_t *ctx) |
compute what it must be add in the private entity list essentially internal declaration of the statement More... | |
static void | assign_statement_task_mapping (statement st, ctx_task_t *ctx) |
assign a task for the statement st More... | |
static bool | make_task_mapping (__attribute__((unused)) entity module, statement module_statement) |
compute the task mapping requires the module statement as param only parse pragma on fisrt level statement of the module then recurse on all sub-statement to assign the task More... | |
bool | task_mapping (const char *module_name) |
PIPS pass. More... | |
#define PRAGMA_DISTRIBUTED "distributed" |
Definition at line 105 of file task_mapping.c.
typedef struct ctx_pragma ctx_pragma_t |
ctx_pragma_t: on_cluster on which cluster the pragma may be run (=-1 if run on all cluster) synchro if the communication between cluster are synchro (true) or asynchro(false) if on_cluster=-1 we don't care about the value of synchro d_...
if it's a default value or value ask by user
typedef struct ctx_task ctx_task_t |
ctx_task_t: pragma information from the pragma task_id id of the task private list of entity, private variables for the task
|
static |
assign a task for the statement st
st | statement to be assigned |
ctx | context where information about the task are store |
Definition at line 348 of file task_mapping.c.
References gen_copy_seq(), ifdebug, load_parallel_task_mapping(), make_task(), NIL, ctx_pragma::on_cluster, pips_debug, ctx_task::pragma, print_statement(), print_task(), ctx_task::private, store_or_update_parallel_task_mapping(), ctx_pragma::synchro, and ctx_task::task_id.
Referenced by make_task_mapping().
|
static |
compute what it must be add in the private entity list essentially internal declaration of the statement
st | statement to check |
ctx | context where private list is store and update |
Definition at line 335 of file task_mapping.c.
References declaration_statement_p(), gen_copy_seq(), gen_nconc(), ctx_task::private, and statement_declarations.
Referenced by make_task_mapping().
|
static |
Merge value of 2 ctx_pragma_t, the 2 ctx_pragma_t can't conflict on value.
ctx1 | ctx_pragma_t to merge |
ctx2 | ctx_pragma_t to merge |
Definition at line 252 of file task_mapping.c.
References ctx_pragma::d_on_cluster, ctx_pragma::d_synchro, init_ctx_pragma(), ctx_pragma::on_cluster, pips_user_error, and ctx_pragma::synchro.
Referenced by make_task_mapping().
|
static |
init a ctx_pragma_t by default ctx.on_cluster = -1 run on all cluster ctx.synchro = true com synchro
Definition at line 134 of file task_mapping.c.
References ctx_pragma::d_on_cluster, ctx_pragma::d_synchro, ctx_pragma::on_cluster, and ctx_pragma::synchro.
Referenced by ctx_pragma_merge(), make_task_mapping(), and pragma_parse_PRAGMA_DISTRIBUTED().
|
static |
compute the task mapping requires the module statement as param only parse pragma on fisrt level statement of the module then recurse on all sub-statement to assign the task
module_statement | module statement to work on |
Definition at line 370 of file task_mapping.c.
References assign_statement_task_mapping(), compute_private_entity_list(), ctx_pragma_merge(), FOREACH, gen_context_recurse, gen_true2(), ifdebug, init_ctx_pragma(), module_statement, NIL, pips_debug, pips_internal_error, PRAGMA, ctx_task::pragma, pragma_parse_PRAGMA_DISTRIBUTED(), pragma_PRAGMA_DISTRIBUTED_p(), print_ctx_task(), print_statement(), ctx_task::private, sequence_statements, STATEMENT, statement_domain, statement_pragmas(), statement_sequence(), statement_sequence_p(), statement_with_pragma_p(), and ctx_task::task_id.
Referenced by task_mapping().
**
generate a error message about the for the parameter of the pragma to use
Definition at line 158 of file task_mapping.c.
References concatenate().
Referenced by pragma_parse_PRAGMA_DISTRIBUTED().
|
static |
parse the pragma to generate a ctx_pragma_t need to checked that the pragma sended is a PRAGMA_DISTRIBUTED before
p | pragma to be parsed |
Definition at line 201 of file task_mapping.c.
References CDR, ctx_pragma::d_on_cluster, ctx_pragma::d_synchro, FOREACH, gen_length(), gen_nth(), init_ctx_pragma(), ctx_pragma::on_cluster, pips_debug, pips_internal_error, pips_user_warning, PRAGMA_DISTRIBUTED, pragma_expression_p, pragma_parameter_unknown_message(), pragma_string, pragma_string_p, STRING, strsplit(), and ctx_pragma::synchro.
Referenced by make_task_mapping().
Test if the pragma is a PRAGMA_DISTRIBUTED check the first element f the pragma.
p | pragma to check |
Definition at line 171 of file task_mapping.c.
References call_function, CAR, entity_local_name(), EXPRESSION, expression_call(), expression_call_p(), gen_last(), pips_internal_error, PRAGMA_DISTRIBUTED, pragma_expression, pragma_expression_p, pragma_string, and pragma_string_p.
Referenced by make_task_mapping().
|
static |
Definition at line 122 of file task_mapping.c.
References fprintf(), ctx_pragma::on_cluster, and ctx_pragma::synchro.
Referenced by print_ctx_task().
|
static |
Definition at line 319 of file task_mapping.c.
References ENTITY, FOREACH, fprintf(), ctx_task::pragma, print_ctx_pragma(), print_entity_variable(), ctx_task::private, and ctx_task::task_id.
Referenced by make_task_mapping().
void print_task | ( | task | t | ) |
Pass: TASK_MAPPING Debug mode: MPI_GENERATION_DEBUG_LEVEL Resource generated:
Definition at line 73 of file task_mapping.c.
References fprintf(), task_domain, task_domain_number, task_to_string(), and task_undefined_p.
Referenced by assign_statement_task_mapping(), and print_ctx().
bool task_mapping | ( | const char * | module_name | ) |
PIPS pass.
module_name | odule_name |
Definition at line 430 of file task_mapping.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, get_current_module_entity(), get_current_module_statement(), get_parallel_task_mapping(), init_parallel_task_mapping(), make_task_mapping(), module, module_name(), module_name_to_entity(), module_statement, pips_assert, pips_debug, reset_current_module_entity(), reset_current_module_statement(), reset_parallel_task_mapping(), set_current_module_entity(), set_current_module_statement(), and statement_consistent_p().
pretty_print | retty_print |
Definition at line 84 of file task_mapping.c.
References _intFMT, concatenate(), ENTITY, entity_name, entity_user_name(), FOREACH, pips_debug, strdup(), task_id, task_on_cluster, task_private_data, and task_synchronization.
Referenced by prepare_context(), and print_task().