25 #include "pips_config.h"
40 #include "resources.h"
73 int number_of_deployment_units,
80 const char* function_name;
94 if (number_of_deployment_units > 1) {
110 pips_debug(7,
"Declarations for START_RU module: \n");
114 HASH_MAP (externalized_function, l_params, {
143 if (number_of_deployment_units > 1) {
185 test_instruction,
NIL,NULL,
205 sequence_instruction,
NIL,NULL,
212 return start_ru_module;
220 _UNUSED_ int number_of_deployment_units,
237 if (number_of_deployment_units > 1) {
254 pips_debug(7,
"Declarations for WAIT_RU module: \n");
265 return wait_ru_module;
277 int number_of_deployment_units,
283 pips_debug(2,
"BEGIN make_communication_statement\n");
292 if (number_of_deployment_units > 1) {
334 int number_of_deployment_units,
362 if (number_of_deployment_units > 1) {
394 list function_proc_l_stats =
NIL;
410 number_of_deployment_units,
420 new_test2 =
make_test (test_condition2, communication_stat,
429 test_instruction2,
NIL,NULL,
432 function_proc_l_stats =
CONS (
STATEMENT, test_statement2, function_proc_l_stats);
438 function_proc_l_stats =
gen_nreverse(function_proc_l_stats);
443 sequence_instruction2
451 sequence_instruction2,
NIL,NULL,
468 test_instruction,
NIL,NULL,
472 }, ht_communications);
487 sequence_instruction,
NIL,NULL,
562 int number_of_deployment_units,
569 HASH_MAP (var, ht_regions_for_functions, {
577 ht_regions_for_functions,
579 number_of_deployment_units,
584 },ht_communications);
594 int number_of_deployment_units,
599 number_of_deployment_units,
610 int number_of_deployment_units,
615 number_of_deployment_units,
628 list* l_reg_variables)
634 ps_base = ps_reg->
base;
637 *l_reg_variables =
NIL;
639 pips_debug(3,
"BEGIN compute_region_variables: \n");
641 pips_assert(
"compute_region_variables", ! SC_UNDEFINED_P(ps_reg));
655 *l_reg_variables =
CONS(
ENTITY, e, *l_reg_variables);
659 *l_reg_params =
CONS(
ENTITY, e, *l_reg_params);
664 pips_debug(3,
"END compute_region_variables: \n");
677 int number_of_deployment_units,
680 list l_reg_variables)
687 list local_entity_inds;
695 pips_debug(2,
"BEGIN make_array_communication_statement\n");
707 if (number_of_deployment_units > 1) {
717 assignement_statement =
724 assignement_statement =
741 assignement_statement,
766 pips_debug(2,
"END make_array_communication_statement\n");
769 return returned_statement;
776 const char* new_module_name,
824 entity externalized_fonction_common,
825 int number_of_deployment_units,
836 list l_reg_variables;
850 if (number_of_deployment_units > 1) {
897 number_of_deployment_units,
917 entity externalized_fonction_common,
918 int number_of_deployment_units,
929 externalized_fonction_common,
930 number_of_deployment_units,
946 entity externalized_fonction_common,
947 int number_of_deployment_units)
952 externalized_fonction_common,
953 number_of_deployment_units,
964 entity externalized_fonction_common,
965 int number_of_deployment_units)
970 externalized_fonction_common,
971 number_of_deployment_units,
call make_call(entity a1, list a2)
storage make_storage(enum storage_utype tag, void *val)
language make_language_unknown(void)
ram make_ram(entity a1, entity a2, intptr_t a3, list a4)
test make_test(expression a1, statement a2, statement a3)
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
instruction make_instruction(enum instruction_utype tag, void *val)
synchronization make_synchronization_none(void)
sequence make_sequence(list a)
struct _newgen_struct_entity_ * entity
void new_param(string s)
===========================================================================
static reference ref
Current stmt (an integer)
static statement module_statement
bdt base
Current expression.
struct _newgen_struct_statement_ * statement
statement systeme_to_loop_nest(Psysteme, list, statement, entity)
sc is used to generate the loop nest bounds for variables vars.
static entity new_variable
entity to be replaced, the primary?
#define region_entity(reg)
#define region_system(reg)
#define region
simulation of the type region
#define region_scalar_p(reg)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
const char * module_name(const char *s)
Return the module part of an entity name.
void reset_current_module_entity(void)
Reset the current module entity.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
void replace_entity(void *s, entity old, entity new)
per variable version of replace_entities.
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
void gen_list_patch(list l, const void *x, const void *y)
Replace all the reference to x in list l by a reference to y:
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
statement make_return_statement(entity)
statement make_continue_statement(entity)
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define DYNAMIC_AREA_LOCAL_NAME
#define MODULE_SEP_STRING
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_MAP(k, v, code, ht)
void * gen_find_tabulated(const char *, int)
entity entity_in_module(const char *, entity)
Return entity named name in specified module.
entity create_parameter_for_new_module(variable, const char *, const char *, entity, int)
phrase_distributor_control_code.c
string get_send_parameter_module_name(variable)
string get_common_param_name(entity variable, entity)
string get_out_param_id_name(entity variable, entity)
string get_receive_parameter_module_name(variable)
entity create_integer_parameter_for_new_module(const char *, const char *, entity, int)
Create new integer variable parameter for a newly created module.
void store_new_module(const char *, entity, statement)
Store (PIPDBM) newly created module module with module_statement as USER_FILE by saving pretty printi...
void declare_common_variables_in_module(entity, entity)
Creates all the things that need to be created in order to declare common in module (all the variable...
string get_function_id_name(entity)
statement make_binary_call_statement(const char *, expression, expression, statement)
Build and return new statement which is a binary call with the 2 expressions expression1 and expressi...
string get_in_param_id_name(entity variable, entity)
#define REF_VAR_PARAM_NAME
#define START_RU_PARAM1_NAME
#define COM_MODULE_PARAM4_NAME
#define COM_MODULE_PARAM2_NAME
#define WAIT_RU_MODULE_NAME
Stuff for WAIT_RU(...) subroutine generation.
#define RECEIVE_ARRAY_PARAM_MODULE_NAME
#define START_RU_PARAM2_NAME
#define COM_MODULE_PARAM1_NAME
#define DYN_VAR_PARAM_NAME
#define WAIT_RU_PARAM1_NAME
#define COM_MODULE_PARAM3_NAME
#define SEND_ARRAY_PARAM_MODULE_NAME
#define WAIT_RU_PARAM2_NAME
#define START_RU_MODULE_NAME
Stuff for START_RU(...) subroutine generation.
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.
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.
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......
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...
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.
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.
string get_dynamic_variable_name(entity dynamic_variable)
Return DYN_VAR_PARAM_NAME name for a dynamic variable.
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 fun...
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.
string get_receive_param_module_name(entity function, region reg)
Return RECEIVE_PARAM module name for function and region.
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 mo...
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....
string get_send_param_module_name(entity function, region reg)
Return SEND_PARAM module name for function and region.
string get_ref_var_param_name(entity reference_param)
Return REF_VAR_PARAM_NAME name for a dynamic variable.
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.
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.
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.
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.
void print_statement(statement)
Print a statement on stderr.
#define EQUAL_OPERATOR_NAME
#define make_entity(n, t, s, i)
#define STATEMENT_NUMBER_UNDEFINED
default values
#define DIVIDE_OPERATOR_NAME
#define empty_comments
Empty comments (i.e.
#define ASSIGN_OPERATOR_NAME
bool dynamic_area_p(entity aire)
void fprint_environment(FILE *fd, entity m)
entity FindEntity(const char *package, const char *name)
Retrieve an entity from its package/module name and its local name.
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
string entity_global_name(entity e)
Used instead of the macro to pass as formal argument.
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
entity make_empty_subroutine(const char *name, language l)
entity entity_empty_label(void)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
expression make_entity_expression(entity e, cons *inds)
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
extensions empty_extensions(void)
extension.c
basic MakeBasic(int)
END_EOLE.
void AddEntityToDeclarations(entity, entity)
END_EOLE.
int add_variable_to_area(entity, entity)
type MakeTypeVariable(basic, cons *)
BEGIN_EOLE.
#define reference_variable(x)
#define dimension_lower(x)
#define entity_storage(x)
#define EXPRESSION(x)
EXPRESSION.
@ is_instruction_sequence
#define reference_indices(x)
#define test_condition(x)
#define variable_dimensions(x)
#define entity_domain
newgen_syntax_domain_defined
#define variable_basic(x)
#define STATEMENT(x)
STATEMENT.
#define storage_undefined
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.