PIPS
|
#include <stdio.h>
#include <ctype.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "resources.h"
#include "misc.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "pipsdbm.h"
#include "text-util.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "polyedre.h"
#include "phrase_tools.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
#include "sc.h"
#include "conversion.h"
#include "phrase_distribution.h"
#include "phrase.h"
Go to the source code of this file.
Functions | |
entity | make_start_ru_module (hash_table ht_params, statement *module_statement, int number_of_deployment_units, entity global_common, list l_commons) |
General computation for PHRASE distribution COMMUNICATION STUFFs. More... | |
entity | make_wait_ru_module (statement *module_statement, _UNUSED_ int number_of_deployment_units, entity global_common, list l_commons) |
Build and store new module WAIT_RU. More... | |
static statement | make_communication_statement (entity function, entity module, region reg, entity unit_id, entity param, int number_of_deployment_units, bool is_receiving) |
Make communication statement (SEND or RECEIVE data), for a given fonction and region. More... | |
static entity | make_scalar_communication_module (variable var, const char *module_name, hash_table ht_communications, statement *module_statement, int number_of_deployment_units, entity global_common, list l_commons, bool is_receiving) |
Build and store new module used for communication (SEND or RECEIVE scalar params) Create statement module_statement. More... | |
string | get_dynamic_variable_name (entity dynamic_variable) |
Return DYN_VAR_PARAM_NAME name for a dynamic variable. More... | |
string | get_ref_var_param_name (entity reference_param) |
Return REF_VAR_PARAM_NAME name for a dynamic variable. More... | |
string | get_send_param_module_name (entity function, region reg) |
Return SEND_PARAM module name for function and region. More... | |
string | get_receive_param_module_name (entity function, region reg) |
Return RECEIVE_PARAM module name for function and region. More... | |
static list | make_scalar_communication_modules (hash_table ht_communications, int number_of_deployment_units, entity global_common, list l_commons, bool is_receiving) |
Internally used for building communication modules. More... | |
list | make_send_scalar_params_modules (hash_table ht_in_communications, int number_of_deployment_units, entity global_common, list l_commons) |
Build and return list of modules used for INPUT communications (SEND_PARAMETERS...) More... | |
list | make_receive_scalar_params_modules (hash_table ht_out_communications, int number_of_deployment_units, entity global_common, list l_commons) |
Build and return list of modules used for OUTPUT communications (RECEIVE_PARAMETERS...) More... | |
void | compute_region_variables (region reg, list *l_reg_params, list *l_reg_variables) |
Build and return parameters (PHI1,PHI2) and dynamic variables for region reg. More... | |
static statement | make_array_communication_statement (entity function, entity module, region reg, entity unit_id, entity param, int number_of_deployment_units, bool is_receiving, list l_reg_params, list l_reg_variables) |
Build statement doing data transfer between internal storage for externalized function and parameters from the caller. More... | |
entity | create_private_integer_variable_for_new_module (string new_name, const char *new_module_name, entity module) |
Creates an integer variable in specified module. More... | |
static entity | make_array_communication_module (entity function, region reg, entity global_common, entity externalized_fonction_common, int number_of_deployment_units, bool is_receiving) |
Internally used for making communication module for non-scalar region and function. More... | |
static list | make_array_communication_modules (entity function, list l_regions, entity global_common, entity externalized_fonction_common, int number_of_deployment_units, bool is_receiving) |
Internally used for making all communication modules for non-scalar IN or OUT regions for a given function. More... | |
list | make_send_array_params_modules (entity function, list l_regions, entity global_common, entity externalized_fonction_common, int number_of_deployment_units) |
Make all SEND_PARAM communication modules for non-scalar regions for a given function. More... | |
list | make_receive_array_params_modules (entity function, list l_regions, entity global_common, entity externalized_fonction_common, int number_of_deployment_units) |
Make all RECEIVE_PARAM communication modules for non-scalar regions for a given function. More... | |
Build and return parameters (PHI1,PHI2) and dynamic variables for region reg.
NOT IMPLEMENTED: suppress unused dynamic variables !!!!
An entity in a system that has an undefined storage is necesseraly a PHI entity, not dynamic !!
Definition at line 626 of file phrase_distributor_communication.c.
References Ssysteme::base, CONS, dynamic_area_p(), ENTITY, entity_global_name(), entity_storage, if(), is_storage_ram, NIL, pips_assert, pips_debug, ram_section, region_system, storage_ram, storage_tag, storage_undefined, Svecteur::succ, Svecteur::var, and VECTEUR_NUL_P.
Referenced by make_array_communication_module().
entity create_private_integer_variable_for_new_module | ( | string | new_name, |
const char * | new_module_name, | ||
entity | module | ||
) |
Creates an integer variable in specified module.
This entity does not exist, we can safely create it
Add to declarations....
new_name | ew_name |
new_module_name | ew_module_name |
module | odule |
Definition at line 775 of file phrase_distributor_communication.c.
References add_variable_to_area(), AddEntityToDeclarations(), base, basic_tag, concatenate(), DYNAMIC_AREA_LOCAL_NAME, entity_domain, entity_global_name(), entity_storage, entity_type, entity_undefined, FindEntity(), gen_find_tabulated(), is_basic_int, is_basic_overloaded, is_storage_ram, make_entity, make_ram(), make_storage(), MakeBasic(), MakeTypeVariable(), module, MODULE_SEP_STRING, new_variable, NIL, pips_debug, pips_internal_error, storage_undefined, strdup(), type_variable, value_undefined, and variable_basic.
Referenced by make_array_communication_module().
Return DYN_VAR_PARAM_NAME name for a dynamic variable.
dynamic_variable | ynamic_variable |
Definition at line 501 of file phrase_distributor_communication.c.
References asprintf, buffer, DYN_VAR_PARAM_NAME, and entity_local_name().
Referenced by make_array_communication_module(), and make_array_communication_statement().
Return RECEIVE_PARAM module name for function and region.
Definition at line 543 of file phrase_distributor_communication.c.
References asprintf, buffer, entity_local_name(), entity_type, get_receive_parameter_module_name(), RECEIVE_ARRAY_PARAM_MODULE_NAME, region_entity, region_scalar_p, and type_variable.
Referenced by make_array_communication_module().
Return REF_VAR_PARAM_NAME name for a dynamic variable.
reference_param | eference_param |
Definition at line 513 of file phrase_distributor_communication.c.
References asprintf, buffer, entity_local_name(), and REF_VAR_PARAM_NAME.
Referenced by make_array_communication_module(), and make_array_communication_statement().
Return SEND_PARAM module name for function and region.
Definition at line 525 of file phrase_distributor_communication.c.
References asprintf, buffer, entity_local_name(), entity_type, get_send_parameter_module_name(), region_entity, region_scalar_p, SEND_ARRAY_PARAM_MODULE_NAME, and type_variable.
Referenced by make_array_communication_module().
|
static |
Internally used for making communication module for non-scalar region and function.
list of entities: phi1, phi2,...
list of dynamic variables....
Declare CONTROL_DATA common to be visible here
Declare common for externalized function to be visible here
Definition at line 821 of file phrase_distributor_communication.c.
References COM_MODULE_PARAM2_NAME, COM_MODULE_PARAM4_NAME, compute_region_variables(), create_integer_parameter_for_new_module(), create_parameter_for_new_module(), create_private_integer_variable_for_new_module(), declare_common_variables_in_module(), ENTITY, entity_local_name(), entity_type, fprint_environment(), get_current_module_entity(), get_dynamic_variable_name(), get_receive_param_module_name(), get_ref_var_param_name(), get_send_param_module_name(), ifdebug, make_array_communication_statement(), make_empty_subroutine(), make_language_unknown(), MAP, module_name(), module_statement, pips_debug, print_region, region_entity, reset_current_module_entity(), set_current_module_entity(), store_new_module(), and type_variable.
Referenced by make_array_communication_modules().
|
static |
Internally used for making all communication modules for non-scalar IN or OUT regions for a given function.
Definition at line 914 of file phrase_distributor_communication.c.
References CONS, ENTITY, make_array_communication_module(), MAP, NIL, REGION, and region_scalar_p.
Referenced by make_receive_array_params_modules(), and make_send_array_params_modules().
|
static |
Build statement doing data transfer between internal storage for externalized function and parameters from the caller.
This job is done using reg region and systeme_to_loop_nest(...) function
!!! WARNING !!! This divide function has to be redefined here to have a positive remainder ! Use an other custom integer division operation !
Definition at line 672 of file phrase_distributor_communication.c.
References ASSIGN_OPERATOR_NAME, CONS, divide, DIVIDE_OPERATOR_NAME, effect_any_reference, ENTITY, entity_global_name(), entity_in_module(), entity_intrinsic(), entity_local_name(), entity_to_expression(), EXPRESSION, gen_copy_seq(), gen_nconc(), get_common_param_name(), get_dynamic_variable_name(), get_ref_var_param_name(), ifdebug, make_binary_call_statement(), make_entity_expression(), MAP, module, NIL, pips_debug, print_region, print_statement(), ref, reference_indices, region_entity, region_system, replace_entity(), and systeme_to_loop_nest().
Referenced by make_array_communication_module().
|
static |
Make communication statement (SEND or RECEIVE data), for a given fonction and region.
Definition at line 272 of file phrase_distributor_communication.c.
References ASSIGN_OPERATOR_NAME, CONS, entity_empty_label(), entity_in_module(), entity_local_name(), entity_to_expression(), EXPRESSION, get_common_param_name(), ifdebug, make_binary_call_statement(), make_continue_statement(), make_entity_expression(), module, NIL, pips_debug, print_region, region_entity, and region_scalar_p.
Referenced by make_scalar_communication_module().
list make_receive_array_params_modules | ( | entity | function, |
list | l_regions, | ||
entity | global_common, | ||
entity | externalized_fonction_common, | ||
int | number_of_deployment_units | ||
) |
Make all RECEIVE_PARAM communication modules for non-scalar regions for a given function.
function | unction |
l_regions | _regions |
global_common | lobal_common |
externalized_fonction_common | xternalized_fonction_common |
number_of_deployment_units | umber_of_deployment_units |
Definition at line 961 of file phrase_distributor_communication.c.
References make_array_communication_modules().
Referenced by controlize_distribution().
list make_receive_scalar_params_modules | ( | hash_table | ht_out_communications, |
int | number_of_deployment_units, | ||
entity | global_common, | ||
list | l_commons | ||
) |
Build and return list of modules used for OUTPUT communications (RECEIVE_PARAMETERS...)
ht_out_communications | t_out_communications |
number_of_deployment_units | umber_of_deployment_units |
global_common | lobal_common |
l_commons | _commons |
Definition at line 609 of file phrase_distributor_communication.c.
References l_commons, and make_scalar_communication_modules().
Referenced by controlize_distribution().
|
static |
Build and store new module used for communication (SEND or RECEIVE scalar params) Create statement module_statement.
Declare CONTROL_DATA common to be visible here
Declare commons for all externalized functions to be visible here
f (scalar_region_p(reg)) { }
Definition at line 330 of file phrase_distributor_communication.c.
References COM_MODULE_PARAM1_NAME, COM_MODULE_PARAM2_NAME, COM_MODULE_PARAM3_NAME, COM_MODULE_PARAM4_NAME, CONS, create_integer_parameter_for_new_module(), create_parameter_for_new_module(), declare_common_variables_in_module(), empty_comments, empty_extensions(), ENTITY, entity_empty_label(), entity_global_name(), entity_in_module(), entity_intrinsic(), entity_to_expression(), entity_undefined, EQUAL_OPERATOR_NAME, fprint_environment(), gen_nreverse(), get_current_module_entity(), get_function_id_name(), get_in_param_id_name(), get_out_param_id_name(), HASH_MAP, ifdebug, is_instruction_sequence, is_instruction_test, l_commons, make_communication_statement(), make_continue_statement(), make_empty_subroutine(), make_instruction(), make_language_unknown(), make_return_statement(), make_sequence(), make_statement(), make_synchronization_none(), make_test(), MakeBinaryCall(), MAP, module_name(), module_statement, NIL, pips_debug, REGION, region_entity, reset_current_module_entity(), set_current_module_entity(), STATEMENT, STATEMENT_NUMBER_UNDEFINED, STATEMENT_ORDERING_UNDEFINED, store_new_module(), and test_condition.
Referenced by make_scalar_communication_modules().
|
static |
Internally used for building communication modules.
Definition at line 561 of file phrase_distributor_communication.c.
References CONS, ENTITY, get_receive_parameter_module_name(), get_send_parameter_module_name(), HASH_MAP, l_commons, make_scalar_communication_module(), module_name(), module_statement, NIL, and pips_debug.
Referenced by make_receive_scalar_params_modules(), and make_send_scalar_params_modules().
list make_send_array_params_modules | ( | entity | function, |
list | l_regions, | ||
entity | global_common, | ||
entity | externalized_fonction_common, | ||
int | number_of_deployment_units | ||
) |
Make all SEND_PARAM communication modules for non-scalar regions for a given function.
function | unction |
l_regions | _regions |
global_common | lobal_common |
externalized_fonction_common | xternalized_fonction_common |
number_of_deployment_units | umber_of_deployment_units |
Definition at line 943 of file phrase_distributor_communication.c.
References make_array_communication_modules().
Referenced by controlize_distribution().
list make_send_scalar_params_modules | ( | hash_table | ht_in_communications, |
int | number_of_deployment_units, | ||
entity | global_common, | ||
list | l_commons | ||
) |
Build and return list of modules used for INPUT communications (SEND_PARAMETERS...)
ht_in_communications | t_in_communications |
number_of_deployment_units | umber_of_deployment_units |
global_common | lobal_common |
l_commons | _commons |
Definition at line 593 of file phrase_distributor_communication.c.
References l_commons, and make_scalar_communication_modules().
Referenced by controlize_distribution().
entity make_start_ru_module | ( | hash_table | ht_params, |
statement * | module_statement, | ||
int | number_of_deployment_units, | ||
entity | global_common, | ||
list | l_commons | ||
) |
General computation for PHRASE distribution COMMUNICATION STUFFs.
Build and store new module START_RU.
phrase_distributor_communication.c
Build and store new module START_RU. Create statement module_statement
Declare CONTROL_DATA common to be visible here
Declare commons for all externalized functions to be visible here
Compute the parameters of call function
Processing PARAMS regions
Make the CALL statement
ht_params | t_params |
module_statement | odule_statement |
number_of_deployment_units | umber_of_deployment_units |
global_common | lobal_common |
l_commons | _commons |
Definition at line 71 of file phrase_distributor_communication.c.
References CONS, create_integer_parameter_for_new_module(), db_get_memory_resource(), declare_common_variables_in_module(), DIMENSION, dimension_lower, effect_any_reference, empty_comments, empty_extensions(), ENTITY, entity_empty_label(), entity_global_name(), entity_in_module(), entity_intrinsic(), entity_local_name(), entity_to_expression(), entity_type, entity_undefined, EQUAL_OPERATOR_NAME, EXPRESSION, fprint_environment(), gen_list_patch(), gen_nreverse(), get_common_param_name(), get_current_module_entity(), get_function_id_name(), HASH_MAP, ifdebug, indices, is_instruction_call, is_instruction_sequence, is_instruction_test, l_commons, local_name_to_top_level_entity(), make_call(), make_continue_statement(), make_empty_subroutine(), make_entity_expression(), make_instruction(), make_language_unknown(), make_return_statement(), make_sequence(), make_statement(), make_synchronization_none(), make_test(), MakeBinaryCall(), MAP, module_statement, new_param(), NIL, pips_debug, ref, reference_variable, REGION, reset_current_module_entity(), set_current_module_entity(), START_RU_MODULE_NAME, START_RU_PARAM1_NAME, START_RU_PARAM2_NAME, STATEMENT, STATEMENT_NUMBER_UNDEFINED, STATEMENT_ORDERING_UNDEFINED, store_new_module(), strdup(), test_condition, type_variable, and variable_dimensions.
Referenced by controlize_distribution().
entity make_wait_ru_module | ( | statement * | module_statement, |
_UNUSED_ int | number_of_deployment_units, | ||
entity | global_common, | ||
list | l_commons | ||
) |
Build and store new module WAIT_RU.
Create statement module_statement
Declare CONTROL_DATA common to be visible here
Declare commons for all externalized functions to be visible here
Definition at line 219 of file phrase_distributor_communication.c.
References create_integer_parameter_for_new_module(), declare_common_variables_in_module(), ENTITY, entity_global_name(), fprint_environment(), get_current_module_entity(), ifdebug, l_commons, make_empty_subroutine(), make_language_unknown(), make_return_statement(), MAP, module_statement, pips_debug, reset_current_module_entity(), set_current_module_entity(), store_new_module(), strdup(), WAIT_RU_MODULE_NAME, WAIT_RU_PARAM1_NAME, and WAIT_RU_PARAM2_NAME.