PIPS
hpfc.h File Reference
#include "hpf_private.h"
#include "hpf.h"
#include "message.h"
+ Include dependency graph for hpfc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HPFC_PACKAGE   "HPFC-PACKAGE"
 Warning! Do not modify this file that is automatically generated! More...
 

Functions

bool the_dynamics_undefined_p (void)
 end of it More...
 
void reset_the_dynamics (void)
 
void error_reset_the_dynamics (void)
 
void set_the_dynamics (list)
 
list get_the_dynamics (void)
 
void init_the_dynamics (void)
 
void close_the_dynamics (void)
 
void add_a_dynamic (entity)
 local primary dynamics More...
 
void hpfc_directives_error_handler (void)
 the local stack is used to retrieve the current statement while scanning the AST with gen_recurse. More...
 
void handle_hpf_directives (statement, bool)
 void handle_hpf_directives(s) statement s; More...
 
bool dynamic_hpf_undefined_p (void)
 dynamic.c More...
 
void reset_dynamic_hpf (void)
 
void error_reset_dynamic_hpf (void)
 
void set_dynamic_hpf (entity_entities)
 
entity_entities get_dynamic_hpf (void)
 
void init_dynamic_hpf (void)
 
void close_dynamic_hpf (void)
 
void store_dynamic_hpf (entity, entities)
 
void update_dynamic_hpf (entity, entities)
 
entities load_dynamic_hpf (entity)
 
entities delete_dynamic_hpf (entity)
 
bool bound_dynamic_hpf_p (entity)
 
void store_or_update_dynamic_hpf (entity, entities)
 
bool primary_entity_undefined_p (void)
 
void reset_primary_entity (void)
 
void error_reset_primary_entity (void)
 
void set_primary_entity (entitymap)
 
entitymap get_primary_entity (void)
 
void init_primary_entity (void)
 
void close_primary_entity (void)
 
void store_primary_entity (entity, entity)
 
void update_primary_entity (entity, entity)
 
entity load_primary_entity (entity)
 
entity delete_primary_entity (entity)
 
bool bound_primary_entity_p (entity)
 
void store_or_update_primary_entity (entity, entity)
 
bool renamings_undefined_p (void)
 
void reset_renamings (void)
 
void error_reset_renamings (void)
 
void set_renamings (statement_renamings)
 
statement_renamings get_renamings (void)
 
void init_renamings (void)
 
void close_renamings (void)
 
void store_renamings (statement, list)
 
void update_renamings (statement, list)
 
list load_renamings (statement)
 
list delete_renamings (statement)
 
bool bound_renamings_p (statement)
 
void store_or_update_renamings (statement, list)
 
bool maybeuseful_mappings_undefined_p (void)
 
void reset_maybeuseful_mappings (void)
 
void error_reset_maybeuseful_mappings (void)
 
void set_maybeuseful_mappings (statement_entities)
 
statement_entities get_maybeuseful_mappings (void)
 
void init_maybeuseful_mappings (void)
 
void close_maybeuseful_mappings (void)
 
void store_maybeuseful_mappings (statement, entities)
 
void update_maybeuseful_mappings (statement, entities)
 
entities load_maybeuseful_mappings (statement)
 
entities delete_maybeuseful_mappings (statement)
 
bool bound_maybeuseful_mappings_p (statement)
 
void store_or_update_maybeuseful_mappings (statement, entities)
 
bool similar_mapping_undefined_p (void)
 
void reset_similar_mapping (void)
 
void error_reset_similar_mapping (void)
 
void set_similar_mapping (entitymap)
 
entitymap get_similar_mapping (void)
 
void init_similar_mapping (void)
 
void close_similar_mapping (void)
 
void store_similar_mapping (entity, entity)
 
void update_similar_mapping (entity, entity)
 
entity load_similar_mapping (entity)
 
entity delete_similar_mapping (entity)
 
bool bound_similar_mapping_p (entity)
 
void store_or_update_similar_mapping (entity, entity)
 
entity safe_load_primary_entity (entity)
 HPFC module by Fabien COELHO. More...
 
bool same_primary_entity_p (entity, entity)
 
void init_dynamic_status (void)
 DYNAMIC STATUS management. More...
 
void reset_dynamic_status (void)
 
dynamic_status get_dynamic_status (void)
 
void set_dynamic_status (dynamic_status)
 
void close_dynamic_status (void)
 
void set_entity_as_dynamic (entity)
 a new dynamic entity is stored. More...
 
void set_similar_mappings_for_updates (void)
 
void hpfc_check_for_similarities (list)
 check all dynamic arrays for some similars... More...
 
bool conformant_templates_p (entity, entity)
 
entity array_synonym_aligned_as (entity, align)
 entity array_synonym_aligned_as(array, a) entity array; align a; More...
 
align new_align_with_template (align, entity)
 
entity template_synonym_distributed_as (entity, distribute)
 what: finds or creates a new entity distributed as needed. More...
 
bool array_distribution_similar_p (entity, entity)
 
bool hpfc_call_with_distributed_args_p (call)
 whether call c inplies a distributed argument More...
 
void hpfc_translate_call_with_distributed_args (statement, call)
 ??? only simple calls are handled. More...
 
void init_dynamic_locals (void)
 DYNAMIC LOCAL DATA. More...
 
void close_dynamic_locals (void)
 
void add_as_a_used_dynamic_to_statement (statement, entity)
 
void propagate_synonym (statement, entity, entity, bool)
 
void dump_current_remapping_graph (string)
 
void simplify_remapping_graph (void)
 void simplify_remapping_graph() More...
 
list alive_arrays (statement, entity)
 what: returns the list of alive arrays for statement s and template t. More...
 
statement generate_copy_loop_nest (entity, entity)
 statement generate_copy_loop_nest(src, trg) entity src, trg; More...
 
bool hpf_reductions_undefined_p (void)
 hpfc.c More...
 
void reset_hpf_reductions (void)
 
void error_reset_hpf_reductions (void)
 
void set_hpf_reductions (statement_entities)
 
statement_entities get_hpf_reductions (void)
 
void init_hpf_reductions (void)
 
void close_hpf_reductions (void)
 
void store_hpf_reductions (statement, entities)
 
void update_hpf_reductions (statement, entities)
 
entities load_hpf_reductions (statement)
 
entities delete_hpf_reductions (statement)
 
bool bound_hpf_reductions_p (statement)
 
void store_or_update_hpf_reductions (statement, entities)
 
void add_a_common (entity)
 HPFC module by Fabien COELHO. More...
 
void add_a_pure (entity)
 
bool hpf_pure_p (entity)
 ??? some intrinsics should also be considered as pure. More...
 
void add_an_io_function (entity)
 
bool hpfc_special_io (entity)
 
void add_a_fake_function (entity)
 
bool hpfc_special_fake (entity)
 
bool remapping_already_computed_p (renaming)
 list of already computed remappings... More...
 
void add_remapping_as_computed (renaming, list)
 variables to be declared More...
 
void add_remapping_as_used (renaming)
 
void hpfc_add_ahead_of_node_code (statement)
 
bool hpfc_init (const string)
 bool hpfc_init(string name) More...
 
bool hpfc_filter (const string)
 
bool hpfc_static_directives (const string)
 
bool hpfc_dynamic_directives (const string)
 
bool hpfc_compile (const string)
 bool hpfc_compile(string name) More...
 
bool hpfc_common (const string)
 bool hpfc_common(string name) More...
 
bool hpfc_close (const string)
 bool hpfc_close(string name) More...
 
bool hpfc_install (const string)
 bool hpfc_install(string name) More...
 
bool hpfc_make (const string)
 bool hpfc_make(string name) More...
 
bool hpfc_run (const string)
 bool hpfc_run(string name) More...
 
void print_align (align)
 debug-util.c More...
 
void print_alignment (alignment)
 
void print_aligns (void)
 
void print_distributes (void)
 
void print_distribute (distribute)
 
void print_distribution (distribution)
 
void print_hpf_dir (void)
 
void print_templates (void)
 
void print_processors (void)
 
void print_distributed_arrays (void)
 
void hpfc_print_common (FILE *, entity, entity)
 
void hpfc_print_file (string)
 
void fprint_range (FILE *, range)
 
void fprint_lrange (FILE *, list)
 
void fprint_message (FILE *, message)
 
void fprint_lmessage (FILE *, list)
 
bool ref_to_dist_array_p (void *)
 hpfc-util.c More...
 
bool written_effect_p (entity, list)
 written_effects_to_dist_arrays_p More...
 
bool written_effects_to_dist_arrays_p (expression)
 
bool replicated_p (entity)
 replicated_p More...
 
bool ith_dim_replicated_p (entity, int, list, distribution)
 
bool processors_dim_replicated_p (entity, entity, int)
 
bool ith_dim_distributed_p (entity, int, int *)
 whether a dimension is distributed or not. More...
 
bool ith_dim_overlapable_p (entity, int)
 
statement MakeStatementLike (statement, int)
 creates a new statement for the given module that looks like the stat one, i.e. More...
 
void kill_statement_number_and_ordering (statement)
 
list DistArraysEffects (expression)
 effects' action in an expression are here supposed to be read one's but that may not be correct? More...
 
list FindRefToDistArrayFromList (list)
 FindRefToDistArrayFromList. More...
 
list FindRefToDistArray (void *)
 
void AddEntityToHostAndNodeModules (entity)
 AddEntityToHostAndNodeModules. More...
 
void AddCommonToModule (entity, entity, void(*)(void), string)
 
void AddCommonToHostAndNodeModules (entity)
 
alignment FindAlignmentOfDim (list, int)
 
alignment FindAlignmentOfTemplateDim (list, int)
 
distribution FindDistributionOfDim (list, int, int *)
 
distribution FindDistributionOfProcessorDim (list, int, int *)
 
int template_dimension_of_array_dimension (entity, int)
 
int processor_dimension_of_template_dimension (entity, int)
 
int DistributionParameterOfArrayDim (entity, int, int *)
 
int processor_number (entity, int, int, int *)
 int processor_number(template, tdim, tcell, pprocdim) More...
 
int template_cell_local_mapping (entity, int, int)
 int template_cell_local_mapping(array, dim, tc) More...
 
int global_array_cell_to_local_array_cell (entity, int, int)
 int global_array_cell_to_local_array_cell(array, dim, acell) More...
 
int HpfcExpressionToInt (expression)
 HpfcExpressionToInt(e) More...
 
void get_alignment (entity, int, int *, int *, int *)
 
void get_distribution (entity, int, int *, int *)
 
void get_entity_dimensions (entity, int, int *, int *)
 
bool alignments_compatible_p (entity, int, entity, int)
 bool alignments_compatible_p(entity e1, int dim1, entity e2, int dim2) More...
 
bool references_aligned_p (reference, reference)
 
void hpfc_util_error_handler (void)
 removes IF (.TRUE.) THEN and DO X=n, n More...
 
void statement_structural_cleaning (statement)
 
int number_of_distributed_arrays (void)
 declarations.c More...
 
list list_of_distributed_arrays (void)
 
bool array_distributed_p (entity)
 
void set_array_as_distributed (entity)
 
bool declaration_delayed_p (entity)
 
list list_of_distributed_arrays_for_module (entity)
 returns the list of entities that are 'local' to module More...
 
int number_of_templates (void)
 
list list_of_templates (void)
 
bool entity_template_p (entity)
 
void set_template (entity)
 
int number_of_processors (void)
 
list list_of_processors (void)
 
bool entity_processor_p (entity)
 
void set_processor (entity)
 
void reset_hpf_object_lists (void)
 
void free_hpf_object_lists (void)
 
bool hpf_number_undefined_p (void)
 
void reset_hpf_number (void)
 
void error_reset_hpf_number (void)
 
void set_hpf_number (entity_int)
 
entity_int get_hpf_number (void)
 
void init_hpf_number (void)
 
void close_hpf_number (void)
 
void store_hpf_number (entity, intptr_t)
 
void update_hpf_number (entity, intptr_t)
 
intptr_t load_hpf_number (entity)
 
intptr_t delete_hpf_number (entity)
 
bool bound_hpf_number_p (entity)
 
void store_or_update_hpf_number (entity, intptr_t)
 
void init_hpf_number_status (void)
 STANDARS STATIC MANAGEMENT. More...
 
numbers_status get_hpf_number_status (void)
 
void reset_hpf_number_status (void)
 
void set_hpf_number_status (numbers_status)
 
void close_hpf_number_status (void)
 
void GiveToHpfObjectsTheirNumber (void)
 give to hpf objects listed in distributedarrays, templates and processors their number for the code generation... More...
 
expression entity_hpf_number (entity)
 returns the hpf_number parameter as a string not really needed ??? ??? never called More...
 
bool hpf_alignment_undefined_p (void)
 
void reset_hpf_alignment (void)
 
void error_reset_hpf_alignment (void)
 
void set_hpf_alignment (alignmap)
 
alignmap get_hpf_alignment (void)
 
void init_hpf_alignment (void)
 
void close_hpf_alignment (void)
 
void store_hpf_alignment (entity, align)
 
void update_hpf_alignment (entity, align)
 
align load_hpf_alignment (entity)
 
align delete_hpf_alignment (entity)
 
bool bound_hpf_alignment_p (entity)
 
void store_or_update_hpf_alignment (entity, align)
 
bool hpf_distribution_undefined_p (void)
 
void reset_hpf_distribution (void)
 
void error_reset_hpf_distribution (void)
 
void set_hpf_distribution (distributemap)
 
distributemap get_hpf_distribution (void)
 
void init_hpf_distribution (void)
 
void close_hpf_distribution (void)
 
void store_hpf_distribution (entity, distribute)
 
void update_hpf_distribution (entity, distribute)
 
distribute load_hpf_distribution (entity)
 
distribute delete_hpf_distribution (entity)
 
bool bound_hpf_distribution_p (entity)
 
void store_or_update_hpf_distribution (entity, distribute)
 
tag new_declaration_tag (entity, int)
 
void get_ith_dim_new_declaration (entity, int, int *, int *)
 
void init_data_status (void)
 
data_status get_data_status (void)
 
void reset_data_status (void)
 
void set_data_status (data_status)
 
void close_data_status (void)
 
void normalize_distribute (entity, distribute)
 
void normalize_align (entity, align)
 
void normalize_hpf_object (entity)
 
void NormalizeHpfDeclarations (void)
 
void NewDeclarationsOfDistributedArrays (void)
 this procedure generate the new declarations of every distributed arrays of the program, in order to minimize the amount of memory used. More...
 
bool overlap_status_undefined_p (void)
 
void reset_overlap_status (void)
 
void error_reset_overlap_status (void)
 
void set_overlap_status (overlapsmap)
 
overlapsmap get_overlap_status (void)
 
void init_overlap_status (void)
 
void close_overlap_status (void)
 
void store_overlap_status (entity, list)
 
void update_overlap_status (entity, list)
 
list load_overlap_status (entity)
 
list delete_overlap_status (entity)
 
bool bound_overlap_status_p (entity)
 
void store_or_update_overlap_status (entity, list)
 
void set_overlap (entity, int, int, int)
 set the overlap value for entity ent, on dimension dim, dans side side to width, which must be a positive integer. More...
 
int get_overlap (entity, int, int)
 returns the overlap for a given entity, dimension and side, to be used in the declaration modifications More...
 
void declaration_with_overlaps_for_module (entity)
 
void update_overlaps_in_caller (entity, list)
 the overlaps of the actual parameters are updated according to the formal requirements. More...
 
void update_control_lists (control, control_mapping)
 compiler-util.c More...
 
list updated_control_list (list, control_mapping)
 
void FindRefToDistArrayInStatement (statement, list *, list *)
 
list lIndicesOfRef (list)
 computes the list of indices of the list of ref that are variables... More...
 
list IndicesOfRef (syntax)
 
list AddOnceToIndicesList (list, list)
 
bool is_in_syntax_list (entity, list)
 
list FindDefinitionsOf (statement, list)
 
bool atomic_accesses_only_p (statement)
 
bool indirections_inside_statement_p (statement)
 
statement parallel_loop_nest_to_body (statement, list *, list *)
 
void set_current_loops (statement)
 
void reset_current_loops (void)
 
bool entity_loop_index_p (entity)
 
range loop_index_to_range (entity)
 
void hpf_compiler (statement, statement *, statement *)
 what: compile a statement into a host and SPMD node code. More...
 
void make_host_and_node_modules (entity)
 compile.c More...
 
void init_host_and_node_entities (void)
 both host and node modules are initialized with the same declarations than the compiled module, but the distributed arrays declarations... More...
 
FILE * hpfc_fopen (string)
 
void hpfc_fclose (FILE *, string)
 
void hpfc_print_code (FILE *, entity, statement)
 
void put_generated_resources_for_common (entity)
 
void compile_a_special_io_function (entity)
 just copied for the host More...
 
void compile_a_pure_function (entity)
 simply copied for both host and node... More...
 
void put_generated_resources_for_module (statement, statement, statement)
 
void put_generated_resources_for_program (string)
 
void hpfcompile (const char *)
 Compiler call, obsole. More...
 
entity hpfc_new_variable (entity, basic)
 
void hpfc_compile_error_handler (void)
 
void NormalizeCodeForHpfc (statement)
 
bool update_common_map_undefined_p (void)
 
void set_update_common_map (entity_mapping)
 
entity_mapping get_update_common_map (void)
 
void reset_update_common_map (void)
 
void free_update_common_map (void)
 
void make_update_common_map (void)
 
entity load_entity_update_common (entity)
 
void delete_entity_update_common (entity)
 
bool entity_update_common_undefined_p (entity)
 
void store_entity_update_common (entity, entity)
 
void update_entity_update_common (entity, entity)
 
void debug_print_referenced_entities (void *)
 
void update_common_references_in_obj (void *)
 
void update_common_references_in_regions (void)
 
void NormalizeCommonVariables (entity, statement)
 
entity MakeRunTimeSupportSubroutine (string, int)
 run-time.c More...
 
entity MakeRunTimeSupportFunction (string, int, tag)
 
expression pvm_what_option_expression (entity)
 
string pvm_what_options (basic)
 string pvm_what_options(b) More...
 
statement st_call_send_or_receive (entity, reference)
 Sends. More...
 
statement st_compute_current_computer (reference)
 Computes. More...
 
statement st_compute_current_owners (reference)
 
expression expr_compute_local_index (entity, int, expression)
 new index computation formula, derived from the new declarations made for the given dimension. More...
 
statement hpfc_make_call_statement (entity, list)
 statement hpfc_make_call_statement(e, l) generate a call statement to function e, with expression list l as an argument. More...
 
void add_pvm_init_and_end (statement *, statement *)
 this is for the main. More...
 
statement st_compute_neighbour (int)
 call to the runtime support function HPFC_CMPNEIGHBOUR(d) More...
 
statement st_generate_packing (entity, list, bool)
 statement st_generate_packing_and_passing(array, content, bsend) More...
 
entity hpfc_main_entity (entity)
 returns the entity to which e is attached, that is first a common, then a function... More...
 
const char * hpfc_main_entity_name (entity)
 returns the name of the entity e belongs too (common, function...) More...
 
string bound_parameter_name (entity, string, int)
 returns a name for the bound of the declaration of array array, side side and dimension dim. More...
 
entity argument_bound_entity (entity, entity, bool, int)
 
expression hpfc_array_bound (entity, bool, int)
 
list array_lower_upper_bounds_list (entity)
 of expressions More...
 
void hpfc_init_run_time_entities (void)
 to be seen from outside of this file More...
 
entity hpfc_name_to_entity (const char *)
 
bool hpfc_intrinsic_like_function (entity)
 
bool hpfc_io_like_function (entity)
 
void generate_c1_beta (statement, list *, list *)
 generate.c More...
 
void generate_c1_alpha (statement, list *, list *)
 generate_c1_alpha More...
 
void generate_update_values_on_nodes (reference, reference, list *, list *)
 generate_update_values_on_nodes More...
 
void generate_read_of_ref_for_computer (syntax, list *, list *)
 generate_read_of_ref_for_computer More...
 
void generate_read_of_ref_for_all (syntax, list *, list *)
 generate_read_of_ref_for_all More...
 
void generate_compute_local_indices (reference, list *, list *)
 generate_compute_local_indices More...
 
void generate_get_value_locally (reference, reference, list *)
 generate_get_value_locally More...
 
void generate_send_to_computer (reference, list *)
 generate_send_to_computer More...
 
void generate_receive_from_computer (reference, list *)
 
void generate_parallel_body (statement, list *, list, list)
 
void generate_update_values_on_computer_and_nodes (reference, reference, list *, list *)
 generate_update_values_on_computer_and_nodes More...
 
void generate_update_distributed_value_from_host (syntax, list *, list *)
 generate_update_distributed_value_from_host More...
 
void generate_update_private_value_from_host (syntax, list *, list *)
 generate_update_private_value_from_host More...
 
statement st_get_value_locally_and_send (reference, reference)
 
statement st_compute_ith_local_index (entity, int, expression, syntax *)
 the returned expression is translated into variables of the node module. More...
 
statement st_send_to_host_and_nodes (reference, reference)
 
statement st_send_to_computer_if_necessary (reference)
 
statement st_get_value_for_all (reference, reference)
 
statement st_get_value_for_computer (reference, reference)
 
statement st_receive_from (reference, reference)
 if ref is replicated: goal = Receive_From_Sender() More...
 
type type_variable_dup (type)
 local-ri-util.c More...
 
bool fortran_library_entity_p (entity)
 
void create_common_parameters_h (FILE *)
 inits.c More...
 
void create_parameters_h (FILE *, entity)
 create_parameters_h More...
 
int max_size_of_processors (void)
 
void create_init_common_param_for_arrays (FILE *, entity)
 
void create_init_common_param_for_templates (FILE *)
 
void create_init_common_param_for_processors (FILE *)
 
void create_init_common_param (FILE *)
 create_init_common_param (templates and modules) More...
 
bool block_distributed_p (entity)
 o-analysis.c More...
 
bool Overlap_Analysis (statement, statement *)
 check conditions and compile... More...
 
bool hpfc_current_statement_undefined_p (void)
 align-checker.c More...
 
void reset_hpfc_current_statement (void)
 
void error_reset_hpfc_current_statement (void)
 
void set_hpfc_current_statement (statement)
 
statement get_hpfc_current_statement (void)
 
bool local_integer_constant_expression (expression)
 true is the expression is locally constant, that is in the whole loop nest, the reference is not written. More...
 
bool align_check (reference, reference, list *, list *)
 computes the shift vector that links the two references, true if every thing is ok, i.e. More...
 
bool hpfc_integer_constant_expression_p (expression, int *)
 
statement messages_handling (list, list)
 messages.c More...
 
Pvecteur the_index_of_vect (Pvecteur)
 message-utils.c More...
 
list add_to_list_of_ranges_list (list, range)
 
list dup_list_of_ranges_list (list)
 ??? the complexity of this function could be greatly improved More...
 
list dup_list_of_Pvecteur (list)
 ??? the complexity of this function could be improved greatly... More...
 
list add_elem_to_list_of_Pvecteur (list, int, int)
 caution, is initial list is destroyed. More...
 
range complementary_range (entity, int, range)
 range complementary_range(array, dim, r) More...
 
list generate_message_from_3_lists (entity, list, list, list)
 list generate_message_from_3_lists(array, lcontent, lneighbour, ldomain) More...
 
bool empty_section_p (list)
 
bool empty_range_p (range)
 
char * sprint_lrange (string, list)
 
char * sprint_range (string, range)
 
list compute_receive_content (entity, list, Pvecteur)
 
list compute_receive_domain (list, Pvecteur)
 
bool larger_message_in_list (message, list)
 
bool message_larger_p (message, message)
 bool message_larger_p(m1, m2) More...
 
bool lrange_larger_p (list, list)
 
list array_ranges_to_template_ranges (entity, list)
 
list template_ranges_to_processors_ranges (entity, list)
 
list array_access_to_array_ranges (reference, list, list)
 
statement generate_guarded_statement (statement, entity, list)
 
bool make_guard_expression (entity, list, expression *)
 bool make_guard_expression(proc, lr, pguard) More...
 
expression make_mypos_expression (int, expression)
 
statement loop_nest_guard (statement, reference, list, list)
 
bool entity_hpfc_dummy_p (entity)
 build-system.c More...
 
entity get_ith_region_dummy (int)
 
entity get_ith_region_prime (int)
 
entity get_ith_array_dummy (int)
 
entity get_ith_array_prime (int)
 
entity get_ith_template_dummy (int)
 
entity get_ith_template_prime (int)
 
entity get_ith_processor_dummy (int)
 
entity get_ith_processor_prime (int)
 
entity get_ith_block_dummy (int)
 
entity get_ith_block_prime (int)
 
entity get_ith_cycle_dummy (int)
 
entity get_ith_cycle_prime (int)
 
entity get_ith_local_dummy (int)
 
entity get_ith_local_prime (int)
 
entity get_ith_shift_dummy (int)
 
entity get_ith_shift_prime (int)
 
entity get_ith_auxiliary_dummy (int)
 
entity get_ith_auxiliary_prime (int)
 
entity get_ith_temporary_dummy (int)
 
entity get_ith_temporary_prime (int)
 
void hpfc_init_dummy_to_prime (void)
 
void hpfc_close_dummy_to_prime (void)
 
Psysteme shift_system_to_prime_variables (Psysteme)
 
void make_hpfc_current_mappings (void)
 ??? used with a temporary hack to differentiate array and templates More...
 
void free_hpfc_current_mappings (void)
 
Psysteme compute_entity_to_declaration_constraints (entity, string, string)
 Psysteme compute_entity_to_constraints(ent, suffix, prefix) entity ent: variable the constraints of which are computed strings suffix and prefix: to be used in the dummy variables created. More...
 
Psysteme entity_to_declaration_constraints (entity, tag)
 gives back the constraints due to the declarations. More...
 
Psysteme hpfc_compute_unicity_constraints (entity)
 Psysteme hpfc_compute_unicity_constraints(e) entity e should be an array;. More...
 
Psysteme entity_to_hpf_align_constraints (entity)
 
Psysteme entity_to_hpf_distribute_constraints (entity)
 
effect entity_to_region (statement, entity, tag)
 effect entity_to_region(stat, ent, act) statement stat; entity ent; tag act; More...
 
Psysteme hpfc_compute_entity_to_new_declaration (entity)
 
Psysteme entity_to_new_declaration (entity)
 
Psysteme generate_system_for_equal_variables (int, entity(*)(int), entity(*)(int))
 
Psysteme hpfc_unstutter_dummies (entity)
 
Psysteme generate_system_for_distributed_variable (entity)
 Psysteme generate_system_for_variable(v) entity v;. More...
 
bool only_io_map_undefined_p (void)
 io-util.c More...
 
void set_only_io_map (statement_mapping)
 
statement_mapping get_only_io_map (void)
 
void reset_only_io_map (void)
 
void free_only_io_map (void)
 
void make_only_io_map (void)
 
bool load_statement_only_io (statement)
 
void delete_statement_only_io (statement)
 
bool statement_only_io_undefined_p (statement)
 
void store_statement_only_io (statement, bool)
 
void update_statement_only_io (statement, bool)
 
void hpfc_io_util_error_handler (void)
 ??? neglect expression side effects... More...
 
void only_io_mapping_initialize (statement)
 
void generate_io_statements_for_distributed_arrays (entity, tag, Psysteme, Psysteme, Psysteme, list, list, list, list, statement *, statement *)
 
void generate_io_statements_for_shared_arrays (entity, tag, Psysteme, Psysteme, list, list, list, statement *, statement *)
 
void hpfc_algorithm_row_echelon (Psysteme, list, Psysteme *, Psysteme *)
 io-compile.c More...
 
list make_list_of_dummy_variables (entity(*)(void), int)
 
void remove_variables_if_possible (Psysteme *, list *)
 
void remove_variables_from_system (Psysteme *, list *)
 
void clean_the_system (Psysteme *, list *, list *)
 
list simplify_deducable_variables (Psysteme, list, list *)
 list simplify_deducable_variables(syst, vars, pleftvars) Psysteme syst; list vars, *pleftvars; More...
 
list hpfc_order_variables (list, bool)
 list hpfc_order_variables(list) More...
 
void hpfc_algorithm_tiling (Psysteme, list, list, Psysteme *, Psysteme *, Psysteme *)
 
void hpfc_simplify_condition (Psysteme *, statement, tag)
 void hpfc_simplify_condition(psc, stat, move) More...
 
void io_efficient_compile (statement, statement *, statement *)
 compile an io statement More...
 
statement define_node_processor_id (entity, entity(*)(int))
 generate-util.c More...
 
statement generate_deducables (list)
 statement generate_deducables(list le) More...
 
list hpfc_gen_n_vars_expr (entity(*)(void), int)
 
expression make_reference_expression (entity, entity(*)(void))
 
statement hpfc_add_n (entity, int)
 returns statement VAR = VAR + N More...
 
statement hpfc_add_2 (expression)
 expr = expr + 2 More...
 
statement hpfc_message (expression, expression, bool)
 
statement hpfc_lazy_guard (bool, statement)
 returns if (LAZY_{SEND,RECV}) then More...
 
statement hpfc_generate_message (entity, bool, bool)
 
statement hpfc_initsend (bool)
 
expression hpfc_buffer_reference (entity, entity)
 returns a reference to the typed common hpfc_buffer buffer, that suits array basic type and with index as an index. More...
 
statement hpfc_buffer_packing (entity, entity(*)(void), bool)
 
statement hpfc_packing_of_current__buffer (entity, bool)
 CALL (pvmtype) HPFC {,UN}PACK. More...
 
statement hpfc_broadcast_if_necessary (entity, entity, entity, entity, bool)
 lazy or not... More...
 
statement hpfc_lazy_buffer_packing (entity, entity, entity, entity, entity(*)(void), bool, bool)
 
statement hpfc_buffer_initialization (bool, bool, bool)
 
statement hpfc_lazy_packing (entity, entity, entity(*)(void), bool, bool)
 
statement hpfc_compute_lid (entity, entity, entity(*)(void), entity)
 
Pcontrainte full_linearization (entity, entity, int *, entity(*)(int), bool, int)
 remapping.c More...
 
statement generate_all_liveness (entity, bool)
 
statement root_statement_remapping_inits (statement)
 returns the initialization statement: must initialize the status and liveness of arrays More...
 
void remapping_compile (statement, statement *, statement *)
 void remapping_compile(s, hsp, nsp) statement s, *hsp, *nsp; More...
 
bool new_host_undefined_p (void)
 host_node_entities.c More...
 
void reset_new_host (void)
 
void error_reset_new_host (void)
 
void set_new_host (entitymap)
 
entitymap get_new_host (void)
 
void init_new_host (void)
 
void close_new_host (void)
 
void store_new_host (entity, entity)
 
void update_new_host (entity, entity)
 
entity load_new_host (entity)
 
entity delete_new_host (entity)
 
bool bound_new_host_p (entity)
 
void store_or_update_new_host (entity, entity)
 
bool old_host_undefined_p (void)
 
void reset_old_host (void)
 
void error_reset_old_host (void)
 
void set_old_host (entitymap)
 
entitymap get_old_host (void)
 
void init_old_host (void)
 
void close_old_host (void)
 
void store_old_host (entity, entity)
 
void update_old_host (entity, entity)
 
entity load_old_host (entity)
 
entity delete_old_host (entity)
 
bool bound_old_host_p (entity)
 
void store_or_update_old_host (entity, entity)
 
bool new_node_undefined_p (void)
 
void reset_new_node (void)
 
void error_reset_new_node (void)
 
void set_new_node (entitymap)
 
entitymap get_new_node (void)
 
void init_new_node (void)
 
void close_new_node (void)
 
void store_new_node (entity, entity)
 
void update_new_node (entity, entity)
 
entity load_new_node (entity)
 
entity delete_new_node (entity)
 
bool bound_new_node_p (entity)
 
void store_or_update_new_node (entity, entity)
 
bool old_node_undefined_p (void)
 
void reset_old_node (void)
 
void error_reset_old_node (void)
 
void set_old_node (entitymap)
 
entitymap get_old_node (void)
 
void init_old_node (void)
 
void close_old_node (void)
 
void store_old_node (entity, entity)
 
void update_old_node (entity, entity)
 
entity load_old_node (entity)
 
entity delete_old_node (entity)
 
bool bound_old_node_p (entity)
 
void store_or_update_old_node (entity, entity)
 
void debug_host_node_variables (entity)
 HPFC module by Fabien COELHO. More...
 
void store_new_node_variable (entity, entity)
 
void store_new_host_variable (entity, entity)
 
void store_new_host_node_variable (entity, entity, entity)
 
void init_entity_status (void)
 
entity_status get_entity_status (void)
 
void set_entity_status (entity_status)
 
void reset_entity_status (void)
 
void close_entity_status (void)
 
string hpfc_module_suffix (entity)
 
void update_object_for_module (void *, entity)
 
void update_list_for_module (list, entity)
 
expression UpdateExpressionForModule (entity, expression)
 this function creates a new expression using the mapping of old to new variables map. More...
 
list lUpdateExpr_but_distributed (entity, list)
 used for compiling calls. More...
 
list lUpdateExpr (entity, list)
 
list lNewVariableForModule (entity, list)
 
entity NewVariableForModule (entity, entity)
 
statement UpdateStatementForModule (entity, statement)
 
bool hpfc_entity_reduction_p (entity)
 special_cases.c More...
 
bool call_reduction_p (call)
 
bool compile_reduction (statement, statement *, statement *)
 bool compile_reduction(initial, phost, pnode) More...
 
list handle_hpf_reduction (statement)
 of hpfc_reductions More...
 
list compile_hpf_reduction (list, bool, bool)
 of statement More...
 
void free_vector_list (list)
 
bool subarray_shift_p (statement, entity *, list *)
 
Psysteme get_read_effect_area (list, entity)
 
list make_rectangular_area (statement, entity)
 
statement generate_subarray_shift (statement, entity, list)
 statement generate_subarray_shift(s, var, lshift) statement s; entity var; list lshift; More...
 
void hpfc_special_cases_error_handler (void)
 
statement simple_statement (statement)
 
bool full_define_p (reference, list)
 
bool full_copy_p (statement, reference *, reference *)
 
statement generate_full_copy (reference, reference)
 statement generate_full_copy(reference left, reference right) More...
 
void extract_lattice (Psysteme, list, list *, list *)
 lattice_extraction.c More...
 

Variables

bool(* dynamic_entity_p )(entity)
 as expected, true if entity e is dynamic. More...
 
entity host_module
 compiler.c More...
 
entity node_module
 

Macro Definition Documentation

◆ HPFC_PACKAGE

#define HPFC_PACKAGE   "HPFC-PACKAGE"

Warning! Do not modify this file that is automatically generated!

Modify src/Libs/hpfc/hpfc-local.h instead, to add your own modifications. header file built by cproto hpfc-local.h local definitions

Definition at line 35 of file hpfc.h.

Function Documentation

◆ add_a_common()

void add_a_common ( entity  c)

HPFC module by Fabien COELHO.

Definition at line 48 of file hpfc.c.

49 { the_commons_object = gen_once(c, the_commons_object);}
list gen_once(const void *vo, list l)
Prepend an item to a list only if it is not already in the list.
Definition: list.c:722

References gen_once().

Referenced by init_host_and_node_entities().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_a_dynamic()

void add_a_dynamic ( entity  c)

local primary dynamics

Definition at line 99 of file directives.c.

100 {
101  the_dynamics_object = gen_once(c, the_dynamics_object);
102 }

References gen_once().

Referenced by hpfc_translate_call_with_distributed_args(), and new_dynamic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_a_fake_function()

void add_a_fake_function ( entity  f)

Definition at line 88 of file hpfc.c.

static list the_fakes_object
??? to be added to HPFC_STATUS
Definition: hpfc.c:86
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15

References f(), gen_once(), and the_fakes_object.

Referenced by handle_fake_directive(), and new_fake_function().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_a_pure()

void add_a_pure ( entity  f)

Definition at line 62 of file hpfc.c.

63 { the_pures_object = gen_once(f, the_pures_object);}

References f(), and gen_once().

Referenced by handle_pure_directive(), and new_pure_function().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_an_io_function()

void add_an_io_function ( entity  f)

Definition at line 74 of file hpfc.c.

75 { the_ios_object = gen_once(f, the_ios_object);}

References f(), and gen_once().

Referenced by handle_io_directive(), and new_io_function().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_as_a_used_dynamic_to_statement()

void add_as_a_used_dynamic_to_statement ( statement  s,
entity  e 
)

Definition at line 904 of file dynamic.c.

905 {
906  entities es = load_used_dynamics(s);
908 }
#define entities_list(x)
Definition: hpf_private.h:414
entity load_primary_entity(entity)

References entities_list, gen_once(), and load_primary_entity().

Referenced by initial_alignment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_elem_to_list_of_Pvecteur()

list add_elem_to_list_of_Pvecteur ( list  l,
int  var,
int  val 
)

caution, is initial list is destroyed.

else

Parameters
varar
valal

Definition at line 110 of file message-utils.c.

113 {
114  list result = NIL;
115 
116  if (ENDP(l))
117  return CONS(PVECTOR, (VECTOR) vect_new((Variable) (intptr_t)var,
118  int_to_value(val)), NIL);
119 
120  if ((var==0) || (val==0))
121  return l;
122 
123  /* else */
124 
125  MAPL(cv,
126  {
127  Pvecteur v = (Pvecteur) PVECTOR(CAR(cv));
128  pips_debug(9, "size of vector %p is %d\n", v, vect_size(v));
129  vect_add_elem(&v, (Variable) (intptr_t) var, int_to_value(val));
130  result = gen_nconc(result, CONS(PVECTOR, (VECTOR) v, NIL));
131  },
132  l);
133 
134  gen_free_list(l);
135 
136  return result;
137 }
#define int_to_value(i)
end LINEAR_VALUE_IS_INT
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
#define VECTOR
Definition: defines-local.h:73
#define PVECTOR(v)
Definition: defines-local.h:72
int vect_size(Pvecteur v)
package vecteur - reductions
Definition: reductions.c:47
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define intptr_t
Definition: stdint.in.h:294
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Definition: alloc.c:110
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Definition: unaires.c:72

References CAR, CONS, ENDP, gen_free_list(), gen_nconc(), int_to_value, intptr_t, MAPL, NIL, pips_debug, PVECTOR, vect_add_elem(), vect_new(), vect_size(), and VECTOR.

Referenced by atomize_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_pvm_init_and_end()

void add_pvm_init_and_end ( statement phs,
statement pns 
)

this is for the main.

also subs CALL RETURN -> CALL HPFC {HOST|NONE} END...

Parameters
phshs
pnsns

Definition at line 364 of file run-time.c.

365 {
366  entity
367  rete = entity_intrinsic("RETURN"),
371 
372  substitute_return(rete, hhe, *phs);
373  substitute_return(rete, hne, *pns);
374 
375 
379  }
380 
382  CONS(STATEMENT, (*phs),
383  CONS(STATEMENT, ret,
384  NIL))));
385 
387  CONS(STATEMENT, (*pns),
389  NIL))));
390 }
statement copy_statement(statement p)
STATEMENT.
Definition: ri.c:2186
#define ret(why, what)
true if not a remapping for old.
Definition: dynamic.c:986
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
#define HOST_END
#define st_init_host()
#define NODE_END
#define st_init_node()
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
#define statement_label(x)
Definition: ri.h:2450
#define entity_undefined
Definition: ri.h:2761
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
static entity sub_ret_label
Definition: run-time.c:330
static void substitute_return(entity o, entity n, statement s)
Definition: run-time.c:345
entity hpfc_name_to_entity(const char *name)
Definition: run-time.c:817
statement hpfc_make_call_statement(entity e, list l)
statement hpfc_make_call_statement(e, l) generate a call statement to function e, with expression lis...
Definition: run-time.c:318

References CONS, copy_statement(), entity_intrinsic(), entity_undefined, HOST_END, hpfc_make_call_statement(), hpfc_name_to_entity(), make_block_statement(), NIL, NODE_END, ret, st_init_host, st_init_node, STATEMENT, statement_label, sub_ret_label, and substitute_return().

Referenced by compile_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_remapping_as_computed()

void add_remapping_as_computed ( renaming  r,
list  vars 
)

variables to be declared

Parameters
varsars

Definition at line 121 of file hpfc.c.

124 {
125  computed_remaps_object = CONS(REMAPPING,
127  computed_remaps_object);
128 }
renaming copy_renaming(renaming p)
RENAMING.
Definition: hpf_private.c:845
remapping make_remapping(renaming a1, list a2)
Definition: hpf_private.c:839
list gen_copy_seq(list l)
Copy a list structure.
Definition: list.c:501
#define REMAPPING(x)
REMAPPING.
Definition: hpf_private.h:903

References CONS, copy_renaming(), gen_copy_seq(), make_remapping(), and REMAPPING.

Referenced by generate_hpf_remapping_file().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_remapping_as_used()

void add_remapping_as_used ( renaming  x)

Definition at line 135 of file hpfc.c.

136 {
137  entity src = renaming_old(x), trg = renaming_new(x);
139 
140  MAP(REMAPPING, r,
141  {
143 
144  if (renaming_old(y)==src && renaming_new(y)==trg)
145  {
146  p = r;
147  break;
148  }
149  },
150  get_computed_remaps());
151 
152  pips_assert("defined remapping", !remapping_undefined_p(p));
153 
154  MAP(ENTITY, e,
155  include_entities_object = gen_once(e, include_entities_object),
157 }
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226
#define remapping_undefined_p(x)
Definition: hpf_private.h:910
#define renaming_old(x)
Definition: hpf_private.h:969
#define remapping_undefined
Definition: hpf_private.h:909
#define remapping_referenced(x)
Definition: hpf_private.h:935
#define renaming_new(x)
Definition: hpf_private.h:971
#define remapping_renaming(x)
Definition: hpf_private.h:933
#define src(name, suf)
HPFC by Fabien Coelho, May 1993 and later...
Definition: compile.c:41
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
static char * x
Definition: split_file.c:159

References ENTITY, gen_once(), MAP, pips_assert, REMAPPING, remapping_referenced, remapping_renaming, remapping_undefined, remapping_undefined_p, renaming_new, renaming_old, src, and x.

Referenced by remapping_compile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_to_list_of_ranges_list()

list add_to_list_of_ranges_list ( list  l,
range  r 
)

first time

else

Definition at line 51 of file message-utils.c.

54 {
55  if (ENDP(l)) /* first time */
56  return CONS(LIST, CONS(RANGE, r, NIL), NIL);
57 
58  /* else */
59  MAPL(cc,
60  {
61  list lr = CONSP(CAR(cc));
62  assert(!ENDP(lr));
63  lr = gen_nconc(lr, CONS(RANGE, r, NIL));
64  },
65  l);
66 
67  return(l);
68 }
#define LIST(x)
Definition: genC.h:93
#define CONSP(x)
Definition: genC.h:88
#define assert(ex)
Definition: newgen_assert.h:41
#define RANGE(x)
RANGE.
Definition: ri.h:2257

References assert, CAR, CONS, CONSP, ENDP, gen_nconc(), LIST, MAPL, NIL, and RANGE.

Referenced by atomize_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddCommonToHostAndNodeModules()

void AddCommonToHostAndNodeModules ( entity  common)
Parameters
commonommon

Definition at line 371 of file hpfc-util.c.

372 {
375 }
entity host_module
HPFC - Fabien Coelho, May 1993 and later...
Definition: compiler.c:47
entity node_module
Definition: compiler.c:47
void store_new_node_variable(entity new, entity old)
void store_new_host_variable(entity new, entity old)
void AddCommonToModule(entity common, entity module, void(*update)(), string suffix)
The common name is changed to distinguish the current, host and node instances of the common.
Definition: hpfc-util.c:328
#define NODE_NAME
#define HOST_NAME
Constants.

References AddCommonToModule(), host_module, HOST_NAME, node_module, NODE_NAME, store_new_host_variable(), and store_new_node_variable().

Referenced by init_host_and_node_entities().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddCommonToModule()

void AddCommonToModule ( entity  ,
entity  ,
void(*)(void)  ,
string   
)

◆ AddEntityToHostAndNodeModules()

void AddEntityToHostAndNodeModules ( entity  e)

AddEntityToHostAndNodeModules.

added because of some entity errors.

Definition at line 298 of file hpfc-util.c.

300 {
301  entity new_node = AddEntityToModule(e, node_module),
302  new_host = entity_undefined;
303 
304  if (!bound_new_node_p(e))
305  store_new_node_variable(new_node, e);
306  else
308 
309  if (!array_distributed_p(e))
310  {
311  new_host = AddEntityToModule(e, host_module);
312 
313  if (!bound_new_host_p(e))
314  store_new_host_variable(new_host, e),
315  /*
316  * added because of some entity errors.
317  */
318  store_new_host(new_node, new_host),
319  store_new_node(new_host, new_node);
320  else
322  }
323 }
bool bound_new_host_p(entity)
entity load_new_node(entity)
void store_new_node(entity, entity)
bool bound_new_node_p(entity)
entity load_new_host(entity)
void store_new_host(entity, entity)
bool array_distributed_p(entity)
entity AddEntityToModule(entity e, entity module)
!!! caution, it may not be a module, but a common...
Definition: entity.c:3171
void AddEntityToDeclarations(entity, entity)
END_EOLE.
Definition: variable.c:108

References AddEntityToDeclarations(), AddEntityToModule(), array_distributed_p(), bound_new_host_p(), bound_new_node_p(), entity_undefined, host_module, load_new_host(), load_new_node(), node_module, store_new_host(), store_new_host_variable(), store_new_node(), and store_new_node_variable().

Referenced by generate_parallel_body(), generate_read_of_ref_for_all(), generate_read_of_ref_for_computer(), generate_update_distributed_value_from_host(), and init_host_and_node_entities().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddOnceToIndicesList()

list AddOnceToIndicesList ( list  l,
list  lsyn 
)
Parameters
lsynsyn

Definition at line 188 of file compiler-util.c.

190 {
191  MAP(SYNTAX, s,
193  lsyn = CONS(SYNTAX, s, lsyn),
194  l);
195 
196  gen_free_list(l);
197  return(lsyn);
198 }
bool is_in_syntax_list(entity e, list l)
#define syntax_reference(x)
Definition: ri.h:2730
#define reference_variable(x)
Definition: ri.h:2326
#define SYNTAX(x)
SYNTAX.
Definition: ri.h:2670

References CONS, gen_free_list(), is_in_syntax_list(), MAP, reference_variable, SYNTAX, and syntax_reference.

Referenced by hpf_compile_parallel_body(), and lIndicesOfRef().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ align_check()

bool align_check ( reference  r1,
reference  r2,
list plvect,
list plkind 
)

computes the shift vector that links the two references, true if every thing is ok, i.e.

the vector is ok for the distributed dimensions... The vector considered here is just a list of integers. conditions: same template

default value, used in the shift case !

default value, used in the const case !

replication, say it is not aligned

replicated reference...

a(i) -> t(i,1), b(i,j)->t(i,j), should detect do i a(i) = b(i,1) as aligned...

??? this could be managed later in this function...

should be ok, even if a delta is induced, if it stays on the same processor along this dimension. The case should also be managed downward, when playing with local updates. ??? maybe there is also a consequence on the send/receive symetry, in order to put the message where it should be...

it is checked later whether the data are on the same processor or not.

now we have everything to check whether it is aligned... and to compute the shift necessary to the overlap analysis.

something is true!

just check whether aligned or not

even in the constant case ! not aligned

aligned... ??? bug if not 1: later on, because decl shift

4 cases study with bconst and bshift, plus the rates

what should be the relevent information(s) ??? not only d, but shift2 and t2 may be usefull either ??? what about rates!=1 ? decl shift problem added.

say not aligned...

??? decl shift problem may occur here as well

??? I should do something with blcnst2?

well, say not aligned, but one to many or many to one communications may be used...

ith dimension of e2 is not distributed

may be used to generate RSDs

else the local constant should be detected, for onde24...

Parameters
r11
r22
plvectlvect
plkindlkind

Definition at line 190 of file align-checker.c.

195 {
196  int procdim, i, ne2dim;
197  entity e1, e2;
198  align a1, a2;
199  bool ok = true;
200  list li1, li2;
201 
202  e1 = reference_variable(r1),
203  e2 = reference_variable(r2);
204  a1 = load_hpf_alignment(e1),
205  a2 = load_hpf_alignment(e2);
206  li1 = reference_indices(r1),
207  li2 = reference_indices(r2);
208  *plvect = NIL;
209  *plkind = NIL;
210 
211  pips_debug(7, "with references to %s[DIM=%zd] and %s[DIM=%zd]\n",
212  entity_name(e1), gen_length(li1), entity_name(e2), gen_length(li2));
213 
214  ne2dim = NumberOfDimension(e2);
215 
217  {
218  pips_debug(5, "different templates\n");
219 
220  for (i=1 ; i<=ne2dim ; i++)
221  if (ith_dim_distributed_p(e2, i, &procdim))
222  {
223  *plkind = gen_nconc(*plkind, CONS(INT, not_aligned, NIL));
224  *plvect = gen_nconc(*plvect, CONS(PVECTOR,
225  (VECTOR) VECTEUR_NUL, NIL));
226  }
227  else
228  {
229  *plkind = gen_nconc(*plkind, CONS(INT, local_star, NIL));
230  *plvect = gen_nconc(*plvect, CONS(PVECTOR,
231  (VECTOR) VECTEUR_NUL, NIL));
232  }
233 
234  return ok;
235  }
236 
237  ifdebug(8)
238  {
239  fprintf(stderr, "[align_check] references are: ");
240  print_reference(r1);
241  fprintf(stderr, " and ");
242  print_reference(r2);
243  fprintf(stderr, "\n");
244  }
245 
246  for (i=1 ; i<=ne2dim ; i++)
247  {
248  expression indice1, indice2;
249  int
250  affr1 = 1, /* default value, used in the shift case ! */
251  affr2 = 1,
252  shft1, shft2;
253  entity
254  index1 = NULL, /* default value, used in the const case ! */
255  index2 = NULL;
256  bool
257  baffin1, baffin2,
258  bshift1, bshift2,
259  bconst1, bconst2,
260  blcnst2=0;
261 
262  pips_debug(8, "considering dimension %d of %s\n", i, entity_name(e2));
263 
264  indice2 = EXPRESSION(gen_nth(i-1, li2));
265 
266  baffin2 = affine_expression_of_loop_index_p(indice2,
267  &index2, &shft2, &affr2);
268  bshift2 = shift_expression_of_loop_index_p(indice2, &index2, &shft2);
269  bconst2 = hpfc_integer_constant_expression_p(indice2, &shft2);
270  if (!(baffin2 || bshift2 || bconst2))
271  blcnst2 = local_integer_constant_expression(indice2);
272 
273  if (ith_dim_distributed_p(e2, i, &procdim))
274  {
275  alignment
276  a2 = FindArrayDimAlignmentOfArray(e2, i),
279  int
280  dim1=((a1!=alignment_undefined)?(alignment_arraydim(a1)):(-1)),
281  rate1, rate2,
282  cnst1, cnst2;
283 
284  rate2 = HpfcExpressionToInt(alignment_rate(a2));
286 
287  if ((dim1<0) || /* replication, say it is not aligned */
288  ((dim1==0) && (!bconst2))) /* replicated reference...*/
289  {
290  pips_debug(8, "%s[DIM=%d] not aligned aff %d shi %d cst %d\n",
291  entity_name(e2), i, baffin2, bshift2, bconst2);
292 
293  *plkind = gen_nconc(*plkind, CONS(INT, not_aligned, NIL));
294  *plvect = gen_nconc(*plvect, CONS(PVECTOR,
295  (VECTOR) VECTEUR_NUL, NIL));
296  }
297  else
298  if ((dim1==0) && (bconst2))
299  {
300  /* a(i) -> t(i,1), b(i,j)->t(i,j), should detect
301  * do i a(i) = b(i,1) as aligned...
302  *
303  * ??? this could be managed later in this function...
304  */
305 
307  t2 = rate2*shft2+cnst2;
308 
309  /* should be ok, even if a delta is induced, if it stays
310  * on the same processor along this dimension. The case
311  * should also be managed downward, when playing with
312  * local updates.
313  * ??? maybe there is also a consequence on the
314  * send/receive symetry, in order to put the message where it
315  * should be...
316  */
317 
318  /* it is checked later whether the data are on the same
319  * processor or not.
320  */
321 
322  *plkind = gen_nconc(*plkind, CONS(INT, aligned_constant, NIL));
323  *plvect = gen_nconc(*plvect,
324  CONS(PVECTOR, (VECTOR)
326  vect_new(DELTAV, int_to_value(t2-t1))),
327  NIL));
328  }
329  else
330  {
331  indice1 = EXPRESSION(gen_nth(dim1-1, li1));
332 
333  rate1 = HpfcExpressionToInt(alignment_rate(a1));
335 
337  (indice1, &index1, &shft1, &affr1);
339  (indice1, &index1, &shft1);
341  (indice1, &shft1);
342 
343  /* now we have everything to check whether it is aligned...
344  * and to compute the shift necessary to the overlap analysis.
345  */
346 
347  if (!((baffin1 || bshift1 || bconst1) &&
348  (baffin2 || bshift2 || bconst2)))
349  {
350  *plkind = gen_nconc(*plkind, CONS(INT, not_aligned, NIL));
351  *plvect = gen_nconc(*plvect, CONS(PVECTOR,(VECTOR)
352  VECTEUR_NUL, NIL));
353  }
354  else /* something is true! */
355  if (baffin1 || baffin2) /* just check whether aligned or not */
356  {
357  int
358  r1 = ((bconst1)?(0):(rate1*affr1)),
359  r2 = ((bconst2)?(0):(rate2*affr2)),
360  c1 = rate1*shft1+cnst1,
361  c2 = rate2*shft2+cnst2;
362 
363  /* even in the constant case ! not aligned */
364  if ((index1!=index2) ||
365  (r1!=r2) || (c1!=c2))
366  {
367  *plkind =
368  gen_nconc(*plkind, CONS(INT, not_aligned, NIL));
369  *plvect =
370  gen_nconc(*plvect, CONS(PVECTOR,
371  (VECTOR) VECTEUR_NUL, NIL));
372  }
373  else /* aligned... ???
374  * bug if not 1: later on, because decl shift
375  */
376  {
377  *plkind =
378  gen_nconc(*plkind, CONS(INT, aligned_star, NIL));
379  *plvect =
380  gen_nconc(*plvect, CONS(PVECTOR,
381  (VECTOR) VECTEUR_NUL, NIL));
382  }
383  }
384  else /* 4 cases study with bconst and bshift, plus the rates */
385  if (bconst1 && bconst2)
386  {
387  int
388  t1 = (rate1*shft1+cnst1),
389  t2 = (rate2*shft2+cnst2),
390  d = (t2-t1);
391 
392  /* what should be the relevent information(s) ???
393  * not only d, but shift2 and t2 may be usefull either
394  * ??? what about rates!=1 ? decl shift problem added.
395  */
396 
397  *plkind =
398  gen_nconc(*plkind, CONS(INT, aligned_constant, NIL));
399  *plvect =
400  gen_nconc(*plvect,
401  CONS(PVECTOR, (VECTOR)
403  DELTAV, int_to_value(d),
404  TEMPLATEV, int_to_value(t2),
405  TCST, int_to_value(shft2)),
406  NIL));
407  }
408  else /* say not aligned... */
409  if ((rate1!=1) || (rate2!=1) || (index1!=index2))
410  {
411  *plkind = gen_nconc(*plkind,
412  CONS(INT, not_aligned, NIL));
413  *plvect = gen_nconc(*plvect,
415  }
416  else
417  if (bshift1 && bshift2)
418  {
419  /* ??? decl shift problem may occur here as well */
420  int
421  tc1 = (shft1+cnst1),
422  tc2 = (shft2+cnst2),
423  shift = (tc2-tc1);
424 
425  *plkind = gen_nconc(*plkind, CONS(INT, aligned_shift, NIL));
426  *plvect = gen_nconc
427  (*plvect,
428  CONS(PVECTOR, (VECTOR)
430  TSHIFTV, int_to_value(shift),
431  (Variable) index1, VALUE_ONE,
432  TCST, int_to_value(shft2)),
433  NIL));
434  }
435  else /* ??? I should do something with blcnst2? */
436  {
437  /* well, say not aligned, but one to many or many to one
438  * communications may be used...
439  */
440  *plkind =
441  gen_nconc(*plkind, CONS(INT, not_aligned, NIL));
442  *plvect =
443  gen_nconc(*plvect,
445  }
446  }
447  }
448  else /* ith dimension of e2 is not distributed */
449  {
450  if (!(baffin2 || bshift2 || bconst2 || blcnst2))
451  {
452  *plkind = gen_nconc(*plkind, CONS(INT, local_star, NIL));
453  *plvect = gen_nconc(*plvect,
455  }
456  else
457  if (baffin2) /* may be used to generate RSDs */
458  {
459  *plkind = gen_nconc(*plkind, CONS(INT, local_affine, NIL));
460  *plvect =
461  gen_nconc(*plvect,
462  CONS(PVECTOR, (VECTOR)
464  (Variable) index2, int_to_value(affr2),
465  TCST, int_to_value(shft2)),
466  NIL));
467  }
468  else
469  if (bshift2)
470  {
471  *plkind = gen_nconc(*plkind, CONS(INT, local_shift, NIL));
472  *plvect =
473  gen_nconc(*plvect,
474  CONS(PVECTOR, (VECTOR)
476  (Variable) index2, VALUE_ONE,
477  TCST, int_to_value(shft2)),
478  NIL));
479  }
480  else
481  if (bconst2)
482  {
483  *plkind = gen_nconc(*plkind, CONS(INT, local_constant, NIL));
484  *plvect = gen_nconc(*plvect, CONS(PVECTOR, (VECTOR)
485  vect_new(TCST, int_to_value(shft2)),
486  NIL));
487  }
488  /* else the local constant should be detected, for onde24... */
489  else
490  if (blcnst2)
491  {
492  *plkind = gen_nconc(*plkind, CONS(INT, local_form_cst, NIL));
493  *plvect =
494  gen_nconc(*plvect,
495  CONS(PVECTOR, (VECTOR)
497  NIL));
498  }
499  }
500  }
501 
502  ifdebug(8)
503  {
504  list l;
505  fprintf(stderr, "[align_check] returning: ");
506  for (l=*plkind; l; POP(l))
507  fprintf(stderr, "%"PRIdPTR", ", INT(CAR(l)));
508  fprintf(stderr, "\n");
509  }
510 
511  return ok;
512 }
#define local_affine
#define aligned_shift
#define not_aligned
#define aligned_star
#define local_form_cst
#define aligned_constant
#define local_star
#define local_constant
#define local_shift
bool local_integer_constant_expression(expression e)
true is the expression is locally constant, that is in the whole loop nest, the reference is not writ...
Definition: align-checker.c:64
static bool affine_expression_of_loop_index_p(expression e, entity *pe, int *pi1, int *pi2)
true if the expression is an affine function of a loop nest index.
bool hpfc_integer_constant_expression_p(expression e, int *pi)
static bool shift_expression_of_loop_index_p(expression e, entity *pe, int *pi)
true if the expression is shift function of a loop nest index.
Definition: align-checker.c:82
#define VALUE_ONE
@ INT
Definition: atomic.c:48
bool conformant_templates_p(entity t1, entity t2)
Definition: dynamic.c:405
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59
size_t gen_length(const list l)
Definition: list.c:150
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
Definition: list.c:710
#define alignment_templatedim(x)
Definition: hpf.h:136
#define alignment_undefined
Definition: hpf.h:108
#define alignment_constant(x)
Definition: hpf.h:140
#define align_template(x)
Definition: hpf.h:98
#define alignment_rate(x)
Definition: hpf.h:138
#define alignment_arraydim(x)
Definition: hpf.h:134
int HpfcExpressionToInt(expression e)
HpfcExpressionToInt(e)
Definition: hpfc-util.c:569
bool ith_dim_distributed_p(entity array, int i, int *pprocdim)
whether a dimension is distributed or not.
Definition: hpfc-util.c:160
#define FindArrayDimAlignmentOfArray(array, dim)
#define TEMPLATEV
Definition: defines-local.h:80
#define TSHIFTV
Definition: defines-local.h:81
#define FindTemplateDimAlignmentOfArray(array, dim)
#define DELTAV
??? very beurk!
Definition: defines-local.h:79
align load_hpf_alignment(entity)
void print_reference(reference r)
Definition: expression.c:142
int NumberOfDimension(entity)
Definition: size.c:588
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define entity_name(x)
Definition: ri.h:2790
#define expression_normalized(x)
Definition: ri.h:1249
#define reference_indices(x)
Definition: ri.h:2328
#define normalized_linear(x)
Definition: ri.h:1781
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define ifdebug(n)
Definition: sg.c:47
static bool ok
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
Pvecteur vect_make(Pvecteur v, Variable var, Value val,...)
Pvecteur vect_make(v, [var, val,]* 0, val) Pvecteur v; // may be NULL, use assigne anyway Variable va...
Definition: alloc.c:165
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Definition: binaires.c:53

References affine_expression_of_loop_index_p(), align_template, aligned_constant, aligned_shift, aligned_star, alignment_arraydim, alignment_constant, alignment_rate, alignment_templatedim, alignment_undefined, CAR, conformant_templates_p(), CONS, DELTAV, entity_name, EXPRESSION, expression_normalized, FindArrayDimAlignmentOfArray, FindTemplateDimAlignmentOfArray, fprintf(), gen_length(), gen_nconc(), gen_nth(), hpfc_integer_constant_expression_p(), HpfcExpressionToInt(), ifdebug, INT, int_to_value, ith_dim_distributed_p(), load_hpf_alignment(), local_affine, local_constant, local_form_cst, local_integer_constant_expression(), local_shift, local_star, NIL, normalized_linear, not_aligned, NumberOfDimension(), ok, pips_debug, POP, print_reference(), PVECTOR, reference_indices, reference_variable, shift_expression_of_loop_index_p(), TCST, TEMPLATEV, TSHIFTV, VALUE_ONE, vect_add(), vect_make(), vect_new(), VECTEUR_NUL, and VECTOR.

Referenced by Overlap_Analysis().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ alignments_compatible_p()

bool alignments_compatible_p ( entity  e1,
int  dim1,
entity  e2,
int  dim2 
)

bool alignments_compatible_p(entity e1, int dim1, entity e2, int dim2)

what: whether e1 and e2 dimensions dim1 and dim2 are aligned. how: basic low level comparison input: entities and dimension numbers output: the bool result side effects:

  • uses alignment internal descriptions bugs or features:
  • ??? should be relative to a reference, instead of assuming mere indexes
Parameters
e11
dim1im1
e22
dim2im2

Definition at line 678 of file hpfc-util.c.

680 {
681  int tdim1, rate1, shift1, tdim2, rate2, shift2;
682 
683  get_alignment(e1, dim1, &tdim1, &rate1, &shift1);
684  get_alignment(e2, dim2, &tdim2, &rate2, &shift2);
685 
686  if (tdim1!=tdim2) return false;
687  if (!tdim1 && !tdim2) return true;
688 
689  return rate1==rate2 && shift1==shift2;
690 }
void get_alignment(entity array, int dim, int *ptdim, int *pa, int *pb)
Definition: hpfc-util.c:606

References get_alignment().

Referenced by references_aligned_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ alive_arrays()

list alive_arrays ( statement  s,
entity  t 
)

what: returns the list of alive arrays for statement s and template t.

how: uses the alive_synonym, and computes the defaults. input: statement s and template t which are of interest. output: a list of entities which is allocated. side effects: none. of entities

of entities

to tag seen primaries.

??? well, it is not necessarily initialized, I guess...

first the alive list is scanned.

second the defaults are looked for. namely the primary entities.

Definition at line 1504 of file dynamic.c.

1507 {
1508  list /* of entities */ l = NIL, lseens = NIL; /* to tag seen primaries. */
1509 
1510  pips_assert("template", entity_template_p(t) && primary_entity_p(t));
1511  pips_debug(7, "for template %s\n", entity_name(t));
1512 
1513  /* ??? well, it is not necessarily initialized, I guess...
1514  */
1515  if (!bound_alive_synonym_p(s))
1516  store_alive_synonym(s, make_entities(NIL));
1517 
1518  /* first the alive list is scanned.
1519  */
1520  MAP(ENTITY, array,
1521  {
1523 
1524  if (safe_load_primary_entity(ta)==t)
1525  l = CONS(ENTITY, array, l);
1526 
1527  pips_debug(8, "adding %s as alive\n", entity_name(array));
1528 
1529  lseens = CONS(ENTITY, load_primary_entity(array), lseens);
1530  },
1531  entities_list(load_alive_synonym(s)));
1532 
1533  /* second the defaults are looked for. namely the primary entities.
1534  */
1535  MAP(ENTITY, array,
1536  {
1537  if (primary_entity_p(array) && !gen_in_list_p(array, lseens))
1538  {
1540  l = CONS(ENTITY, array, l);
1541 
1542  pips_debug(8, "adding %s as default\n", entity_name(array));
1543 
1544  lseens = CONS(ENTITY, array, lseens);
1545  }
1546  },
1548 
1549  DEBUG_ELST(9, "seen arrays", lseens);
1550  gen_free_list(lseens);
1551 
1552  DEBUG_ELST(7, "returned alive arrays", l);
1553  return l;
1554 }
entities make_entities(list a)
Definition: hpf_private.c:250
entity safe_load_primary_entity(entity e)
HPFC module by Fabien COELHO.
Definition: dynamic.c:61
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
Definition: list.c:734
#define DEBUG_ELST(D, W, L)
#define primary_entity_p(a)
bool entity_template_p(entity)
list list_of_distributed_arrays(void)
static entity array

References align_template, array, CONS, DEBUG_ELST, entities_list, ENTITY, entity_name, entity_template_p(), gen_free_list(), gen_in_list_p(), list_of_distributed_arrays(), load_hpf_alignment(), load_primary_entity(), make_entities(), MAP, NIL, pips_assert, pips_debug, primary_entity_p, and safe_load_primary_entity().

Referenced by one_distribute_directive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ argument_bound_entity()

entity argument_bound_entity ( entity  module,
entity  array,
bool  upper,
int  dim 
)
Parameters
moduleodule
arrayrray
upperpper
dimim

Definition at line 499 of file run-time.c.

504 {
505  entity result;
506  string name = bound_parameter_name(array, upper? UPPER: LOWER, dim);
507 
509  is_basic_int);
510 
511  free(name);
512  return result;
513 }
#define UPPER(c)
Definition: genSML.c:37
void free(void *)
#define LOWER
static char * module
Definition: pips.c:74
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
entity find_or_create_typed_entity(string, const char *, tag)
Looks for an entity of the specified basic.
Definition: variable.c:1046
@ is_basic_int
Definition: ri.h:571
string bound_parameter_name(entity array, string side, int dim)
returns a name for the bound of the declaration of array array, side side and dimension dim.
Definition: run-time.c:488

References array, bound_parameter_name(), find_or_create_typed_entity(), free(), is_basic_int, LOWER, module, module_local_name(), and UPPER.

Referenced by create_bound_entity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ array_access_to_array_ranges()

list array_access_to_array_ranges ( reference  r,
list  lkref,
list  lvref 
)

this dimension shouldn't be used, so I put there whatever I want... ??? mouais, the information is in the vector, I think.

??? should check that it is ok

Parameters
lkrefkref
lvrefvref

Definition at line 569 of file message-utils.c.

572 {
574  int dim = 1;
575  list li = reference_indices(r), lk = lkref, lv = lvref, lra = NIL,
577 
578  pips_debug(7, "considering array %s\n", entity_name(array));
579 
580  for (; li; POP(li), POP(lk), POP(lv), POP(ldim), dim++)
581  {
582  access a = INT(CAR(lk));
583  Pvecteur v = (Pvecteur) PVECTOR(CAR(lv));
585 
586  pips_debug(8, "DIM=%d[%d]\n", dim, a);
587 
588  switch (access_tag(a))
589  {
590  case local_form_cst:
591  {
592  /* this dimension shouldn't be used,
593  * so I put there whatever I want...
594  * ??? mouais, the information is in the vector, I think.
595  */
596  lra = gen_nconc(lra,
597  CONS(RANGE,
601  NIL));
602 
603  break;
604  }
605  case aligned_constant:
606  case local_constant:
607  {
608  Value tc = vect_coeff(TCST, v);
609  expression arraycell = Value_to_expression(tc);
610 
611  lra = gen_nconc(lra,
612  CONS(RANGE,
613  make_range(arraycell, arraycell,
614  int_to_expression(1)),
615  NIL));
616  break;
617  }
618  case aligned_shift:
619  case local_shift:
620  {
621  range
622  /* ??? should check that it is ok */
624  ((entity) var_of(vect_del_var(v, TCST)));
625  expression
626  rl = range_lower(rg),
627  ru = range_upper(rg),
628  in = range_increment(rg),
632  int lb = -1, ub = -1, dt = VALUE_TO_INT(vdt);
633 
635  lb = HpfcExpressionToInt(rl),
636  al = int_to_expression(lb-dt);
637  else
639 
641  ub = HpfcExpressionToInt(ru),
642  au = int_to_expression(ub-dt);
643  else
645 
646  lra = gen_nconc(lra, CONS(RANGE, make_range(al, au, in), NIL));
647  break;
648  }
649  case aligned_affine:
650  case local_affine:
651  {
652  Pvecteur v2 = vect_del_var(v, TCST);
653  entity index = (entity) var_of(v2);
654  range rg = loop_index_to_range(index);
656  int rate = val_of(v2),
660  dt = VALUE_TO_INT(vdt);
661  expression
662  ai = int_to_expression(rate*in),
663  al = int_to_expression(rate*lb-dt),
664  au = int_to_expression(rate*ub-dt);
665 
666  lra = gen_nconc(lra, CONS(RANGE, make_range(al, au, ai), NIL));
667  break;
668  }
669  default:
670  pips_internal_error("unexpected but maybe legal access");
671  break;
672  }
673  }
674 
675  return(lra);
676 }
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
range make_range(expression a1, expression a2, expression a3)
Definition: ri.c:2041
struct _newgen_struct_entity_ * entity
Definition: abc_private.h:14
#define access
#define aligned_affine
#define access_tag(a)
#define VALUE_TO_INT(val)
int Value
range loop_index_to_range(entity index)
#define pips_internal_error
Definition: misc-local.h:149
static int tc
Internal variables
Definition: reindexing.c:107
bool expression_integer_constant_p(expression e)
Definition: expression.c:2417
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
expression Value_to_expression(Value v)
added interface for linear stuff.
Definition: expression.c:1251
#define range_upper(x)
Definition: ri.h:2290
#define dimension_lower(x)
Definition: ri.h:980
#define type_variable(x)
Definition: ri.h:2949
#define range_increment(x)
Definition: ri.h:2292
#define expression_undefined
Definition: ri.h:1223
#define dimension_upper(x)
Definition: ri.h:982
#define range_lower(x)
Definition: ri.h:2288
#define variable_dimensions(x)
Definition: ri.h:3122
#define entity_type(x)
Definition: ri.h:2792
#define val_of(varval)
#define var_of(varval)
Pvecteur vect_del_var(Pvecteur v_in, Variable var)
Pvecteur vect_del_var(Pvecteur v_in, Variable var): allocation d'un nouveau vecteur egal a la project...
Definition: unaires.c:206
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
Definition: unaires.c:228

References access, access_tag, aligned_affine, aligned_constant, aligned_shift, array, CAR, CONS, copy_expression(), DIMENSION, dimension_lower, dimension_upper, entity_name, entity_type, EXPRESSION, expression_integer_constant_p(), expression_normalized, expression_undefined, gen_nconc(), HpfcExpressionToInt(), INT, int_to_expression(), local_affine, local_constant, local_form_cst, local_shift, loop_index_to_range(), make_range(), NIL, normalized_linear, pips_debug, pips_internal_error, POP, PVECTOR, RANGE, range_increment, range_lower, range_upper, reference_indices, reference_variable, tc, TCST, type_variable, val_of, Value_to_expression(), VALUE_TO_INT, var_of, variable_dimensions, vect_coeff(), and vect_del_var().

Referenced by loop_nest_guard().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ array_distributed_p()

bool array_distributed_p ( entity  )

Referenced by add_bound_arguments(), AddEntityToHostAndNodeModules(), caller_list_of_bounds(), check_for_similarity(), clean_distributed_io_system(), compile_reduction(), DistArraysEffects(), drop_distributed_arguments(), entity_to_hpf_align_constraints(), entity_to_new_declaration(), expression_simple_nondist_p(), FindRefToDistArray_syntax_rewrite(), FindRefToDistArrayInStatement_call_filter(), generate_c1_alpha(), generate_c1_beta(), generate_compute_local_indices(), generate_copy_loop_nest(), generate_get_value_locally(), generate_io_collect_or_update(), generate_io_system(), generate_read_of_ref_for_all(), generate_read_of_ref_for_computer(), generate_receive_from_computer(), generate_send_to_computer(), generate_shared_io_system(), generate_system_for_distributed_variable(), generate_update_distributed_value_from_host(), generate_update_private_value_from_host(), get_alignment(), get_ith_dim_new_declaration(), hpf_compile_call(), hpfc_call_with_distributed_args_p(), hpfc_check_for_similarities(), hpfc_compute_align_constraints(), hpfc_compute_entity_to_new_declaration(), hpfc_compute_unicity_constraints(), hpfc_decision(), hpfc_translate_call_with_distributed_args(), initial_alignment(), io_efficient_compile(), loop_flt(), lUpdateExpr_but_distributed(), new_declaration_tag(), NewDeclarationOfDistributedArray(), one_align_directive(), one_distribute_directive(), put_variables_in_ordered_lists(), references_aligned_p(), replicated_p(), STATIC_LIST_OF_HPF_OBJECTS(), store_a_new_declaration(), subarray_shift_assignment_p(), and update_overlaps_in_caller().

◆ array_distribution_similar_p()

bool array_distribution_similar_p ( entity  a1,
entity  a2 
)

conformant processors ??? could assume that P(1:1,1:n) is conformant to P'(1:n)?

considering ith dim of proc

conformant distributions

if the size is 1, whatever the distribution it is ok!

conformant alignments for that pe dim !!! the HPF mapping "semantics" insure that the corresponding dimension is distributed!

Parameters
a11
a22

Definition at line 578 of file dynamic.c.

579 {
580  align
581  al1 = load_hpf_alignment(a1),
582  al2 = load_hpf_alignment(a2);
583  entity
584  t1 = align_template(al1),
585  t2 = align_template(al2);
586  distribute
587  d1 = load_hpf_distribution(t1),
588  d2 = load_hpf_distribution(t2);
589  entity
590  p1 = distribute_processors(d1),
591  p2 = distribute_processors(d2);
592  int i, td1, td2,
593  ndimdist = NumberOfDimension(p1);
594 
595  pips_assert("same primary",
597 
598  pips_debug(6, "comparing %s and %s\n", entity_name(a1), entity_name(a2));
599 
600  /* conformant processors
601  * ??? could assume that P(1:1,1:n) is conformant to P'(1:n)?
602  */
603  if (!conformant_entities_p(p1, p2))
604  RET("different processors", false);
605 
606  for (i=1; i<=ndimdist; i++) /* considering ith dim of proc */
607  {
608  /* conformant distributions
609  */
610  distribution
612  (distribute_distribution(d1), i, &td1),
614  (distribute_distribution(d2), i, &td2);
615  alignment at1, at2;
616  int dsize = SizeOfIthDimension(p1,i);
617 
618  /* if the size is 1, whatever the distribution it is ok! */
619  if (dsize!=1)
620  {
621  if (!same_distribution_p(x1, x2))
622  RET("different distribution", false);
623 
624  /* conformant alignments for that pe dim
625  * !!! the HPF mapping "semantics" insure that the corresponding
626  * dimension is distributed!
627  */
630 
631  if (!same_alignment_p(a1,t1,at1,a2,t2,at2))
632  RET("different alignment", false);
633  }
634  }
635 
636  pips_debug(6, "similar distributions!\n");
637  return true;
638 }
static bool same_distribution_p(distribution d1, distribution d2)
array_distribution_similar_p
Definition: dynamic.c:523
#define RET(msg, what)
Definition: dynamic.c:574
static bool same_alignment_p(entity e1, entity t1, alignment a1, entity e2, entity t2, alignment a2)
Definition: dynamic.c:535
static bool conformant_entities_p(entity e1, entity e2)
Definition: dynamic.c:329
#define align_alignment(x)
Definition: hpf.h:96
#define distribute_distribution(x)
Definition: hpf.h:174
#define distribute_processors(x)
Definition: hpf.h:176
distribution FindDistributionOfProcessorDim(list ldi, int dim, int *tdim)
Definition: hpfc-util.c:421
alignment FindAlignmentOfTemplateDim(list lal, int dim)
Definition: hpfc-util.c:389
distribute load_hpf_distribution(entity)
int SizeOfIthDimension(entity, int)
this function returns the size of the ith dimension of a variable e.
Definition: size.c:453

References align_alignment, align_template, conformant_entities_p(), distribute_distribution, distribute_processors, entity_name, FindAlignmentOfTemplateDim(), FindDistributionOfProcessorDim(), load_hpf_alignment(), load_hpf_distribution(), load_primary_entity(), NumberOfDimension(), pips_assert, pips_debug, RET, same_alignment_p(), same_distribution_p(), and SizeOfIthDimension().

Referenced by check_for_similarity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ array_lower_upper_bounds_list()

list array_lower_upper_bounds_list ( entity  array)

of expressions

of expression

interleave both lists (just for fun:-)

Parameters
arrayrray

Definition at line 539 of file run-time.c.

540 {
541  list /* of expression */ lb = array_bounds_list(array, false),
542  lu = array_bounds_list(array, true),
543  l = lb, lnb, lnu;
544 
545  if (!l) return NIL;
546 
547  /* interleave both lists (just for fun:-)
548  */
549  for(lnb=CDR(lb), lnu=CDR(lu); lb;
550  CDR(lb)=lu, CDR(lu)=lnb,
551  lb=lnb, lnb=lnb?CDR(lnb):NIL, lu=lnu, lnu=lnu?CDR(lnu):NIL);
552 
553  return l;
554 }
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
static list array_bounds_list(entity array, bool upper)
of expressions
Definition: run-time.c:527

References array, array_bounds_list(), CDR, and NIL.

Referenced by compile_reduction(), generate_subarray_shift(), and st_generate_packing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ array_ranges_to_template_ranges()

list array_ranges_to_template_ranges ( entity  array,
list  lra 
)

scratched

replication

non distributed dimension, so not used...

Parameters
arrayrray
lrara

Definition at line 426 of file message-utils.c.

429 {
431  entity template = align_template(a);
432  list la = align_alignment(a), lrt = NIL;
433  int i = 1;
434 
435  for (i=1 ; i<=NumberOfDimension(template) ; i++)
436  {
438  int arraydim = alignment_undefined_p(al)? -1: alignment_arraydim(al);
439 
440  if (arraydim==-1) /* scratched */
441  {
442  dimension d = FindIthDimension(template, i);
443  lrt = gen_nconc(lrt,
444  CONS(RANGE,
447  int_to_expression(1)), NIL));
448  }
449  else if (arraydim==0) /* replication */
450  {
452 
453  lrt = gen_nconc(lrt,
454  CONS(RANGE,
455  make_range(b, b, int_to_expression(1)),
456  NIL));
457  }
458  else
459  {
460  range rg = RANGE(gen_nth(arraydim-1, lra));
461 
463  {
464  /* non distributed dimension, so not used...
465  */
466  lrt = gen_nconc(lrt, CONS(RANGE,
470  NIL));
471  }
472  else
473  {
474  int
477  lb, ub, in;
478  expression tl, tu, ti;
479 
483  tl = int_to_expression(a*lb+b);
484  tu = int_to_expression(a*ub+b);
485  ti = int_to_expression(a*in);
486 
487  lrt = gen_nconc(lrt,
488  CONS(RANGE,
489  make_range(tl, tu, ti),
490  NIL));
491  }
492  }
493  }
494 
495  return(lrt);
496 }
#define alignment_undefined_p(x)
Definition: hpf.h:109
dimension FindIthDimension(entity, int)
Definition: type.c:1180
#define expression_undefined_p(x)
Definition: ri.h:1224

References align_alignment, align_template, alignment_arraydim, alignment_constant, alignment_rate, alignment_undefined_p, array, CONS, copy_expression(), dimension_lower, dimension_upper, expression_undefined, expression_undefined_p, FindAlignmentOfTemplateDim(), FindIthDimension(), gen_nconc(), gen_nth(), HpfcExpressionToInt(), int_to_expression(), load_hpf_alignment(), make_range(), NIL, NumberOfDimension(), RANGE, range_increment, range_lower, and range_upper.

Referenced by loop_nest_guard(), and one_message_guards_and_neighbour().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ array_synonym_aligned_as()

entity array_synonym_aligned_as ( entity  array,
align  a 
)

entity array_synonym_aligned_as(array, a) entity array; align a;

what: finds or creates a new entity aligned as needed. input: an array (which must be dynamic) and an align output: returns an array aligned as specified by align a side effects:

  • creates a new entity if necessary.
  • this entity is stored as a synonym of array, and tagged as dynamic.
  • the align is freed if not used. bugs or features:

the one found is returned

else no compatible array does exist, so one must be created

Parameters
arrayrray

Definition at line 449 of file dynamic.c.

452 {
453  ifdebug(8)
454  {
455  pips_debug(8, "array %s\n", entity_name(array));
456  print_align(a);
457  }
458 
459  MAP(ENTITY, ar,
460  {
461  if (same_align_p(load_hpf_alignment(ar), a))
462  {
463  free_align(a);
464  return ar; /* the one found is returned */
465  }
466  },
468 
469  /* else no compatible array does exist, so one must be created
470  */
471  return new_synonym_array(array, a);
472 }
void free_align(align p)
Definition: hpf.c:19
void print_align(align a)
this is a set of functions to help hpfc debugging
Definition: debug-util.c:38
static entity new_synonym_array(entity a, align al)
builds a new synonym for array a, the alignment of which will be al.
Definition: dynamic.c:306
static bool same_align_p(align a1, align a2)
Definition: dynamic.c:418
entities load_dynamic_hpf(entity)

References array, entities_list, ENTITY, entity_name, free_align(), ifdebug, load_dynamic_hpf(), load_hpf_alignment(), MAP, new_synonym_array(), pips_debug, print_align(), and same_align_p().

Referenced by hpfc_translate_call_with_distributed_args(), one_align_directive(), and one_distribute_directive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ atomic_accesses_only_p()

bool atomic_accesses_only_p ( statement  )

◆ block_distributed_p()

bool block_distributed_p ( entity  array)

o-analysis.c

o-analysis.c

distributed && (nd==is_hpf_newdecl_none)) ? ??? the case is not handled later on

Parameters
arrayrray

Definition at line 44 of file o-analysis.c.

45 {
46  int dim = NumberOfDimension(array);
47  tag n;
48 
49  for(; dim>0; dim--)
50  {
51  n = new_declaration_tag(array, dim);
53  /* distributed && (nd==is_hpf_newdecl_none)) ?
54  * ??? the case is not handled later on
55  */
56  return(false);
57  }
58 
59  return(true);
60 }
@ is_hpf_newdecl_delta
Definition: hpf_private.h:669
@ is_hpf_newdecl_gamma
Definition: hpf_private.h:668
tag new_declaration_tag(entity array, int dim)
Definition: declarations.c:229
int tag
TAG.
Definition: newgen_types.h:92

References array, is_hpf_newdecl_delta, is_hpf_newdecl_gamma, new_declaration_tag(), and NumberOfDimension().

Referenced by message_manageable_p(), Overlap_Analysis(), and subarray_shift_assignment_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bound_dynamic_hpf_p()

bool bound_dynamic_hpf_p ( entity  )

Referenced by root_statement_remapping_inits(), safe_load_primary_entity(), and set_entity_as_dynamic().

+ Here is the caller graph for this function:

◆ bound_hpf_alignment_p()

bool bound_hpf_alignment_p ( entity  )

Referenced by one_align_directive(), and one_distribute_directive().

+ Here is the caller graph for this function:

◆ bound_hpf_distribution_p()

bool bound_hpf_distribution_p ( entity  )

◆ bound_hpf_number_p()

bool bound_hpf_number_p ( entity  )

Referenced by GiveToHpfObjectsTheirNumber().

+ Here is the caller graph for this function:

◆ bound_hpf_reductions_p()

bool bound_hpf_reductions_p ( statement  )

Referenced by handle_reduction_directive(), and hpf_compiler().

+ Here is the caller graph for this function:

◆ bound_maybeuseful_mappings_p()

bool bound_maybeuseful_mappings_p ( statement  )

◆ bound_new_host_p()

◆ bound_new_node_p()

◆ bound_old_host_p()

bool bound_old_host_p ( entity  )

Referenced by debug_host_node_variables().

+ Here is the caller graph for this function:

◆ bound_old_node_p()

bool bound_old_node_p ( entity  )

Referenced by debug_host_node_variables().

+ Here is the caller graph for this function:

◆ bound_overlap_status_p()

bool bound_overlap_status_p ( entity  )

Referenced by create_overlaps(), get_overlap(), and set_overlap().

+ Here is the caller graph for this function:

◆ bound_parameter_name()

string bound_parameter_name ( entity  array,
string  side,
int  dim 
)

returns a name for the bound of the declaration of array array, side side and dimension dim.

Parameters
arrayrray
sideide
dimim

Definition at line 488 of file run-time.c.

492 {
494  entity_local_name(array), " ",
495  side, int2a(dim), NULL));
496 }
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
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...
Definition: entity.c:453
const char * hpfc_main_entity_name(entity e)
returns the name of the entity e belongs too (common, function...)
Definition: run-time.c:479
char * strdup()
char * int2a(int)
util.c
Definition: util.c:42

References array, concatenate(), entity_local_name(), hpfc_main_entity_name(), int2a(), and strdup().

Referenced by argument_bound_entity(), create_parameters_h(), and hpfc_array_bound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bound_primary_entity_p()

bool bound_primary_entity_p ( entity  )

Referenced by same_primary_entity_p().

+ Here is the caller graph for this function:

◆ bound_renamings_p()

bool bound_renamings_p ( statement  )

Referenced by clean_statement(), and hpf_compiler().

+ Here is the caller graph for this function:

◆ bound_similar_mapping_p()

bool bound_similar_mapping_p ( entity  )

Referenced by check_for_similarity(), create_parameters_h(), and set_similar_mappings_for_updates().

+ Here is the caller graph for this function:

◆ call_reduction_p()

bool call_reduction_p ( call  c)

Definition at line 87 of file special_cases.c.

88 {
90 }
#define call_function(x)
Definition: ri.h:709
bool hpfc_entity_reduction_p(entity e)
bool call_reduction_p(c)
Definition: special_cases.c:82

References call_function, and hpfc_entity_reduction_p().

Referenced by compile_reduction(), and hpf_compile_call().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clean_the_system()

void clean_the_system ( Psysteme ps,
list plrm,
list pltry 
)
Parameters
pss
plrmlrm
pltryltry

Definition at line 360 of file io-compile.c.

364 {
366  remove_variables_if_possible(ps, pltry);
367 
369  base_rm(sc_base(*ps)), sc_creer_base(*ps);
370 }
void remove_variables_from_system(Psysteme *ps, list *plv)
Definition: io-compile.c:345
void remove_variables_if_possible(Psysteme *psyst, list *plvars)
Definition: io-compile.c:245
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
Definition: sc_alloc.c:129
void build_sc_nredund_2pass(Psysteme volatile *psc)
void build_sc_nredund_2pass Psysteme *psc;
#define base_rm(b)

References base_rm, build_sc_nredund_2pass(), remove_variables_from_system(), remove_variables_if_possible(), and sc_creer_base().

Referenced by clean_distributed_io_system(), and hpf_remapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ close_data_status()

void close_data_status ( void  )

Definition at line 339 of file declarations.c.

340 {
341  close_new_declaration();
345 }
void free_hpf_object_lists()
Definition: declarations.c:98
void close_hpf_distribution(void)
void close_hpf_alignment(void)

References close_hpf_alignment(), close_hpf_distribution(), and free_hpf_object_lists().

+ Here is the call graph for this function:

◆ close_dynamic_hpf()

void close_dynamic_hpf ( void  )

Referenced by close_dynamic_status().

+ Here is the caller graph for this function:

◆ close_dynamic_locals()

void close_dynamic_locals ( void  )

can't close it directly...

Definition at line 817 of file dynamic.c.

818 {
819  close_alive_synonym();
820  close_used_dynamics();
821  close_modified_dynamics();
822  close_reaching_mappings();
823  close_leaving_mappings();
824  close_remapped();
825 
826  /* can't close it directly...
827  */
828  CONTROLMAP_MAP(s, c,
829  {
830  what_stat_debug(9, s);
831 
835  },
836  get_remapping_graph());
837 
838  close_remapping_graph();
839 }
#define what_stat_debug(level, stat)
#define control_predecessors(x)
Definition: ri.h:943
#define CONTROLMAP_MAP(k, v, c, f)
Definition: ri.h:900
#define control_successors(x)
Definition: ri.h:945
#define control_statement(x)
Definition: ri.h:941
#define statement_undefined
Definition: ri.h:2419

References control_predecessors, control_statement, control_successors, CONTROLMAP_MAP, gen_free_list(), NIL, statement_undefined, and what_stat_debug.

Referenced by handle_hpf_directives().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ close_dynamic_status()

void close_dynamic_status ( void  )

Definition at line 117 of file dynamic.c.

118 {
121  close_renamings();
124 }
void close_dynamic_hpf(void)
void close_similar_mapping(void)
void close_primary_entity(void)
void close_maybeuseful_mappings(void)
void close_renamings(void)

References close_dynamic_hpf(), close_maybeuseful_mappings(), close_primary_entity(), close_renamings(), and close_similar_mapping().

+ Here is the call graph for this function:

◆ close_entity_status()

void close_entity_status ( void  )

Definition at line 118 of file host_node_entities.c.

119 {
120  close_new_host();
121  close_old_host();
122  close_new_node();
123  close_old_node();
124 }
void close_new_node(void)
void close_old_node(void)
void close_new_host(void)
void close_old_host(void)

References close_new_host(), close_new_node(), close_old_host(), and close_old_node().

+ Here is the call graph for this function:

◆ close_hpf_alignment()

void close_hpf_alignment ( void  )

Referenced by close_data_status().

+ Here is the caller graph for this function:

◆ close_hpf_distribution()

void close_hpf_distribution ( void  )

Referenced by close_data_status().

+ Here is the caller graph for this function:

◆ close_hpf_number()

void close_hpf_number ( void  )

Referenced by close_hpf_number_status().

+ Here is the caller graph for this function:

◆ close_hpf_number_status()

void close_hpf_number_status ( void  )

Definition at line 157 of file declarations.c.

158 {
160  init_currents();
161 }
static void init_currents()
Definition: declarations.c:116
void close_hpf_number(void)

References close_hpf_number(), and init_currents().

+ Here is the call graph for this function:

◆ close_hpf_reductions()

void close_hpf_reductions ( void  )

◆ close_maybeuseful_mappings()

void close_maybeuseful_mappings ( void  )

Referenced by close_dynamic_status().

+ Here is the caller graph for this function:

◆ close_new_host()

void close_new_host ( void  )

Referenced by close_entity_status().

+ Here is the caller graph for this function:

◆ close_new_node()

void close_new_node ( void  )

Referenced by close_entity_status().

+ Here is the caller graph for this function:

◆ close_old_host()

void close_old_host ( void  )

Referenced by close_entity_status().

+ Here is the caller graph for this function:

◆ close_old_node()

void close_old_node ( void  )

Referenced by close_entity_status().

+ Here is the caller graph for this function:

◆ close_overlap_status()

void close_overlap_status ( void  )

◆ close_primary_entity()

void close_primary_entity ( void  )

Referenced by close_dynamic_status().

+ Here is the caller graph for this function:

◆ close_renamings()

void close_renamings ( void  )

Referenced by close_dynamic_status().

+ Here is the caller graph for this function:

◆ close_similar_mapping()

void close_similar_mapping ( void  )

Referenced by close_dynamic_status().

+ Here is the caller graph for this function:

◆ close_the_dynamics()

void close_the_dynamics ( void  )

Referenced by handle_hpf_directives().

+ Here is the caller graph for this function:

◆ compile_a_pure_function()

void compile_a_pure_function ( entity  module)

simply copied for both host and node...

Parameters
moduleodule

Definition at line 493 of file compile.c.

494 {
495  string file_name, hn_name, dir_name, fs, ft;
496 
497  pips_debug(1, "compiling pure a function (%s)\n", entity_name(module));
498 
499  const char* prefix = module_local_name(module);
501  file_name = db_get_file_resource(DBR_SOURCE_FILE, prefix, true);
502  hn_name = src(prefix, BOTH_SUFFIX);
503 
504  fs = strdup(concatenate(dir_name, "/", file_name, NULL));
505  ft = strdup(concatenate(dir_name, "/", hn_name, NULL));
506  safe_copy(fs, ft);
507  free(fs), free(ft);
508 
509  DB_PUT_FILE_RESOURCE(DBR_HPFC_HOST, prefix, hn_name);
510  DB_PUT_FILE_RESOURCE(DBR_HPFC_NODE, prefix, strdup(hn_name));
511  DB_PUT_FILE_RESOURCE(DBR_HPFC_RTINIT, prefix, NO_FILE);
512  DB_PUT_FILE_RESOURCE(DBR_HPFC_PARAMETERS, prefix, NO_FILE);
513 }
void safe_copy(char *source, char *target)
Definition: file.c:706
#define DB_PUT_FILE_RESOURCE
Put a file resource into the current workspace database.
Definition: pipsdbm-local.h:85
#define NO_FILE
fake resources...
#define BOTH_SUFFIX
#define db_get_file_resource
string db_get_current_workspace_directory(void)
Definition: workspace.c:96
static const char * prefix
static string file_name

References BOTH_SUFFIX, concatenate(), db_get_current_workspace_directory(), db_get_file_resource, DB_PUT_FILE_RESOURCE, entity_name, file_name, free(), module, module_local_name(), NO_FILE, pips_debug, prefix, safe_copy(), src, and strdup().

Referenced by hpfc_compile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_a_special_io_function()

void compile_a_special_io_function ( entity  module)

just copied for the host

Parameters
moduleodule

Definition at line 469 of file compile.c.

470 {
471  string file_name, h_name, dir_name, fs, ft;
472 
473  const char *prefix = module_local_name(module);
474  file_name = db_get_file_resource(DBR_SOURCE_FILE, prefix, true);
476  h_name = src(prefix, HOST_SUFFIX);
477 
478  fs = strdup(concatenate(dir_name, "/", file_name, NULL));
479  ft = strdup(concatenate(dir_name, "/", h_name, NULL));
480  safe_copy(fs, ft);
481  free(fs);
482  free(ft);
483 
484  DB_PUT_FILE_RESOURCE(DBR_HPFC_HOST, prefix, h_name);
485  DB_PUT_FILE_RESOURCE(DBR_HPFC_NODE, prefix, NO_FILE);
486  DB_PUT_FILE_RESOURCE(DBR_HPFC_RTINIT, prefix, NO_FILE);
487  DB_PUT_FILE_RESOURCE(DBR_HPFC_PARAMETERS, prefix, NO_FILE);
488 }
#define HOST_SUFFIX
File suffixes.

References concatenate(), db_get_current_workspace_directory(), db_get_file_resource, DB_PUT_FILE_RESOURCE, file_name, free(), HOST_SUFFIX, module, module_local_name(), NO_FILE, prefix, safe_copy(), src, and strdup().

Referenced by hpfc_compile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_hpf_reduction()

list compile_hpf_reduction ( list  lr,
bool  prolog,
bool  host 
)

of statement

of statement

Parameters
lrr
prologrolog
hostost

Definition at line 347 of file special_cases.c.

351 {
352  list /* of statement */ ls = NIL;
353  MAP(HPFC_REDUCTIONS, r,
354  ls = CONS(STATEMENT, compile_one_reduction(r, prolog, host), ls),
355  lr);
356  return ls;
357 }
#define HPFC_REDUCTIONS(x)
HPFC_REDUCTIONS.
Definition: hpf_private.h:545
static statement compile_one_reduction(hpfc_reductions red, bool prolog, bool host)

References compile_one_reduction(), CONS, HPFC_REDUCTIONS, MAP, NIL, and STATEMENT.

Referenced by hpf_compiler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_reduction()

bool compile_reduction ( statement  initial,
statement phost,
statement pnode 
)

bool compile_reduction(initial, phost, pnode)

true is the compiler succeeded in compiling the reduction that way. ??? many conditions are not yet checked...

Parameters
initialnitial
phosthost
pnodenode

Definition at line 148 of file special_cases.c.

150 {
151  instruction i = statement_instruction(initial);
152  list args = NIL;
153  expression ref, cll;
154  call reduction;
155  t_reduction *red ;
156  basic b;
157  int dim = 0, arraynum = -1;
158  list largs = NIL;
159  entity array, hostfunction, nodefunction;
160 
161  pips_assert("assignment",
162  (instruction_call_p(i) &&
165 
166  args = call_arguments(instruction_call(i));
167  ref = EXPRESSION(CAR(args));
168  cll = EXPRESSION(CAR(CDR(args)));
169 
172 
174 
175  pips_debug(7, "call to %s\n", entity_name(call_function(reduction)));
176 
177  pips_assert("reduction call", call_reduction_p(reduction));
178 
179  reduction_parameters(reduction, &red, &b, &dim, &array, &largs);
180 
181  /*
182  * the array must be distributed accross the processors, not replicated,
183  * and the reference variable mustn't be distributed.
184  */
185 
186  if (!array_distributed_p(array) ||
189  return(false);
190 
191  arraynum = load_hpf_number(array);
192 
193  hostfunction = make_reduction_function("H", dim, red->kind, b, 0);
194  nodefunction = make_reduction_function("N", dim, red->kind, b, 4*dim+2);
195 
197  make_call_expression(hostfunction, NIL));
198  *pnode =
200  ( copy_expression(ref),
202  (nodefunction,
204  CONS(EXPRESSION, int_to_expression(arraynum),
206  largs)))));
207 
208  return(true);
209 }
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
statement make_assign_statement(expression, expression)
Definition: statement.c:583
list array_lower_upper_bounds_list(entity)
of expressions
Definition: run-time.c:539
intptr_t load_hpf_number(entity)
struct _newgen_struct_reduction_ * reduction
#define ENTITY_ASSIGN_P(e)
expression make_call_expression(entity e, list l)
Build an expression that call an function entity with an argument list.
Definition: expression.c:321
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
#define syntax_reference_p(x)
Definition: ri.h:2728
#define syntax_call_p(x)
Definition: ri.h:2734
#define syntax_call(x)
Definition: ri.h:2736
#define instruction_call_p(x)
Definition: ri.h:1527
#define statement_instruction(x)
Definition: ri.h:2458
#define instruction_call(x)
Definition: ri.h:1529
#define call_arguments(x)
Definition: ri.h:711
#define expression_syntax(x)
Definition: ri.h:1247
bool call_reduction_p(call c)
Definition: special_cases.c:87
static void reduction_parameters(call c, t_reduction **pred, basic *pb, int *pdim, entity *pe, list *pl)
Definition: special_cases.c:97
static entity make_reduction_function(string prefix, int ndim, int kind, basic base, int nargs)
find or create an entity for the reduction function...

References array, array_distributed_p(), array_lower_upper_bounds_list(), call_arguments, call_function, call_reduction_p(), CAR, CDR, CONS, copy_expression(), ENTITY_ASSIGN_P, entity_name, entity_to_expression(), EXPRESSION, expression_syntax, gen_length(), gen_nconc(), instruction_call, instruction_call_p, int_to_expression(), t_reduction::kind, load_hpf_number(), make_assign_statement(), make_call_expression(), make_reduction_function(), NIL, pips_assert, pips_debug, reduction_parameters(), ref, reference_variable, statement_instruction, syntax_call, syntax_call_p, syntax_reference, and syntax_reference_p.

Referenced by hpf_compile_call().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ complementary_range()

range complementary_range ( entity  array,
int  dim,
range  r 
)

range complementary_range(array, dim, r)

just to avoid a gcc warning

Parameters
arrayrray
dimim

Definition at line 141 of file message-utils.c.

145 {
146  entity newarray = load_new_node(array);
147  dimension d = FindIthDimension(newarray, dim);
148  int rlo = HpfcExpressionToInt(range_lower(r)),
153 
154  assert(rin==1);
155 
156  if (dup==rup)
157  return(make_range(int_to_expression(dlo),
158  int_to_expression(rlo-1),
159  int_to_expression(1)));
160 
161  if (dlo==rlo)
162  return(make_range(int_to_expression(rup+1),
163  int_to_expression(dup),
164  int_to_expression(1)));
165 
166  pips_internal_error("well, there is a problem here around");
167 
168  return(range_undefined); /* just to avoid a gcc warning */
169 }
#define range_undefined
Definition: ri.h:2263

References array, assert, dimension_lower, dimension_upper, FindIthDimension(), HpfcExpressionToInt(), int_to_expression(), load_new_node(), make_range(), pips_internal_error, range_increment, range_lower, range_undefined, and range_upper.

Referenced by atomize_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compute_entity_to_declaration_constraints()

Psysteme compute_entity_to_declaration_constraints ( entity  ent,
string  suffix,
string  prefix 
)

Psysteme compute_entity_to_constraints(ent, suffix, prefix) entity ent: variable the constraints of which are computed strings suffix and prefix: to be used in the dummy variables created.


DECLARATION CONSTRAINTS GENERATION

computes the constraints due to the declarations. ! usefull

system may be empty for scalars ???

now the dummy is to be used to generate two inequalities: -dummy + lower <= 0 and dummy - upper <= 0

Parameters
entnt
suffixuffix
prefixrefix

Definition at line 220 of file build-system.c.

223 {
225  int dim_number = 1;
226  Psysteme new_system = sc_new();
227 
228  pips_assert("variable", entity_variable_p(ent));
229 
230  /* system may be empty for scalars ???
231  */
232  pips_debug(5, "entity %s, [%s,%s]\n", entity_name(ent), prefix, suffix);
233 
234  MAP(DIMENSION, dim,
235  {
236  entity dummy = get_ith_dummy(prefix, suffix, dim_number);
237  int ilower;
238  int iupper;
240  (dimension_lower(dim), &ilower);
242  (dimension_upper(dim), &iupper);
243 
244  pips_assert("extent known", blower && bupper);
245 
246  /* now the dummy is to be used to generate two inequalities:
247  * -dummy + lower <= 0 and dummy - upper <= 0
248  */
250  (new_system,
252  dummy, VALUE_MONE,
253  TCST, int_to_value(ilower))));
255  (new_system,
257  dummy, VALUE_ONE,
258  TCST, int_to_value(-iupper))));
259  dim_number++;
260  },
261  dims);
262 
263  sc_creer_base(new_system);
264  return new_system;
265 }
#define VALUE_MONE
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Definition: alloc.c:73
int dummy
A dummy file, to prevent empty libraries from breaking builds.
Definition: dummy.c:41
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
entity get_ith_dummy(string, string, int)
Returns a numbered entity the name of which is suffix + number, the module of which is prefix.
Definition: variable.c:1711
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
Definition: sc_alloc.c:55
void sc_add_inegalite(Psysteme p, Pcontrainte i)
void sc_add_inegalite(Psysteme p, Pcontrainte i): macro ajoutant une inegalite i a un systeme p; la b...
Definition: sc_alloc.c:406

References contrainte_make(), DIMENSION, dimension_lower, dimension_upper, entity_name, entity_type, entity_variable_p, get_ith_dummy(), hpfc_integer_constant_expression_p(), int_to_value, MAP, pips_assert, pips_debug, prefix, sc_add_inegalite(), sc_creer_base(), sc_new(), TCST, type_variable, VALUE_MONE, VALUE_ONE, variable_dimensions, vect_make(), and VECTEUR_NUL.

Referenced by hpfc_compute_entity_to_declaration_constraints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compute_receive_content()

list compute_receive_content ( entity  array,
list  lr,
Pvecteur  v 
)

shared!

Parameters
arrayrray
lrr

Definition at line 268 of file message-utils.c.

272 {
273  list content = NIL, l = lr;
274  int i = 1;
275 
277 
278  for (; l; i++, POP(l))
279  {
280  int procdim = 0;
281  bool distributed_dim = ith_dim_distributed_p(array, i, &procdim);
282  Value vn = distributed_dim?
283  vect_coeff((Variable) (intptr_t)procdim, v): VALUE_ZERO;
284  int neighbour = VALUE_TO_INT(vn);
285  range r = RANGE(CAR(l));
286 
287  if (neighbour!=0)
288  {
289  entity newarray = load_new_node(array);
290  dimension nadim = FindIthDimension(newarray, i);
291  expression incr = range_increment(r);
292  int lom1 = HpfcExpressionToInt(dimension_lower(nadim))-1,
293  upp1 = HpfcExpressionToInt(dimension_upper(nadim))+1,
294  width = (HpfcExpressionToInt(range_upper(r)) -
296 
297  content =
298  gen_nconc(content,
299  CONS(RANGE,
300  (neighbour<0)?
302  int_to_expression(upp1+width),
303  incr):
304  make_range(int_to_expression(lom1-width),
305  int_to_expression(lom1),
306  incr),
307  NIL));
308  }
309  else
310  {
311  content = gen_nconc(content, CONS(RANGE, r, NIL)); /* shared! */
312  }
313  }
314 
315  return(content);
316 }
#define VALUE_ZERO

References array, assert, CAR, CONS, dimension_lower, dimension_upper, FindIthDimension(), gen_length(), gen_nconc(), HpfcExpressionToInt(), int_to_expression(), intptr_t, ith_dim_distributed_p(), load_new_node(), make_range(), NIL, NumberOfDimension(), POP, RANGE, range_increment, range_lower, range_upper, VALUE_TO_INT, VALUE_ZERO, and vect_coeff().

Referenced by one_receive_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compute_receive_domain()

list compute_receive_domain ( list  lr,
Pvecteur  v 
)

shared!

Parameters
lrr

Definition at line 318 of file message-utils.c.

321 {
322  list l = lr, domain = NIL;
323  int i = 1;
324 
325  for ( ; l!=NIL ; i++, l=CDR(l))
326  {
327  range r = RANGE(CAR(l));
328  Value vn = vect_coeff((Variable) (intptr_t)i, v);
329  int neighbour = VALUE_TO_INT(vn);
330 
331  if (neighbour==0)
332  domain = gen_nconc(domain, CONS(RANGE, r, NIL)); /* shared! */
333  else
334  {
335  int lo = HpfcExpressionToInt(range_lower(r)),
337 
338  domain =
339  gen_nconc(domain,
340  CONS(RANGE,
341  make_range(int_to_expression(lo+neighbour),
342  int_to_expression(up+neighbour),
343  range_increment(r)),
344  NIL));
345  }
346  }
347 
348  return(domain);
349 }
A DOMAIN union describes the structure of a user type.

References CAR, CDR, CONS, gen_nconc(), HpfcExpressionToInt(), int_to_expression(), intptr_t, make_range(), NIL, RANGE, range_increment, range_lower, range_upper, VALUE_TO_INT, and vect_coeff().

Referenced by one_receive_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conformant_templates_p()

bool conformant_templates_p ( entity  t1,
entity  t2 
)
Parameters
t11
t22

Definition at line 405 of file dynamic.c.

408 {
409  if (t1==t2)
410  return true;
411  else if (!conformant_entities_p(t1, t2))
412  return false;
413  else
414  return same_distribute_p
416 }
static bool same_distribute_p(distribute d1, distribute d2)
comparison of DISTRIBUTE.
Definition: dynamic.c:353

References conformant_entities_p(), load_hpf_distribution(), and same_distribute_p().

Referenced by align_check(), and same_align_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_common_parameters_h()

void create_common_parameters_h ( FILE *  file)

inits.c

inits.c

in this file there are functions to generate the run-time resolution parameters.

Parameters
fileile

Definition at line 36 of file inits.c.

38 {
39  fprintf(file,
40  " integer\n"
41  " $ REALNBOFARRAYS,\n"
42  " $ REALNBOFTEMPLATES,\n"
43  " $ REALNBOFPROCESSORS,\n"
44  " $ REALMAXSIZEOFPROCS,\n"
45  " $ REALMAXSIZEOFBUFFER\n\n"
46  "!\n! parameters\n!\n"
47  " parameter(REALNBOFARRAYS = %d)\n"
48  " parameter(REALNBOFTEMPLATES = %d)\n"
49  " parameter(REALNBOFPROCESSORS = %d)\n"
50  " parameter(REALMAXSIZEOFPROCS = %d)\n"
51  " parameter(REALMAXSIZEOFBUFFER = %d)\n",
56  get_int_property("HPFC_BUFFER_SIZE"));
57 }
int get_int_property(const string)
int number_of_templates(void)
int number_of_processors(void)
int number_of_distributed_arrays(void)
declarations.c
int max_size_of_processors()
Definition: inits.c:120

References fprintf(), get_int_property(), max_size_of_processors(), number_of_distributed_arrays(), number_of_processors(), and number_of_templates().

Referenced by put_generated_resources_for_program().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_init_common_param()

void create_init_common_param ( FILE *  file)

create_init_common_param (templates and modules)

Parameters
fileile

Definition at line 511 of file inits.c.

513 {
516 }
void create_init_common_param_for_processors(FILE *file)
Definition: inits.c:470
void create_init_common_param_for_templates(FILE *file)
Definition: inits.c:391

References create_init_common_param_for_processors(), and create_init_common_param_for_templates().

Referenced by put_generated_resources_for_program().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_init_common_param_for_arrays()

void create_init_common_param_for_arrays ( FILE *  file,
entity  module 
)

NODIMA: Number Of DIMensions of an Array ATOT: Array TO Template

The primary entity is the initial mapping ??? not sure... some decision should be involved...

RANGEA: lower, upper, size and declaration, aso

RANGEA contents:

1: lower bound 2: upper bound 3: size, (2)-(1)+1 4: new declaration flag

5: distribution parameter n, 6: alignment rate a, 7: alignment shift, b-t_{m}

5: distribution parameter n, 6: cycle length n*p, 7: initial cycle number, 8: alignment shift, b-t_{m}

5: distribution parameter n 6: cycle length n*p, 7: initial cycle number, 8: alignment shift, b-t_{m} 9: alignment rate a, 10: chunck size ceil(n,|a|)

ALIGN

Parameters
fileile
moduleodule

Definition at line 158 of file inits.c.

161 {
163 
164  fprintf(file, "!\n! Arrays Initializations for %s\n!\n",
166 
167  MAP(ENTITY, array,
168  {
169  int an = load_hpf_number(array);
170  int nd = NumberOfDimension(array);
172  entity template = align_template(al);
173  int tn = load_hpf_number(template);
174  distribute di = load_hpf_distribution(template);
175  int i;
176 
177  /* NODIMA: Number Of DIMensions of an Array
178  * ATOT: Array TO Template
179  */
180  fprintf(file,
181  "!\n! initializing array %s, number %d\n!\n"
182  " NODIMA(%d) = %d\n"
183  " ATOT(%d) = %d\n",
184  entity_local_name(array), an, an, nd, an, tn);
185 
187  {
188  /* The primary entity is the initial mapping ???
189  * not sure... some decision should be involved...
190  */
191  fprintf(file, "\n"
192  " MSTATUS(%d) = %d\n"
193  " LIVEMAPPING(%d) = .TRUE.\n", an, an, an);
194  }
195 
196  /* RANGEA: lower, upper, size and declaration, aso
197  */
198  i = 1;
199  for (i=1; i<=nd; i++)
200  {
204  int sz = (ub-lb+1);
205  tag decl = new_declaration_tag(array, i);
207 
208  /* RANGEA contents:
209  *
210  * 1: lower bound
211  * 2: upper bound
212  * 3: size, (2)-(1)+1
213  * 4: new declaration flag
214  */
215  fprintf(file, "\n"
216  " RANGEA(%d, %d, 1) = %d\n"
217  " RANGEA(%d, %d, 2) = %d\n"
218  " RANGEA(%d, %d, 3) = %d\n!\n"
219  " RANGEA(%d, %d, 4) = %d\n",
220  an, i, lb, an, i, ub, an, i, sz,
221  an, i, code_number(decl));
222 
223  switch(decl)
224  {
225  case is_hpf_newdecl_none:
226  break;
228  /*
229  * 5: 1 - lower bound
230  */
231  fprintf(file, " RANGEA(%d, %d, 5) = %d\n",
232  an, i, (1-lb));
233  break;
234  case is_hpf_newdecl_beta:
235  {
236  int tdim = alignment_templatedim(a);
237  int procdim = 0;
240  tdim,
241  &procdim);
243  int rate;
244  int shift;
245  dimension
246  dim = FindIthDimension(template, tdim);
247 
248  pips_assert("block distribution",
250 
254 
255  /* 5: distribution parameter n,
256  * 6: alignment rate a,
257  * 7: alignment shift, b-t_{m}
258  */
259  fprintf(file,
260  " RANGEA(%d, %d, 5) = %d\n"
261  " RANGEA(%d, %d, 6) = %d\n"
262  " RANGEA(%d, %d, 7) = %d\n",
263  an, i, param, an, i, rate, an, i, shift);
264 
265  break;
266  }
268  {
269  int tdim = alignment_templatedim(a);
270  int procdim = 0;
273  tdim,
274  &procdim);
276  int sc;
277  int no;
278  int shift;
279  dimension
280  dim = FindIthDimension(template, tdim);
281  entity
282  proc = distribute_processors(di);
283 
284  pips_assert("cyclic distribution",
286 
287  sc = param*SizeOfIthDimension(proc, procdim);
290  no = (lb + shift) / sc ;
291 
292  /* 5: distribution parameter n,
293  * 6: cycle length n*p,
294  * 7: initial cycle number,
295  * 8: alignment shift, b-t_{m}
296  */
297  fprintf(file,
298  " RANGEA(%d, %d, 5) = %d\n"
299  " RANGEA(%d, %d, 6) = %d\n"
300  " RANGEA(%d, %d, 7) = %d\n"
301  " RANGEA(%d, %d, 8) = %d\n",
302  an, i, param, an, i, sc, an, i, no, an, i, shift);
303 
304  break;
305  }
307  {
308  int tdim = alignment_templatedim(a);
309  int procdim = 0;
312  tdim,
313  &procdim);
314  int rate = HpfcExpressionToInt(alignment_rate(a));
317  int sc;
318  int no;
319  int shift;
320  int chck;
321  dimension
322  templdim = FindIthDimension(template, tdim);
323  entity
324  proc = distribute_processors(di);
325 
326  pips_assert("cyclic distribution",
328 
329  sc = param*SizeOfIthDimension(proc, procdim);
330  shift = (cst - HpfcExpressionToInt(dimension_lower(templdim)));
331  no = (rate*lb + shift) / sc ;
332  chck = iceil(param, abs(rate));
333 
334  /* 5: distribution parameter n
335  * 6: cycle length n*p,
336  * 7: initial cycle number,
337  * 8: alignment shift, b-t_{m}
338  * 9: alignment rate a,
339  * 10: chunck size ceil(n,|a|)
340  */
341  fprintf(file,
342  " RANGEA(%d, %d, 5) = %d\n"
343  " RANGEA(%d, %d, 6) = %d\n"
344  " RANGEA(%d, %d, 7) = %d\n"
345  " RANGEA(%d, %d, 8) = %d\n"
346  " RANGEA(%d, %d, 9) = %d\n"
347  " RANGEA(%d, %d, 10) = %d\n",
348  an, i, param, an, i, sc, an, i, no,
349  an, i, shift, an, i, rate, an, i, chck);
350  break;
351  }
352  default:
353  pips_internal_error("unexpected decl. tag (%d)", decl);
354  }
355  }
356 
357  fprintf(file, "\n");
358 
359  /* ALIGN
360  */
361 
362  for(i=1 ; i<=NumberOfDimension(template) ; i++)
363  {
364  alignment
366 
367  if (a==alignment_undefined)
368  {
369  fprintf(file, " ALIGN(%d, %d, 1) = INTFLAG\n", an, i);
370  }
371  else
372  {
373  int adim = alignment_arraydim(a);
374 
375  fprintf(file,
376  " ALIGN(%d, %d, 1) = %d\n"
377  " ALIGN(%d, %d, 2) = %d\n"
378  " ALIGN(%d, %d, 3) = %d\n",
379  an, i, adim, an, i,
380  adim ? HpfcExpressionToInt(alignment_rate(a)) : 0,
382 
383  }
384  }
385  },
386  l);
387 
388  gen_free_list(l);
389 }
bool(* dynamic_entity_p)(entity)
as expected, true if entity e is dynamic.
Definition: dynamic.c:145
#define distribution_style(x)
Definition: hpf.h:210
#define distribution_parameter(x)
Definition: hpf.h:212
#define style_block_p(x)
Definition: hpf.h:262
#define style_cyclic_p(x)
Definition: hpf.h:265
@ is_hpf_newdecl_none
Definition: hpf_private.h:665
@ is_hpf_newdecl_alpha
Definition: hpf_private.h:666
@ is_hpf_newdecl_beta
Definition: hpf_private.h:667
alignment FindAlignmentOfDim(list lal, int dim)
Definition: hpfc-util.c:377
distribution FindDistributionOfDim(list ldi, int dim, int *pdim)
Definition: hpfc-util.c:401
list list_of_distributed_arrays_for_module(entity module)
returns the list of entities that are 'local' to module
Definition: declarations.c:72
#define iceil(a, b)
integer ceiling function
static int code_number(tag t)
translation from an hpf_newdecl tag to the runtime code expected
Definition: inits.c:141
dimension entity_ith_dimension(entity, int)
Another semantics would be: is this reference r to e a kill for e? In general, this cannot be answere...
Definition: variable.c:1228
Definition: replace.c:135
#define abs(v)
Definition: syntax-local.h:48

References abs, align_alignment, align_template, alignment_arraydim, alignment_constant, alignment_rate, alignment_templatedim, alignment_undefined, array, code_number(), dimension_lower, dimension_upper, distribute_distribution, distribute_processors, distribution_parameter, distribution_style, dynamic_entity_p, ENTITY, entity_ith_dimension(), entity_local_name(), FindAlignmentOfDim(), FindAlignmentOfTemplateDim(), FindDistributionOfDim(), FindIthDimension(), fprintf(), gen_free_list(), HpfcExpressionToInt(), iceil, is_hpf_newdecl_alpha, is_hpf_newdecl_beta, is_hpf_newdecl_delta, is_hpf_newdecl_gamma, is_hpf_newdecl_none, list_of_distributed_arrays_for_module(), load_hpf_alignment(), load_hpf_distribution(), load_hpf_number(), load_primary_entity(), MAP, module, module_local_name(), new_declaration_tag(), NumberOfDimension(), pips_assert, pips_internal_error, SizeOfIthDimension(), style_block_p, and style_cyclic_p.

Referenced by put_generated_resources_for_common(), and put_generated_resources_for_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_init_common_param_for_processors()

void create_init_common_param_for_processors ( FILE *  file)

NODIMP: Number Of DIMensions of a Processors arrangement

RANGEP: lower, upper, size

Parameters
fileile

Definition at line 470 of file inits.c.

472 {
473  fprintf(file, "!\n! Processors Initializations\n!\n");
474 
475  MAP(ENTITY, proc,
476  {
477  int pn = load_hpf_number(proc);
478  int nd = NumberOfDimension(proc);
479  int procdim = 1;
480 
481  fprintf(file, "!\n! initializing processors %s, number %d\n!\n",
482  entity_local_name(proc), pn);
483 
484  /* NODIMP: Number Of DIMensions of a Processors arrangement
485  */
486  fprintf(file, " NODIMP(%d) = %d\n", pn, nd);
487 
488  /* RANGEP: lower, upper, size
489  */
490  MAP(DIMENSION, d,
491  {
494  int sz = (ub-lb+1);
495 
496  fprintf(file, "\n"
497  " RANGEP(%d, %d, 1) = %d\n"
498  " RANGEP(%d, %d, 2) = %d\n"
499  " RANGEP(%d, %d, 3) = %d\n",
500  pn, procdim, lb, pn, procdim, ub, pn, procdim, sz);
501 
502  procdim++;
503  },
505  },
507 }
list list_of_processors(void)

References DIMENSION, dimension_lower, dimension_upper, ENTITY, entity_local_name(), entity_type, fprintf(), HpfcExpressionToInt(), list_of_processors(), load_hpf_number(), MAP, NumberOfDimension(), type_variable, and variable_dimensions.

Referenced by create_init_common_param().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_init_common_param_for_templates()

void create_init_common_param_for_templates ( FILE *  file)

NODIMT: Number Of DIMensions of a Template TTOP: Template TO Processors arrangement

RANGET: lower, upper, size

DIST

Parameters
fileile

Definition at line 391 of file inits.c.

393 {
394  fprintf(file, "!\n! Templates Initializations\n!\n");
395 
396  MAP(ENTITY, template,
397  {
398  int tn = load_hpf_number(template);
399  int nd = NumberOfDimension(template);
400  distribute di = load_hpf_distribution(template);
401  entity proc = distribute_processors(di);
402  int pn = load_hpf_number(proc);
403  int procdim = 1;
404  int tempdim = 1;
405 
406  /* NODIMT: Number Of DIMensions of a Template
407  * TTOP: Template TO Processors arrangement
408  */
409  fprintf(file,
410  "!\n! initializing template %s, number %d\n!\n"
411  " NODIMT(%d) = %d\n"
412  " TTOP(%d) = %d\n",
413  entity_local_name(template), tn, tn, nd, tn, pn);
414 
415  /* RANGET: lower, upper, size
416  */
417  MAP(DIMENSION, d,
418  {
421  int sz = (ub-lb+1);
422 
423  fprintf(file, "\n"
424  " RANGET(%d, %d, 1) = %d\n"
425  " RANGET(%d, %d, 2) = %d\n"
426  " RANGET(%d, %d, 3) = %d\n",
427  tn, tempdim, lb, tn, tempdim, ub, tn, tempdim, sz);
428 
429  tempdim++;
430  },
432 
433  /* DIST
434  */
435  tempdim = 1;
436  fprintf(file, "\n");
437  MAP(DISTRIBUTION, d,
438  {
439  int param;
440  bool block_case = false;
441 
442  switch(style_tag(distribution_style(d)))
443  {
444  case is_style_none:
445  break;
446  case is_style_block:
447  block_case = true;
449  case is_style_cyclic:
451  if (!block_case) param = -param;
452  fprintf(file,
453  " DIST(%d, %d, 1) = %d\n"
454  " DIST(%d, %d, 2) = %d\n",
455  tn, procdim, tempdim, tn, procdim, param);
456  procdim++;
457  break;
458  default:
459  pips_internal_error("unexpected style tag");
460  break;
461  }
462 
463  tempdim++;
464  },
466  },
468 }
#define DISTRIBUTION(x)
DISTRIBUTION.
Definition: hpf.h:180
#define style_tag(x)
Definition: hpf.h:258
@ is_style_cyclic
Definition: hpf.h:239
@ is_style_block
Definition: hpf.h:238
@ is_style_none
Definition: hpf.h:237
list list_of_templates(void)
#define _FALLTHROUGH_
Definition: misc-local.h:238

References _FALLTHROUGH_, DIMENSION, dimension_lower, dimension_upper, distribute_distribution, distribute_processors, DISTRIBUTION, distribution_parameter, distribution_style, ENTITY, entity_local_name(), entity_type, fprintf(), HpfcExpressionToInt(), is_style_block, is_style_cyclic, is_style_none, list_of_templates(), load_hpf_distribution(), load_hpf_number(), MAP, NumberOfDimension(), pips_internal_error, style_tag, type_variable, and variable_dimensions.

Referenced by create_init_common_param().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_parameters_h()

void create_parameters_h ( FILE *  file,
entity  module 
)

create_parameters_h

to be called after the declaration_with_overlaps() call. it generates the parameters for module.

formal parameters are passed the value by the caller as far as overlapable dimensions are concerned.

otherwise it is a secondary copy

Parameters
fileile
moduleodule

Definition at line 65 of file inits.c.

68 {
69  entity newarray = entity_undefined;
70  int i;
72 
73  fprintf(file, "!\n! parameters generated for %s\n!\n",
75 
76  MAP(ENTITY, array,
77  {
78  bool is_argument = storage_formal_p(entity_storage(array));
79  int andim;
80  newarray = load_new_node(array);
81  andim = NumberOfDimension(newarray);
82 
83  pips_debug(8, "considering array %s (new is %s)\n",
84  entity_name(array), entity_name(newarray));
85 
86  /* formal parameters are passed the value by the caller
87  * as far as overlapable dimensions are concerned.
88  */
92  for (i=1 ; i<=andim ; i++)
93  {
94  if (!is_argument || !ith_dim_overlapable_p(array, i))
95  {
96  string ld = bound_parameter_name(newarray, LOWER, i);
97  string ud = bound_parameter_name(newarray, UPPER, i);
98  dimension d = FindIthDimension(newarray, i);
99 
100  fprintf(file,
101  " integer \n"
102  " $ %s,\n"
103  " $ %s\n"
104  " parameter(%s = %d)\n"
105  " parameter(%s = %d)\n",
106  ld, ud,
109 
110  free(ld); free(ud);
111  }
112  }
113  /* otherwise it is a secondary copy */
114  },
115  l);
116 
117  gen_free_list(l);
118 }
static bool ud(effect fin, effect fout)
UD detects Use/Def conflicts between effects FIN and FOUT.
Definition: chains.c:1038
bool ith_dim_overlapable_p(entity array, int i)
Definition: hpfc-util.c:178
entity load_similar_mapping(entity)
string bound_parameter_name(entity, string, int)
returns a name for the bound of the declaration of array array, side side and dimension dim.
Definition: run-time.c:488
bool bound_similar_mapping_p(entity)
#define storage_formal_p(x)
Definition: ri.h:2522
#define entity_storage(x)
Definition: ri.h:2794

References array, bound_parameter_name(), bound_similar_mapping_p(), dimension_lower, dimension_upper, dynamic_entity_p, ENTITY, entity_name, entity_storage, entity_undefined, FindIthDimension(), fprintf(), free(), gen_free_list(), HpfcExpressionToInt(), ith_dim_overlapable_p(), list_of_distributed_arrays_for_module(), load_new_node(), load_similar_mapping(), LOWER, MAP, module, module_local_name(), NumberOfDimension(), pips_debug, storage_formal_p, ud(), and UPPER.

Referenced by put_generated_resources_for_common(), and put_generated_resources_for_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ debug_host_node_variables()

void debug_host_node_variables ( entity  e)

HPFC module by Fabien COELHO.

HOST AND NODE ENTITIES MANAGEMENT

Definition at line 44 of file host_node_entities.c.

45 {
46  fprintf(stderr, "variable %s:\n\tnh=%s\n\toh=%s\n\tnn=%s\n\ton=%s\n",
47  entity_name(e),
48  bound_new_host_p(e)? entity_name(load_new_host(e)): "<undef>",
49  bound_old_host_p(e)? entity_name(load_old_host(e)): "<undef>",
50  bound_new_node_p(e)? entity_name(load_new_node(e)): "<undef>",
51  bound_old_node_p(e)? entity_name(load_old_node(e)): "<undef>");
52 }
bool bound_old_node_p(entity)
entity load_old_node(entity)
bool bound_old_host_p(entity)
entity load_old_host(entity)

References bound_new_host_p(), bound_new_node_p(), bound_old_host_p(), bound_old_node_p(), entity_name, fprintf(), load_new_host(), load_new_node(), load_old_host(), and load_old_node().

+ Here is the call graph for this function:

◆ debug_print_referenced_entities()

void debug_print_referenced_entities ( void *  obj)
Parameters
objbj

Definition at line 906 of file compile.c.

907 {
909 }
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
Definition: genClib.c:3428
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
Definition: genClib.c:2780
static void debug_ref_rwt(reference r)
Definition: compile.c:897
#define reference_domain
newgen_range_domain_defined
Definition: ri.h:338

References debug_ref_rwt(), gen_multi_recurse(), gen_true(), and reference_domain.

Referenced by update_common_references_in_obj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ declaration_delayed_p()

bool declaration_delayed_p ( entity  )

◆ declaration_with_overlaps_for_module()

void declaration_with_overlaps_for_module ( entity  module)
Parameters
moduleodule

Definition at line 835 of file declarations.c.

836 {
839  gen_free_list(l);
840 }
static void declaration_with_overlaps(list l)
Definition: declarations.c:780

References deal_with_similars(), declaration_with_overlaps(), gen_free_list(), list_of_distributed_arrays_for_module(), and module.

Referenced by compile_common(), and compile_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ define_node_processor_id()

statement define_node_processor_id ( entity  proc,
entity(*)(int creation 
)

generate-util.c

generate-util.c

of expression

of statement

Parameters
procroc

Definition at line 49 of file generate-util.c.

52 {
53  int i, procn = load_hpf_number(proc);
54  list /* of expression */ mypos_indices,
55  /* of statement */ ls = NIL;
56  reference mypos;
57  entity dummy;
58 
59  for(i=NumberOfDimension(proc); i>0; i--)
60  {
61  dummy = creation(i);
62  mypos_indices = CONS(EXPRESSION, int_to_expression(i),
64  NIL));
65  mypos = make_reference(hpfc_name_to_entity(MYPOS), mypos_indices);
66  ls = CONS(STATEMENT,
69  ls);
70  }
71 
72  return make_block_statement(ls);
73 }
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
#define MYPOS
entity hpfc_name_to_entity(const char *)
Definition: run-time.c:817
expression reference_to_expression(reference r)
Definition: expression.c:196

References CONS, entity_to_expression(), EXPRESSION, hpfc_name_to_entity(), int_to_expression(), load_hpf_number(), make_assign_statement(), make_block_statement(), make_reference(), MYPOS, NIL, NumberOfDimension(), reference_to_expression(), and STATEMENT.

Referenced by GENERATION(), and processor_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete_dynamic_hpf()

entities delete_dynamic_hpf ( entity  )

◆ delete_entity_update_common()

void delete_entity_update_common ( entity  )

◆ delete_hpf_alignment()

align delete_hpf_alignment ( entity  )

◆ delete_hpf_distribution()

distribute delete_hpf_distribution ( entity  )

◆ delete_hpf_number()

intptr_t delete_hpf_number ( entity  )

◆ delete_hpf_reductions()

entities delete_hpf_reductions ( statement  )

◆ delete_maybeuseful_mappings()

entities delete_maybeuseful_mappings ( statement  )

◆ delete_new_host()

entity delete_new_host ( entity  )

◆ delete_new_node()

entity delete_new_node ( entity  )

◆ delete_old_host()

entity delete_old_host ( entity  )

◆ delete_old_node()

entity delete_old_node ( entity  )

◆ delete_overlap_status()

list delete_overlap_status ( entity  )

◆ delete_primary_entity()

entity delete_primary_entity ( entity  )

◆ delete_renamings()

list delete_renamings ( statement  )

◆ delete_similar_mapping()

entity delete_similar_mapping ( entity  )

◆ delete_statement_only_io()

void delete_statement_only_io ( statement  )

◆ DistArraysEffects()

list DistArraysEffects ( expression  expr)

effects' action in an expression are here supposed to be read one's but that may not be correct?

Parameters
exprxpr

Definition at line 241 of file hpfc-util.c.

243 {
244  list le = proper_effects_of_expression(expr), lde = NIL;
245 
246  FOREACH(EFFECT, e, le) {
247  if(store_effect_p(e)) {
249  lde=CONS(EFFECT,e,lde);
250  }
251  }
252 
253  gen_free_list(le);
254  return(lde);
255 }
list proper_effects_of_expression(expression)
#define effect_variable(e)
For COMPATIBILITY purpose only - DO NOT USE anymore.
bool store_effect_p(effect)
Definition: effects.c:1062
#define EFFECT(x)
EFFECT.
Definition: effects.h:608
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179

References array_distributed_p(), CONS, EFFECT, effect_variable, FOREACH, gen_free_list(), NIL, proper_effects_of_expression(), and store_effect_p().

Referenced by written_effects_to_dist_arrays_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DistributionParameterOfArrayDim()

int DistributionParameterOfArrayDim ( entity  array,
int  dim,
int pprocdim 
)
Parameters
arrayrray
dimim
pprocdimprocdim

Definition at line 472 of file hpfc-util.c.

476 {
477  entity template = array_to_template(array);
478  distribute d = load_hpf_distribution(template);
483  pprocdim);
484 
486 }
#define array_to_template(array)

References alignment_templatedim, array, array_to_template, distribute_distribution, distribution_parameter, FindArrayDimAlignmentOfArray, FindDistributionOfDim(), HpfcExpressionToInt(), and load_hpf_distribution().

Referenced by generate_one_message(), message_manageable_p(), shape_one_message(), and template_cell_local_mapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_current_remapping_graph()

void dump_current_remapping_graph ( string  when)
Parameters
whenhen

Definition at line 1440 of file dynamic.c.

1441 {
1443 }
static void dump_remapping_graph(string when, list ls)
Definition: dynamic.c:1431
static list list_of_remapping_statements()
of statements
Definition: dynamic.c:1383

References dump_remapping_graph(), and list_of_remapping_statements().

Referenced by handle_hpf_directives().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dup_list_of_Pvecteur()

list dup_list_of_Pvecteur ( list  l)

??? the complexity of this function could be improved greatly...

Definition at line 93 of file message-utils.c.

95 {
96  list result = NIL;
97 
98  MAPL(cv,
99  {
100  Pvecteur v = (Pvecteur) PVECTOR(CAR(cv));
101  result = gen_nconc(result, CONS(PVECTOR, (VECTOR) vect_dup(v), NIL));
102  },
103  l);
104 
105  return result;
106 }
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Definition: alloc.c:51

References CAR, CONS, gen_nconc(), MAPL, NIL, PVECTOR, vect_dup(), and VECTOR.

Referenced by atomize_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dup_list_of_ranges_list()

list dup_list_of_ranges_list ( list  l)

??? the complexity of this function could be greatly improved

Definition at line 72 of file message-utils.c.

74 {
75  list result = NIL;
76 
77  MAPL(cc,
78  {
79  list lr = CONSP(CAR(cc));
80  list lrp = NIL;
81  MAP(RANGE, r, lrp = gen_nconc(lrp, CONS(RANGE, r, NIL)), lr);
82  assert(gen_length(lrp)==gen_length(lr));
83  result = gen_nconc(result, CONS(LIST, lrp, NIL));
84  },
85  l);
86 
87  assert(gen_length(l)==gen_length(result));
88  return result;
89 }

References assert, CAR, CONS, CONSP, gen_length(), gen_nconc(), LIST, MAP, MAPL, NIL, and RANGE.

Referenced by atomize_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dynamic_hpf_undefined_p()

bool dynamic_hpf_undefined_p ( void  )

◆ empty_range_p()

bool empty_range_p ( range  r)

if we cannot decide, the range is supposed not to be empty

Definition at line 203 of file message-utils.c.

205 {
206  int lo, up;
207 
208  /* if we cannot decide, the range is supposed not to be empty
209  */
212  return false;
213  else
214  return lo>up;
215 }

References hpfc_integer_constant_expression_p(), range_lower, and range_upper.

Referenced by empty_section_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ empty_section_p()

bool empty_section_p ( list  lr)
Parameters
lrr

Definition at line 195 of file message-utils.c.

197 {
198  return((ENDP(lr))?
199  (false):
200  (empty_range_p(RANGE(CAR(lr))) || empty_section_p(CDR(lr))));
201 }
bool empty_range_p(range r)
bool empty_section_p(list lr)

References CAR, CDR, empty_range_p(), empty_section_p(), ENDP, and RANGE.

Referenced by empty_section_p(), keep_non_empty_domain_messages(), and keep_non_empty_messages_with_destination().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entity_hpf_number()

expression entity_hpf_number ( entity  e)

returns the hpf_number parameter as a string not really needed ??? ??? never called

Definition at line 196 of file declarations.c.

198 {
199  storage
200  s = entity_storage(e);
201  bool
202  in_common = entity_in_common_p(e),
203  in_ram = storage_ram_p(s);
204  ram
205  r = (in_ram ? storage_ram(s) : ram_undefined);
206  const char* suffix = entity_local_name(e),
207  *prefix =
208  (in_ram ?
209  entity_local_name(in_common ? ram_section(r) : ram_function(r)) :
210  "DEFAULT");
211 
212  pips_assert("ram variable", entity_variable_p(e) && in_ram);
213 
215  (strdup(concatenate("n_", prefix, "_", suffix, NULL))));
216 
217 }
expression MakeCharacterConstantExpression(string s)
END_EOLE.
Definition: constant.c:573
bool entity_in_common_p(entity e)
Definition: entity.c:1082
#define ram_undefined
Definition: ri.h:2221
#define storage_ram_p(x)
Definition: ri.h:2519
#define ram_section(x)
Definition: ri.h:2249
#define storage_ram(x)
Definition: ri.h:2521
#define ram_function(x)
Definition: ri.h:2247

References concatenate(), entity_in_common_p(), entity_local_name(), entity_storage, entity_variable_p, MakeCharacterConstantExpression(), pips_assert, prefix, ram_function, ram_section, ram_undefined, storage_ram, storage_ram_p, and strdup().

+ Here is the call graph for this function:

◆ entity_hpfc_dummy_p()

bool entity_hpfc_dummy_p ( entity  e)

build-system.c

build-system.c

  • array dimensions (PHIs)
  • template dimensions
  • processor dimensions
  • cycles and offsets
  • local array dimensions
  • indexes and others coming thru the regions

Inequations to be defined

  • array declaration
  • template declaration
  • processors arrangement declaration
  • local offsets within a block
  • local declarations
  • regions accessed by the statement

Equations to be defined

  • alignement
  • distribution
  • local <-> global?
  • processor linearization?

Remarks

  • offset to be computed
  • access functions are not needed (hidden by regions)
  • how to be sure that something can be done?
  • will newgen structures be necessary to build the systems?
  • will I have to remove some variables (indexes ?)
  • one equation to be added for replicated dimensions. variable names:

ALPHA{1-7}: array dimensions, THETA{1-7}: template dimensions, PSI{1-7}: processor dimensions, SIGMA{1-7}: auxiliary variable, GAMMA{1-7}: cycles, DELTA{1-7}: local offsets, LALPHA{1-7}: local array dimensions, if specified...

plus "PRIME" versions


HPF CONSTRAINTS GENERATION

Definition at line 106 of file build-system.c.

108 {
110 }
#define HPFC_PACKAGE
local definitions
Definition: hpfc-local.h:27
#define same_string_p(s1, s2)
const char * entity_module_name(entity e)
See comments about module_name().
Definition: entity.c:1092

References entity_module_name(), HPFC_PACKAGE, and same_string_p.

Referenced by put_variables_in_ordered_lists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entity_loop_index_p()

bool entity_loop_index_p ( entity  e)

Definition at line 383 of file compiler-util.c.

385 {
386  MAP(LOOP, l, if (e == loop_index(l)) return true, current_loop_list);
387  return false;
388 }
static list current_loop_list
management of a list of current loops.
#define LOOP(x)
LOOP.
Definition: ri.h:1606
#define loop_index(x)
Definition: ri.h:1640

References current_loop_list, LOOP, loop_index, and MAP.

Referenced by affine_expression_of_loop_index_p(), shift_expression_of_loop_index_p(), and simple_indices_p().

+ Here is the caller graph for this function:

◆ entity_processor_p()

bool entity_processor_p ( entity  )

◆ entity_template_p()

◆ entity_to_declaration_constraints()

Psysteme entity_to_declaration_constraints ( entity  e,
tag  what 
)

gives back the constraints due to the declarations.

Uses a demand driven approach: computed systems are stored in the declaration_constraints mapping for later search.

Parameters
whathat

Definition at line 285 of file build-system.c.

288 {
289  Psysteme p = load_entity_declaration_constraints(e+what);
290  pips_assert("variable", entity_variable_p(e));
291 
292  if (Psysteme_undefined_p(p))
293  {
295  store_entity_declaration_constraints(e+what, p);
296  }
297 
298  DEBUG_SYST(9, concatenate("entity ", entity_name(e), NULL), p);
299 
300  return p;
301 }
static Psysteme hpfc_compute_entity_to_declaration_constraints(entity e, tag what)
Definition: build-system.c:268
#define Psysteme_undefined_p(sc)
Definition: build-system.c:184
#define DEBUG_SYST(D, W, S)

References concatenate(), DEBUG_SYST, entity_name, entity_variable_p, hpfc_compute_entity_to_declaration_constraints(), pips_assert, and Psysteme_undefined_p.

Referenced by generate_shared_io_system(), generate_system_for_distributed_variable(), GENERATION(), and processor_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entity_to_hpf_align_constraints()

Psysteme entity_to_hpf_align_constraints ( entity  e)

Definition at line 480 of file build-system.c.

481 {
482  Psysteme p = load_entity_hpf_align_constraints(e);
483 
484  pips_assert("distributed variable", array_distributed_p(e));
485 
486  if (Psysteme_undefined_p(p))
487  {
489  store_entity_hpf_align_constraints(e, p);
490  }
491 
492  return p;
493 }
static Psysteme hpfc_compute_align_constraints(entity e)
Psysteme hpfc_compute_align_constraints(e) entity e is an array.
Definition: build-system.c:310

References array_distributed_p(), hpfc_compute_align_constraints(), pips_assert, and Psysteme_undefined_p.

Referenced by generate_system_for_distributed_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entity_to_hpf_distribute_constraints()

Psysteme entity_to_hpf_distribute_constraints ( entity  e)

Definition at line 495 of file build-system.c.

496 {
497  Psysteme p = load_entity_hpf_distribute_constraints(e);
498 
499  pips_assert("template", entity_template_p(e));
500 
501  if (Psysteme_undefined_p(p))
502  {
504  store_entity_hpf_distribute_constraints(e, p);
505  }
506 
507  return p;
508 }
static Psysteme hpfc_compute_distribute_constraints(entity e)
Psysteme hpfc_compute_distribute_constraints(e) entity e should be a template;.
Definition: build-system.c:407

References entity_template_p(), hpfc_compute_distribute_constraints(), pips_assert, and Psysteme_undefined_p.

Referenced by generate_system_for_distributed_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entity_to_new_declaration()

Psysteme entity_to_new_declaration ( entity  array)
Parameters
arrayrray

Definition at line 732 of file build-system.c.

734 {
735  Psysteme p = load_entity_new_declaration_constraints(array);
736 
737  pips_assert("distributed array", array_distributed_p(array));
738 
739  if (Psysteme_undefined_p(p))
740  {
742  store_entity_new_declaration_constraints(array, p);
743  }
744 
745  return p;
746 }
Psysteme hpfc_compute_entity_to_new_declaration(entity array)
Definition: build-system.c:533

References array, array_distributed_p(), hpfc_compute_entity_to_new_declaration(), pips_assert, and Psysteme_undefined_p.

Referenced by generate_system_for_distributed_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entity_to_region()

effect entity_to_region ( statement  stat,
entity  ent,
tag  act 
)

effect entity_to_region(stat, ent, act) statement stat; entity ent; tag act;

gives the region of ent with action act in statement stat.

Parameters
stattat
entnt
actct

Definition at line 515 of file build-system.c.

519 {
521 
522  MAP(EFFECT, e,
523  if ((reference_variable(effect_any_reference(e))==ent) &&
524  ((int) action_tag(effect_action(e))==act)) return(e),
525  l);
526 
527  return(effect_undefined);
528 }
list load_statement_local_regions(statement)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_action(x)
Definition: effects.h:642
#define effect_undefined
Definition: effects.h:614
#define action_tag(x)
Definition: effects.h:310

References action_tag, EFFECT, effect_action, effect_any_reference, effect_undefined, load_statement_local_regions(), MAP, and reference_variable.

Referenced by generate_distributed_io_system(), and generate_shared_io_system().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entity_update_common_undefined_p()

bool entity_update_common_undefined_p ( entity  )

◆ error_reset_dynamic_hpf()

void error_reset_dynamic_hpf ( void  )

◆ error_reset_hpf_alignment()

void error_reset_hpf_alignment ( void  )

◆ error_reset_hpf_distribution()

void error_reset_hpf_distribution ( void  )

◆ error_reset_hpf_number()

void error_reset_hpf_number ( void  )

◆ error_reset_hpf_reductions()

void error_reset_hpf_reductions ( void  )

◆ error_reset_hpfc_current_statement()

void error_reset_hpfc_current_statement ( void  )

◆ error_reset_maybeuseful_mappings()

void error_reset_maybeuseful_mappings ( void  )

◆ error_reset_new_host()

void error_reset_new_host ( void  )

◆ error_reset_new_node()

void error_reset_new_node ( void  )

◆ error_reset_old_host()

void error_reset_old_host ( void  )

◆ error_reset_old_node()

void error_reset_old_node ( void  )

◆ error_reset_overlap_status()

void error_reset_overlap_status ( void  )

◆ error_reset_primary_entity()

void error_reset_primary_entity ( void  )

◆ error_reset_renamings()

void error_reset_renamings ( void  )

◆ error_reset_similar_mapping()

void error_reset_similar_mapping ( void  )

◆ error_reset_the_dynamics()

void error_reset_the_dynamics ( void  )

◆ expr_compute_local_index()

expression expr_compute_local_index ( entity  array,
int  dim,
expression  expr 
)

new index computation formula, derived from the new declarations made for the given dimension.

just to avoid a gcc warning

Parameters
arrayrray
dimim
exprxpr

Definition at line 198 of file run-time.c.

202 {
203  if (get_bool_property("HPFC_EXPAND_COMPUTE_LOCAL_INDEX"))
204  {
205  tag newdecl = new_declaration_tag(array, dim);
206  dimension the_dim = entity_ith_dimension(array, dim);
207 
208  switch(newdecl)
209  {
210  case is_hpf_newdecl_none:
211  return(expr);
213  {
214  int dl = HpfcExpressionToInt(dimension_lower(the_dim));
215  expression shift = int_to_expression(1 - dl);
216 
218  expr, shift));
219  }
220  case is_hpf_newdecl_beta:
221  {
223  entity template = align_template(a);
224  distribute d = load_hpf_distribution(template);
226  int tempdim = alignment_templatedim(al), procdim;
227  dimension template_dim = FindIthDimension(template,tempdim);
230  tempdim,
231  &procdim);
232  expression
234  rate = alignment_rate(al),
235  prod, t1, the_mod, t2;
236  int
237  iabsrate = abs(HpfcExpressionToInt(rate)),
238  ishift = (HpfcExpressionToInt(alignment_constant(al)) -
239  HpfcExpressionToInt(dimension_lower(template_dim)));
240 
241 
242  prod =
243  ((HpfcExpressionToInt(rate)==1)?
244  (expr):
245  ((iabsrate==1)?
247  expr)):
249  rate,
250  expr))));
251 
252  t1 = ((ishift==0)?
253  (prod):
254  ((ishift>0)?
256  int_to_expression(ishift))):
258  int_to_expression(abs(ishift))))));
259 
261  t1,
262  parameter);
263 
264  t2 = ((iabsrate==1)?
265  (the_mod):
267  the_mod,
268  int_to_expression(iabsrate)));
269 
271  t2,
272  int_to_expression(1)));
273  }
275  {
276  expression
277  expr1 =
279  expr2 = int_to_expression(dim);
280 
282  expr1, expr2, expr));
283  }
285  {
286  expression
288  expr2 = int_to_expression(dim);
289 
291  expr1, expr2, expr));
292  }
293  default:
294  pips_internal_error("unexpected new declaration tag");
295  }
296 
297  }
298  else
299  {
300  expression
302  expr2 = int_to_expression(dim);
303 
305  expr1, expr2, expr));
306  }
307 
308  return(expression_undefined); /* just to avoid a gcc warning */
309 }
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define LOCAL_IND_GAMMA
#define LOCAL_IND
#define LOCAL_IND_DELTA
#define MINUS_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define MOD_INTRINSIC_NAME
#define DIVIDE_OPERATOR_NAME
#define UNARY_MINUS_OPERATOR_NAME
#define MULTIPLY_OPERATOR_NAME
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
Definition: expression.c:342
expression MakeTernaryCall(entity f, expression e1, expression e2, expression e3)
Creates a call expression to a function with 3 arguments.
Definition: expression.c:367

References abs, align_alignment, align_template, alignment_constant, alignment_rate, alignment_templatedim, array, dimension_lower, distribute_distribution, distribution_parameter, DIVIDE_OPERATOR_NAME, entity_intrinsic(), entity_ith_dimension(), expression_undefined, FindAlignmentOfDim(), FindDistributionOfDim(), FindIthDimension(), get_bool_property(), hpfc_name_to_entity(), HpfcExpressionToInt(), int_to_expression(), is_hpf_newdecl_alpha, is_hpf_newdecl_beta, is_hpf_newdecl_delta, is_hpf_newdecl_gamma, is_hpf_newdecl_none, load_hpf_alignment(), load_hpf_distribution(), load_hpf_number(), LOCAL_IND, LOCAL_IND_DELTA, LOCAL_IND_GAMMA, MakeBinaryCall(), MakeTernaryCall(), MakeUnaryCall(), MINUS_OPERATOR_NAME, MOD_INTRINSIC_NAME, MULTIPLY_OPERATOR_NAME, new_declaration_tag(), pips_internal_error, PLUS_OPERATOR_NAME, and UNARY_MINUS_OPERATOR_NAME.

Referenced by st_compute_ith_local_index().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extract_lattice()

void extract_lattice ( Psysteme  s,
list  scanners,
list newscs,
list ddc 
)

lattice_extraction.c

lattice_extraction.c

what: extracts a lattice from a set of equalities how: Hermite form computation on equalities implying scanners

  • equalities translated in F and M;
  • variables = scanners (s) + others (o) + cst (1)
  • F.s + M.o + V == 0
  • H = PFQ; // I assert P==I, maybe optimistic for this implementation...
  • (1) s = Q.y
  • (2) H.y + M.o + V == 0 then
  • (2) => new equalities that define some y(r)
  • (1) => ddc in some order..., plus replacement in inequalities
  • (1) => newscs, but what about the order?

input: Psysteme and scanners output: modified system, new scanners and deducibles side effects:

  • may create some new variables bugs or features: old deduction
  • should try to remove deducibles before hand?

of entity

void implementation: nothing done!

else do the job

FM (so) + V == 0

Fs + Mo + V == 0

H = P * F * Q

H = (Hl 0)

and memory leak, by the way

Hli = Hl^-1

Q = (Ql Qr)

QlHli = Ql * Hl^-1

QlHliM = QlHli * M

QlHliV = QlHli * V

I

mQr = - Qr

create nscanners-neq new scanning variables... they are the yr's.

We have: mQr yr + I s + QlHliM o + QlHliV == 0 yr are the new scanners, s the old ones, deducable from the new ones. the equation must also be used to remove s from the inequalities.

Fnew = ( mQr I QlHliM )

Now we have: (a) Fnew (yr s o)^t + QlHliV == 0 (b) lns – the new scanners

we must (1) generate deducables from (a), (2) regenerate inequalities on yr's.

clean the new system

old scanners are deduced now:

Parameters
scannersthe system is modified of entity
newscsvariables to be scanned of entity
ddcreturned new scanners of expression

Definition at line 113 of file lattice_extraction.c.

118 {
119  /* - should try to remove deducibles before hand?
120  */
121  int nscanners, nothers, ntotal, neq;
122  Pbase b, bsorted, byr;
123  Pmatrix FM, F, M, V, P, H, Q, Hl, Hli, Ql, Qr, QlHli,
124  QlHliM, QlHliV, mQr, I, Fnew;
125  Value det_P, det_Q;
126  int i;
127  list /* of entity */ lns = NIL, ltmp = NIL;
128  Pcontrainte eq;
129 
130  neq = sc_nbre_egalites(s);
131 
132  if (neq==0 || !get_bool_property("HPFC_EXTRACT_LATTICE")) {
133  /* void implementation: nothing done!
134  */
135  *newscs = gen_copy_seq(scanners);
136  *ddc = NIL;
137  return;
138  }
139  /* else do the job */
140 
141  DEBUG_SYST(3, "initial system", s);
142  DEBUG_ELST(3, "scanners", scanners);
143 
144  b = sc_base(s);
145  nscanners = gen_length(scanners);
146  ntotal = base_dimension(b);
147  nothers = ntotal - nscanners;
148 
149  message_assert("more scanners than equalities", nscanners>=neq);
150 
151  bsorted = scanners_then_others(b, scanners);
152 
153  DEBUG_BASE(3, "sorted base", bsorted);
154  pips_debug(3, "%d scanners, %d others, %d eqs\n", nscanners, nothers, neq);
155 
156  /* FM (so) + V == 0 */
157  FM = matrix_new(neq, ntotal);
158  V = matrix_new(neq, 1);
159 
160  constraints_to_matrices(sc_egalites(s), bsorted, FM, V);
161 
162  DEBUG_MTRX(4, "FM", FM);
163  DEBUG_MTRX(4, "V", V);
164 
165  /* Fs + Mo + V == 0 */
166  F = matrix_new(neq, nscanners);
167  M = matrix_new(neq, nothers);
168 
169  ordinary_sub_matrix(FM, F, 1, neq, 1, nscanners);
170  ordinary_sub_matrix(FM, M, 1, neq, nscanners+1, ntotal);
171 
172  matrix_free(FM);
173 
174  DEBUG_MTRX(4, "F", F);
175  DEBUG_MTRX(4, "M", M);
176 
177  /* H = P * F * Q */
178  H = matrix_new(neq, nscanners);
179  P = matrix_new(neq, neq);
180  Q = matrix_new(nscanners, nscanners);
181 
182  matrix_hermite(F, P, H, Q, &det_P, &det_Q);
183 
184  DEBUG_MTRX(4, "H", H);
185  DEBUG_MTRX(4, "P", P);
186  DEBUG_MTRX(4, "Q", Q);
187 
188  message_assert("P == I", matrix_diagonal_p(P) && det_P==1);
189 
190  /* H = (Hl 0) */
191  Hl = matrix_new(neq, neq);
192  ordinary_sub_matrix(H, Hl, 1, neq, 1, neq);
193  matrix_free(H);
194 
195  DEBUG_MTRX(4, "Hl", Hl);
196 
197  if (!matrix_triangular_unimodular_p(Hl, true)) {
198  pips_user_warning("fast exit, some yes/no lattice skipped\n");
199  /* and memory leak, by the way */
200  *newscs = gen_copy_seq(scanners);
201  *ddc = NIL;
202  return;
203  }
204 
205  message_assert("Hl is lower triangular unimodular",
207 
208  /* Hli = Hl^-1 */
209  Hli = matrix_new(neq, neq);
211  matrix_free(Hl);
212 
213  DEBUG_MTRX(4, "Hli", Hli);
214 
215  /* Q = (Ql Qr) */
216  Ql = matrix_new(nscanners, neq);
217  Qr = matrix_new(nscanners, nscanners-neq);
218 
219  ordinary_sub_matrix(Q, Ql, 1, nscanners, 1, neq);
220  ordinary_sub_matrix(Q, Qr, 1, nscanners, neq+1, nscanners);
221 
222  DEBUG_MTRX(4, "Ql", Ql);
223  DEBUG_MTRX(4, "Qr", Qr);
224 
225  matrix_free(Q);
226 
227  /* QlHli = Ql * Hl^-1 */
228  QlHli = matrix_new(nscanners, neq);
229  matrix_multiply(Ql, Hli, QlHli);
230 
231  matrix_free(Ql);
232  matrix_free(Hli);
233 
234  /* QlHliM = QlHli * M */
235  QlHliM = matrix_new(nscanners, nothers);
236  matrix_multiply(QlHli, M, QlHliM);
237 
238  matrix_free(M);
239 
240  /* QlHliV = QlHli * V */
241  QlHliV = matrix_new(nscanners, 1);
242  matrix_multiply(QlHli, V, QlHliV);
243 
244  matrix_free(V);
245  matrix_free(QlHli);
246 
247  /* I */
248  I = matrix_new(nscanners, nscanners);
249  matrix_identity(I, 0);
250 
251  /* mQr = - Qr */
252  mQr = matrix_new(nscanners, nscanners-neq);
253  matrix_uminus(Qr, mQr);
254  matrix_free(Qr);
255 
256  /* create nscanners-neq new scanning variables... they are the yr's.
257  */
258  for (i=0; i<nscanners-neq; i++)
259  lns = CONS(ENTITY,
261 
262  byr = list_to_base(lns);
263  bsorted = append_to(byr, bsorted); byr = BASE_NULLE;
264 
265  /* We have: mQr yr + I s + QlHliM o + QlHliV == 0
266  * yr are the new scanners, s the old ones, deducable from the new ones.
267  * the equation must also be used to remove s from the inequalities.
268  *
269  * Fnew = ( mQr I QlHliM )
270  */
271  Fnew = matrix_new(nscanners, 2*nscanners-neq+nothers);
272 
273  insert_sub_matrix(Fnew, mQr, 1, nscanners, 1, nscanners-neq);
274  insert_sub_matrix(Fnew, I, 1, nscanners, nscanners-neq+1, 2*nscanners-neq);
275  insert_sub_matrix(Fnew, QlHliM, 1, nscanners,
276  2*nscanners-neq+1, 2*nscanners-neq+nothers);
277 
278  matrix_free(I);
279  matrix_free(mQr);
280  matrix_free(QlHliM);
281 
282  /* Now we have:
283  * (a) Fnew (yr s o)^t + QlHliV == 0
284  * (b) lns -- the new scanners
285  *
286  * we must
287  * (1) generate deducables from (a),
288  * (2) regenerate inequalities on yr's.
289  */
290 
291  matrices_to_constraints(&eq, bsorted, Fnew, QlHliV);
292  matrix_free(Fnew);
293  matrix_free(QlHliV);
294 
295  /* clean the new system
296  */
297  contraintes_free(sc_egalites(s));
298  sc_egalites(s) = eq;
299  base_rm(sc_base(s));
300  sc_creer_base(s);
301 
302  /* old scanners are deduced now:
303  */
304  *ddc = gen_append(*ddc, simplify_deducable_variables(s, scanners, &ltmp));
305  pips_assert("no vars left", ENDP(ltmp));
306 
307  *newscs = lns;
308 
309  base_rm(bsorted);
310 
311  DEBUG_SYST(3, "resulting system", s);
312  DEBUG_ELST(3, "new scanners", lns);
313 }
Pcontrainte contraintes_free(Pcontrainte pc)
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc.
Definition: alloc.c:226
#define F
Definition: freia-utils.c:51
list gen_append(list l1, const list l2)
Definition: list.c:471
entity hpfc_new_variable(entity module, basic b)
Definition: compile.c:632
#define DEBUG_BASE(D, W, B)
#define DEBUG_MTRX(D, W, M)
list simplify_deducable_variables(Psysteme, list, list *)
list simplify_deducable_variables(syst, vars, pleftvars) Psysteme syst; list vars,...
Definition: io-compile.c:562
static Pbase append_to(Pbase b1, Pbase b2)
HPFC module by Fabien COELHO.
static Pbase scanners_then_others(Pbase initial, list ls)
returns a newly allocated base with the scanners ahead
#define matrix_free(m)
Allocation et desallocation d'une matrice.
Definition: matrix-local.h:73
Pmatrix matrix_new(int m, int n)
package matrix
Definition: alloc.c:41
void matrix_hermite(Pmatrix MAT, Pmatrix P, Pmatrix H, Pmatrix Q, Value *det_p, Value *det_q)
package matrix
Definition: hermite.c:78
void matrix_unimodular_triangular_inversion(Pmatrix u, Pmatrix inv_u, bool infer)
package matrix
Definition: inversion.c:53
void matrix_uminus(Pmatrix A, Pmatrix mA)
void matrix_uminus(A, mA)
Definition: matrix.c:558
bool matrix_diagonal_p(Pmatrix Z)
bool matrix_diagonal_p(Pmatrix Z): test de nullite de la matrice Z
Definition: matrix.c:336
void matrix_multiply(const Pmatrix a, const Pmatrix b, Pmatrix c)
void matrix_multiply(Pmatrix a, Pmatrix b, Pmatrix c): multiply rational matrix a by rational matrix ...
Definition: matrix.c:95
bool matrix_triangular_unimodular_p(Pmatrix Z, bool inferieure)
bool matrix_triangular_unimodular_p(Pmatrix Z, bool inferieure) test de la triangulaire et unimodulai...
Definition: matrix.c:403
void ordinary_sub_matrix(Pmatrix, Pmatrix, int, int, int, int)
void ordinary_sub_matrix(Pmatrix A, A_sub, int i1, i2, j1, j2) input : a initialized matrix A,...
Definition: sub-matrix.c:469
void matrix_identity(Pmatrix, int)
void matrix_identity(Pmatrix ID, int level) Construction d'une sous-matrice identity dans ID(level+1....
Definition: sub-matrix.c:322
void insert_sub_matrix(Pmatrix, Pmatrix, int, int, int, int)
void insert_sub_matrix(A, A_sub, i1, i2, j1, j2) input: matrix A and smaller A_sub output: nothing mo...
Definition: sub-matrix.c:487
#define pips_user_warning
Definition: misc-local.h:146
Pbase list_to_base(list l)
Pbase list_to_base(list l): returns the Pbase that contains the variables of list "l",...
#define message_assert(msg, ex)
Definition: newgen_assert.h:47
#define Q
Definition: pip__type.h:39
basic MakeBasic(int)
END_EOLE.
Definition: type.c:128
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Definition: sc_gram.c:108
void matrices_to_constraints(Pcontrainte *, Pbase, Pmatrix, Pmatrix)
=======================================================================
void constraints_to_matrices(Pcontrainte, Pbase, Pmatrix, Pmatrix)
=======================================================================
package matrice
Definition: matrix-local.h:63
#define base_dimension(b)
#define BASE_NULLE
MACROS SUR LES BASES.

References append_to(), base_dimension, BASE_NULLE, base_rm, CONS, constraints_to_matrices(), contraintes_free(), DEBUG_BASE, DEBUG_ELST, DEBUG_MTRX, DEBUG_SYST, ENDP, ENTITY, eq, F, gen_append(), gen_copy_seq(), gen_length(), get_bool_property(), hpfc_new_variable(), insert_sub_matrix(), is_basic_int, list_to_base(), MakeBasic(), matrices_to_constraints(), matrix_diagonal_p(), matrix_free, matrix_hermite(), matrix_identity(), matrix_multiply(), matrix_new(), matrix_triangular_unimodular_p(), matrix_uminus(), matrix_unimodular_triangular_inversion(), message_assert, NIL, node_module, ordinary_sub_matrix(), pips_assert, pips_debug, pips_user_warning, Q, sc_creer_base(), scanners_then_others(), and simplify_deducable_variables().

Referenced by hpf_remapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindAlignmentOfDim()

alignment FindAlignmentOfDim ( list  lal,
int  dim 
)
Parameters
lalal
dimim

Definition at line 377 of file hpfc-util.c.

380 {
381  list l=lal;
382 
383  while ((!ENDP(l)) && (alignment_arraydim(ALIGNMENT(CAR(l))) != dim))
384  POP(l);
385 
386  return (l==NIL) ? alignment_undefined : ALIGNMENT(CAR(l));
387 }
#define ALIGNMENT(x)
ALIGNMENT.
Definition: hpf.h:102

References ALIGNMENT, alignment_arraydim, alignment_undefined, CAR, ENDP, NIL, and POP.

Referenced by ComputeNewSizeOfIthDimension(), create_init_common_param_for_arrays(), expr_compute_local_index(), ith_dim_distributed_p(), ith_dim_overlapable_p(), and template_dimension_of_array_dimension().

+ Here is the caller graph for this function:

◆ FindAlignmentOfTemplateDim()

alignment FindAlignmentOfTemplateDim ( list  lal,
int  dim 
)
Parameters
lalal
dimim

Definition at line 389 of file hpfc-util.c.

392 {
393  list l=lal;
394 
395  while ((!ENDP(l)) && (alignment_templatedim(ALIGNMENT(CAR(l))) != dim))
396  POP(l);
397 
398  return ((l==NULL)?(alignment_undefined):(ALIGNMENT(CAR(l))));
399 }

References ALIGNMENT, alignment_templatedim, alignment_undefined, CAR, ENDP, and POP.

Referenced by array_distribution_similar_p(), array_ranges_to_template_ranges(), create_init_common_param_for_arrays(), get_alignment(), hpfc_compute_align_constraints(), hpfc_compute_unicity_constraints(), and processors_dim_replicated_p().

+ Here is the caller graph for this function:

◆ FindDefinitionsOf()

list FindDefinitionsOf ( statement  stat,
list  lsyn 
)
Parameters
stattat
lsynsyn

Definition at line 239 of file compiler-util.c.

242 {
243  list result = NIL;
244 
245  pips_assert("empty lists", ENDP(syntax_list) && ENDP(found_definitions));
246 
247  syntax_list = lsyn;
248 
249  gen_recurse(stat,
251  gen_true,
253 
254  result = found_definitions,
255  syntax_list = NIL,
257 
258  return(result);
259 }
static list syntax_list
??? False! The definition looked for must be an assignment call...
static list found_definitions
static void FindDefinitionsOf_rewrite(statement s)
#define gen_recurse(start, domain_number, flt, rwt)
Definition: genC.h:283
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362

References ENDP, FindDefinitionsOf_rewrite(), found_definitions, gen_recurse, gen_true(), NIL, pips_assert, statement_domain, and syntax_list.

Referenced by hpf_compile_parallel_body().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindDistributionOfDim()

distribution FindDistributionOfDim ( list  ldi,
int  dim,
int pdim 
)
Parameters
ldidi
dimim
pdimdim

Definition at line 401 of file hpfc-util.c.

404 {
405  list l = ldi;
406  int i, procdim = 1;
407 
408  pips_assert("valid dimension", dim>=1 && dim<=(int)gen_length(ldi));
409 
410  for (i=1; i<dim; i++)
411  {
413  procdim++;
414  POP(l);
415  }
416 
417  (*pdim) = procdim;
418  return(DISTRIBUTION(CAR(l)));
419 }
#define style_none_p(x)
Definition: hpf.h:259

References CAR, DISTRIBUTION, distribution_style, gen_length(), pips_assert, POP, and style_none_p.

Referenced by ComputeNewSizeOfIthDimension(), create_init_common_param_for_arrays(), DistributionParameterOfArrayDim(), expr_compute_local_index(), get_distribution(), ith_dim_distributed_p(), ith_dim_overlapable_p(), and processor_number().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindDistributionOfProcessorDim()

distribution FindDistributionOfProcessorDim ( list  ldi,
int  dim,
int tdim 
)
Parameters
ldidi
dimim
tdimdim

Definition at line 421 of file hpfc-util.c.

424 {
425  int i = 1, procdim = 0;
426 
427  MAP(DISTRIBUTION, d,
428  {
430  procdim++;
431 
432  if (procdim==dim)
433  {
434  (*tdim) = i;
435  return(d);
436  }
437 
438  i++;
439  },
440  ldi);
441 
442  pips_internal_error("dimension %d not found", dim);
443 
444  return(distribution_undefined);
445 }
#define distribution_undefined
Definition: hpf.h:186

References DISTRIBUTION, distribution_style, distribution_undefined, MAP, pips_internal_error, and style_none_p.

Referenced by array_distribution_similar_p(), hpfc_compute_distribute_constraints(), processors_dim_replicated_p(), and template_ranges_to_processors_ranges().

+ Here is the caller graph for this function:

◆ FindRefToDistArray()

list FindRefToDistArray ( void *  obj)
Parameters
objbj

Definition at line 282 of file hpfc-util.c.

283 {
284  list result = NIL, saved = found_syntaxes;
286  gen_multi_recurse(obj,
288  gen_true,
290 
291  result = found_syntaxes, found_syntaxes = saved;
292 
293  return result;
294 }
static list found_syntaxes
Definition: hpfc-util.c:270
static void FindRefToDistArray_syntax_rewrite(syntax s)
Definition: hpfc-util.c:272
#define syntax_domain
newgen_synchronization_domain_defined
Definition: ri.h:402

References FindRefToDistArray_syntax_rewrite(), found_syntaxes, gen_multi_recurse(), gen_true(), NIL, and syntax_domain.

Referenced by FindRefToDistArrayFromList(), FindRefToDistArrayInStatement_call_filter(), FindRefToDistArrayInStatement_expression_filter(), generate_c1_alpha(), and ref_to_dist_array_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindRefToDistArrayFromList()

list FindRefToDistArrayFromList ( list  lexpr)

FindRefToDistArrayFromList.

these functions compute the list of syntax that are references to a distributed variable.

Parameters
lexprexpr

Definition at line 262 of file hpfc-util.c.

264 {
265  list l=NIL;
266  MAP(EXPRESSION, e,{l=gen_nconc(FindRefToDistArray(e),l);},lexpr);
267  return(l);
268 }
list FindRefToDistArray(void *obj)
Definition: hpfc-util.c:282

References EXPRESSION, FindRefToDistArray(), gen_nconc(), MAP, and NIL.

Referenced by generate_c1_beta().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindRefToDistArrayInStatement()

void FindRefToDistArrayInStatement ( statement  obj,
list lwp,
list lrp 
)
Parameters
objbj
lwpwp
lrprp

Definition at line 121 of file compiler-util.c.

124 {
125  list
126  saved_r = found_read,
127  saved_w = found_written;
128 
130 
131  gen_multi_recurse(obj,
132  call_domain,
134  gen_null,
137  gen_null,
138  NULL);
139 
140  *lwp = found_written, *lrp = found_read,
141  found_read = saved_r, found_written = saved_w;
142 }
static bool FindRefToDistArrayInStatement_call_filter(call c)
Definition: compiler-util.c:90
static list found_written
FindRefToDistArrayInStatement.
Definition: compiler-util.c:84
static bool FindRefToDistArrayInStatement_expression_filter(expression e)
static list found_read
Definition: compiler-util.c:85
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
Definition: genClib.c:2752
#define expression_domain
newgen_execution_domain_defined
Definition: ri.h:154
#define call_domain
newgen_callees_domain_defined
Definition: ri.h:58

References call_domain, expression_domain, FindRefToDistArrayInStatement_call_filter(), FindRefToDistArrayInStatement_expression_filter(), found_read, found_written, gen_multi_recurse(), gen_null(), and NIL.

Referenced by hpf_compile_parallel_body(), hpf_compile_parallel_loop(), and Overlap_Analysis().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fortran_library_entity_p()

bool fortran_library_entity_p ( entity  e)

else not found

Definition at line 52 of file local-ri-util.c.

54 {
55  string *s; const char* name=entity_local_name(e);
56 
57  if (!top_level_entity_p(e)) return(false);
58  for (s=fortran_library; *s!=(string) NULL; s++)
59  if (same_string_p(*s, name)) return true;
60 
61  return false; /* else not found */
62 }
static string fortran_library[]
library functions...
Definition: local-ri-util.c:46
char * string
STRING.
Definition: newgen_types.h:39
bool top_level_entity_p(entity e)
Check if the scope of entity e is global.
Definition: entity.c:1130

References entity_local_name(), fortran_library, same_string_p, and top_level_entity_p().

Referenced by hpfc_compile(), and hpfc_directives_handler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fprint_lmessage()

void fprint_lmessage ( FILE *  file,
list  l 
)
Parameters
fileile

Definition at line 231 of file debug-util.c.

234 {
235  if (ENDP(l))
236  fprintf(file, "message list is empty\n");
237  else
238  MAP(MESSAGE, m, fprint_message(file, m), l);
239 }
void fprint_message(FILE *file, message m)
Definition: debug-util.c:217
#define MESSAGE(x)
newgen_message_domain_defined
Definition: message.h:43

References ENDP, fprint_message(), fprintf(), MAP, and MESSAGE.

Referenced by messages_handling().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fprint_lrange()

void fprint_lrange ( FILE *  file,
list  l 
)
Parameters
fileile

Definition at line 200 of file debug-util.c.

203 {
204  bool firstrange = true;
205 
206  MAP(RANGE, r,
207  {
208  if (!firstrange)
209  (void) fprintf(file, ", ");
210 
211  firstrange = false;
212  fprint_range(file, r);
213  },
214  l);
215 }
void fprint_range(FILE *file, range r)
Definition: debug-util.c:176

References fprint_range(), fprintf(), MAP, and RANGE.

Referenced by fprint_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fprint_message()

void fprint_message ( FILE *  file,
message  m 
)
Parameters
fileile

Definition at line 217 of file debug-util.c.

220 {
221  (void) fprintf(file, "message is array %s(",
223  fprint_lrange(file, message_content(m));
224  (void) fprintf(file, ")\nto\n");
226  (void) fprintf(file, "domain is ");
227  fprint_lrange(file, message_dom(m));
228  (void) fprintf(file, "\n");
229 }
void fprint_lrange(FILE *file, list l)
Definition: debug-util.c:200
void vect_fprint(FILE *f, Pvecteur v, get_variable_name_t variable_name)
void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v su...
Definition: io.c:124
char * variable_dump_name(Variable v)
variable_dump_name() returns an unambiguous name for variable v, based on the pointer used to really ...
Definition: variable.c:96
#define message_array(x)
Definition: message.h:75
#define message_dom(x)
Definition: message.h:81
#define message_neighbour(x)
Definition: message.h:79
#define message_content(x)
Definition: message.h:77

References entity_local_name(), fprint_lrange(), fprintf(), message_array, message_content, message_dom, message_neighbour, variable_dump_name(), and vect_fprint().

Referenced by atomize_one_message(), and fprint_lmessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fprint_range()

void fprint_range ( FILE *  file,
range  r 
)
Parameters
fileile

Definition at line 176 of file debug-util.c.

179 {
180  int lo, up, in;
181  bool
185 
186  if (blo && bup && bin)
187  {
188  if (in==1)
189  if (lo==up)
190  fprintf(file, "%d", lo);
191  else
192  fprintf(file, "%d:%d", lo, up);
193  else
194  fprintf(file, "%d:%d:%d", lo, up, in);
195  }
196  else
197  fprintf(file, "X");
198 }

References fprintf(), hpfc_integer_constant_expression_p(), range_increment, range_lower, and range_upper.

Referenced by fprint_lrange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_hpf_object_lists()

void free_hpf_object_lists ( void  )

Definition at line 98 of file declarations.c.

99 {
100  gen_free_list(distributed_arrays),
101  gen_free_list(templates),
102  gen_free_list(processors);
103 
105 }
void reset_hpf_object_lists()
Definition: declarations.c:91

References gen_free_list(), and reset_hpf_object_lists().

Referenced by close_data_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_hpfc_current_mappings()

void free_hpfc_current_mappings ( void  )

Definition at line 200 of file build-system.c.

201 {
202  free_declaration_constraints_map();
203  free_hpf_align_constraints_map();
204  free_hpf_distribute_constraints_map();
205  free_new_declaration_constraints_map();
206 }

Referenced by reset_resources_for_module().

+ Here is the caller graph for this function:

◆ free_only_io_map()

void free_only_io_map ( void  )

Referenced by reset_resources_for_module().

+ Here is the caller graph for this function:

◆ free_update_common_map()

void free_update_common_map ( void  )

Referenced by hpfc_directives_handler().

+ Here is the caller graph for this function:

◆ free_vector_list()

void free_vector_list ( list  l)

Definition at line 382 of file special_cases.c.

383 {
385  gen_free_list(l);
386 }
void gen_map(gen_iter_func_t fp, const list l)
Definition: list.c:172
void(* gen_iter_func_t)(void *)
Definition: newgen_types.h:116
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Definition: alloc.c:78

References gen_free_list(), gen_map(), and vect_rm().

Referenced by generate_subarray_shift(), subarray_shift_assignment_p(), and subarray_shift_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ full_copy_p()

bool full_copy_p ( statement  s,
reference pleft,
reference pright 
)

of lists

of loops

of expressions

the loop nest must be perfect... !!! should check for continues?

the body must be a simple assignment

compatible arities

number of enclosing loops

the lhs should be fully defined by the loop nest... but it does not matter for the rhs!

both lhs and rhs references must be aligned

??? should check the new declarations...

Parameters
pleftleft
prightright

Definition at line 869 of file special_cases.c.

870 {
871  list /* of lists */ lb = NIL, l,
872  /* of loops */ ll = NIL,
873  /* of expressions */ la = NIL;
874  statement body = parallel_loop_nest_to_body(s, &lb, &ll), simple;
875  expression e;
876  reference left, right;
877  int len;
878 
879  DEBUG_STAT(6, "considering statement", s);
880 
881  /* the loop nest must be perfect... !!!
882  * should check for continues?
883  */
884  for (l=lb; l; POP(l))
886  {
887  XDEBUG("non perfectly nested");
888  gen_free_list(lb), gen_free_list(ll); return false;
889  }
890 
891  gen_free_list(lb), lb = NIL;
892 
893  /* the body must be a simple assignment
894  */
895  simple = simple_statement(body);
896 
898  {
899  XDEBUG("body not simple"); gen_free_list(ll); return false;
900  }
901 
903  pips_assert("2 arguments to assign", gen_length(la)==2);
904 
905  left = expression_reference(EXPRESSION(CAR(la)));
906  e = EXPRESSION(CAR(CDR(la)));
907 
908  if (!expression_reference_p(e))
909  {
910  XDEBUG("rhs not a reference"); gen_free_list(ll); return false;
911  }
912 
913  right = expression_reference(e);
914 
915  /* compatible arities
916  */
917  len = (int) gen_length(ll); /* number of enclosing loops */
918 
919  if ((int) gen_length(reference_indices(left))!=len ||
920  (int) gen_length(reference_indices(right))!=len)
921  {
922  XDEBUG("incompatible arities"); gen_free_list(ll); return false;
923  }
924 
925  /* the lhs should be fully defined by the loop nest...
926  * but it does not matter for the rhs!
927  */
928  if (!full_define_p(left, ll))
929  {
930  XDEBUG("lhs not fully defined"); gen_free_list(ll); return false;
931  }
932 
933  gen_free_list(ll);
934 
935  /* both lhs and rhs references must be aligned
936  */
937  if (!references_aligned_p(left, right))
938  {
939  XDEBUG("references not aligned"); return false;
940  }
941 
942  /* ??? should check the new declarations...
943  */
944 
945  XDEBUG("ok");
946  *pleft = left;
947  *pright = right;
948  return true;
949 }
void const char const char const int
statement parallel_loop_nest_to_body(statement loop_nest, list *pblocks, list *ploops)
bool instruction_assign_p(instruction i)
Test if an instruction is an assignment.
Definition: instruction.c:164
bool references_aligned_p(reference r1, reference r2)
Definition: hpfc-util.c:726
#define DEBUG_STAT(D, W, S)
bool expression_reference_p(expression e)
Test if an expression is a reference.
Definition: expression.c:528
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
Definition: expression.c:1832
#define XDEBUG(msg)
bool full_copy_p(statement s, reference * pleft, reference * pright)
statement simple_statement(statement s)
bool full_define_p(reference r, list ll)
static int number_of_non_empty_statements(list ls)

References call_arguments, CAR, CDR, CONSP, DEBUG_STAT, EXPRESSION, expression_reference(), expression_reference_p(), full_define_p(), gen_free_list(), gen_length(), instruction_assign_p(), instruction_call, int, NIL, number_of_non_empty_statements(), parallel_loop_nest_to_body(), pips_assert, POP, reference_indices, references_aligned_p(), simple, simple_statement(), statement_instruction, and XDEBUG.

Referenced by hpf_compile_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ full_define_p()

bool full_define_p ( reference  r,
list  ll 
)

of expression

of dimension

of entity

checks that the indices are simply the loop indexes, and that the whole dimension is scanned. Also avoids (i,i)...

checks that the loop range scans the whole dimension

increment must be 1. lowers and uppers must be equal.

Parameters
lll

Definition at line 771 of file special_cases.c.

772 {
774  list /* of expression */ li = reference_indices(r),
775  /* of dimension */ ld,
776  /* of entity */ lseen = NIL;
777  int ndim;
778 
779  pips_assert("variable", entity_variable_p(array));
780 
782  pips_assert("same arity", gen_length(ll)==gen_length(ld));
783 
784  /* checks that the indices are *simply* the loop indexes,
785  * and that the whole dimension is scanned. Also avoids (i,i)...
786  */
787  for(ndim=1; li; POP(li), POP(ld), ndim++)
788  {
790  entity index;
791  dimension dim;
792  range rg;
793  loop l;
794  expression inc;
795 
796  if (!syntax_reference_p(s))
797  {
798  gen_free_list(lseen);
799  return false;
800  }
801 
803 
804  if (gen_in_list_p(index, lseen))
805  {
806  gen_free_list(lseen);
807  return false;
808  }
809 
810  lseen = CONS(ENTITY, index, lseen);
811 
812  l = find_loop(index, ll);
813 
814  if (!l)
815  {
816  gen_free_list(lseen);
817  return false;
818  }
819 
820  /* checks that the loop range scans the whole dimension */
821 
822  rg = loop_range(l);
823  inc = range_increment(rg);
824  dim = DIMENSION(CAR(ld));
825 
826  /* increment must be 1.
827  * lowers and uppers must be equal.
828  */
829  if (!integer_constant_expression_p(inc) ||
833  {
834  pips_debug(9, "incomplete scan of %s[dim=%d]\n",
835  entity_name(array), ndim);
836  gen_free_list(lseen);
837  return false;
838  }
839  }
840 
841  gen_free_list(lseen);
842  return true;
843 }
bool integer_constant_expression_p(expression e)
positive integer constant expression: call to a positive constant or to a sum of positive integer con...
Definition: expression.c:903
bool same_expression_p(expression e1, expression e2)
this is slightly different from expression_equal_p, as it will return true for a+b vs b+a
Definition: expression.c:1426
int integer_constant_expression_value(expression e)
Definition: expression.c:1545
#define loop_range(x)
Definition: ri.h:1642
static loop find_loop(entity index, list ll)
bool full_define_p (reference r, list ll)

References array, CAR, CONS, DIMENSION, dimension_lower, dimension_upper, ENTITY, entity_name, entity_type, entity_variable_p, EXPRESSION, expression_syntax, find_loop(), gen_free_list(), gen_in_list_p(), gen_length(), integer_constant_expression_p(), integer_constant_expression_value(), loop_range, NIL, pips_assert, pips_debug, POP, range_increment, range_lower, range_upper, reference_indices, reference_variable, same_expression_p(), syntax_reference, syntax_reference_p, type_variable, and variable_dimensions.

Referenced by full_copy_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ full_linearization()

Pcontrainte full_linearization ( entity  obj,
entity  var,
int psize,
entity(*)(int create_var,
bool  fortran_way,
int  initial_offset 
)

remapping.c

remapping.c

var is set to the result. *psize returns the size of obj. Done the Fortran way, or the other way around... initial offset if desired

Parameters
objbj
vararray being lin.
psizeassigned variable if desired
create_varreturned array extent
fortran_waydimension variable builder
initial_offsetFortran/C linearization way

Definition at line 80 of file remapping.c.

87 {
88  int dim = NumberOfDimension(obj), low, up, size, i;
90 
91  for(*psize=1, i=fortran_way ? dim : 1 ;
92  fortran_way ? i>0 : i<=dim;
93  i+= fortran_way ? -1 : 1)
94  {
95  get_entity_dimensions(obj, i, &low, &up);
96  size = up - low + 1;
97  *psize *= size;
98  v = vect_multiply(v, int_to_value(size));
99  vect_add_elem(&v, (Variable) create_var(i), VALUE_ONE);
100  vect_add_elem(&v, TCST, int_to_value(-low));
101  }
102 
103  if (var) vect_add_elem(&v, (Variable) var, VALUE_MONE);
104  if (initial_offset)
105  vect_add_elem(&v, TCST,
106  int_to_value(initial_offset));
107 
108  return contrainte_make(v);
109 }
void get_entity_dimensions(entity e, int dim, int *plow, int *pup)
Definition: hpfc-util.c:651
Pvecteur vect_multiply(Pvecteur v, Value x)
Pvecteur vect_multiply(Pvecteur v, Value x): multiplication du vecteur v par le scalaire x,...
Definition: scalaires.c:123

References contrainte_make(), get_entity_dimensions(), int_to_value, NumberOfDimension(), TCST, VALUE_MONE, VALUE_ONE, vect_add_elem(), vect_multiply(), and VECTEUR_NUL.

Referenced by hpfc_broadcast_buffers(), and hpfc_compute_lid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_all_liveness()

statement generate_all_liveness ( entity  primary,
bool  val 
)
Parameters
primaryrimary
valal

Definition at line 940 of file remapping.c.

943 {
944  return generate_all_liveness_but(primary, val, entity_undefined);
945 }
static statement generate_all_liveness_but(entity primary, bool val, entity butthisone)
Definition: remapping.c:906

References entity_undefined, and generate_all_liveness_but().

Referenced by hpf_compile_call(), and root_statement_remapping_inits().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_c1_alpha()

void generate_c1_alpha ( statement  stat,
list lhp,
list lnp 
)

generate_c1_alpha

a distributed array variable is defined

read references to distributed arrays.

generation of the code to get the necessary values...

then the updated statement is to be added to node:

Update the values of the defined distributed variable if necessary...

the overall statements are generated.

Parameters
stattat
lhphp
lnpnp

Definition at line 121 of file generate.c.

124 {
125  statement statcomputation, statcomputecomputer, statifcomputer;
126  expression writtenexpr, newreadexpr;
127  call the_call;
128  list
129  lupdatecomp = NIL,
130  lupdatenotcomp = NIL,
131  lreadreftodistarray = NIL,
132  lstatcomp = NIL,
133  lstatnotcomp = NIL,
134  lstat = NIL,
135  linds = NIL;
136  reference ref, newref;
137  entity newarray;
138 
139  (*lhp) = NIL;
140  (*lnp) = NIL;
141 
142  pips_assert("call", statement_call_p(stat));
143 
144  the_call = instruction_call(statement_instruction(stat));
145  pips_assert("assignment", ENTITY_ASSIGN_P(call_function(the_call)));
146 
147  writtenexpr = EXPRESSION(CAR(call_arguments(the_call)));
148  pips_assert("reference",
149  syntax_reference_p(expression_syntax(writtenexpr)) &&
152  (syntax_reference(expression_syntax(writtenexpr))))));
153 
154  /* read references to distributed arrays.
155  */
156  lreadreftodistarray =
158 
159  /* generation of the code to get the necessary values...
160  */
161  MAP(SYNTAX, s,
162  {
163  list lnotcomp;
164  list lcomp;
165 
166  pips_debug(8, "considering reference to %s\n",
168 
169  generate_read_of_ref_for_computer(s, &lcomp, &lnotcomp);
170 
171  lstatcomp = gen_nconc(lstatcomp, lcomp);
172  lstatnotcomp = gen_nconc(lstatnotcomp, lnotcomp);
173  },
174  lreadreftodistarray);
175 
176  gen_free_list(lreadreftodistarray);
177 
178  /* then the updated statement is to be added to node:
179  */
180  ref = syntax_reference(expression_syntax(writtenexpr));
181  newarray = load_new_node(reference_variable(ref));
182  generate_compute_local_indices(ref, &lstat, &linds);
183  newref = make_reference(newarray, linds);
184  newreadexpr = UpdateExpressionForModule
185  (node_module, EXPRESSION(CAR(CDR(call_arguments(the_call)))));
186 
187  statcomputation =
189  newreadexpr);
190 
191  lstatcomp = gen_nconc(lstatcomp, lstat);
192  lstatcomp = gen_nconc(lstatcomp, CONS(STATEMENT, statcomputation, NIL));
193 
194  /* Update the values of the defined distributed variable
195  * if necessary...
196  */
197  generate_update_values_on_nodes(ref, newref, &lupdatecomp, &lupdatenotcomp);
198 
199  lstatcomp = gen_nconc(lstatcomp, lupdatecomp);
200  lstatnotcomp = gen_nconc(lstatnotcomp, lupdatenotcomp);
201 
202  /* the overall statements are generated.
203  */
204  statcomputecomputer = st_compute_current_computer(ref);
205  statifcomputer = st_make_nice_test(condition_computerp(),
206  lstatcomp,
207  lstatnotcomp);
208 
209  DEBUG_STAT(8, entity_name(node_module), statifcomputer);
210 
211  (*lnp) = CONS(STATEMENT, statcomputecomputer,
212  CONS(STATEMENT, statifcomputer,
213  NIL));
214  (*lhp) = NIL;
215 
216  return;
217  }
void generate_compute_local_indices(reference ref, list *lsp, list *lindsp)
generate_compute_local_indices
Definition: generate.c:388
void generate_read_of_ref_for_computer(syntax s, list *lcompp, list *lnotcompp)
generate_read_of_ref_for_computer
Definition: generate.c:275
void generate_update_values_on_nodes(reference ref, reference newref, list *lscompp, list *lsnotcompp)
generate_update_values_on_nodes
Definition: generate.c:223
bool statement_call_p(statement)
Definition: statement.c:364
statement st_make_nice_test(expression, list, list)
Definition: statement.c:1585
expression UpdateExpressionForModule(entity module, expression ex)
this function creates a new expression using the mapping of old to new variables map.
#define condition_computerp()
statement st_compute_current_computer(reference)
Computes.
Definition: run-time.c:151

References array_distributed_p(), call_arguments, call_function, CAR, CDR, condition_computerp, CONS, DEBUG_STAT, ENTITY_ASSIGN_P, entity_name, EXPRESSION, expression_syntax, FindRefToDistArray(), gen_free_list(), gen_nconc(), generate_compute_local_indices(), generate_read_of_ref_for_computer(), generate_update_values_on_nodes(), instruction_call, load_new_node(), make_assign_statement(), make_reference(), MAP, NIL, node_module, pips_assert, pips_debug, ref, reference_to_expression(), reference_variable, st_compute_current_computer(), st_make_nice_test(), STATEMENT, statement_call_p(), statement_instruction, SYNTAX, syntax_reference, syntax_reference_p, and UpdateExpressionForModule().

Referenced by hpf_compile_call().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_c1_beta()

void generate_c1_beta ( statement  stat,
list lhp,
list lnp 
)

generate.c

generate.c

these conditions are to be verifyed, by calculating the proper effects of the statement.

to be corrected later on.

this shouldn't be necessary

references to distributed arrays: w(A(I)) = B(I) so the whole list is to be considered.

generation of the code

Parameters
stattat
lhphp
lnpnp

Definition at line 41 of file generate.c.

44 {
45  statement staths, statns;
46  expression w;
47  call the_call;
48  list lreftodistarray = NIL;
49 
50  (*lhp) = NIL;
51  (*lnp) = NIL;
52 
53  pips_assert("call", statement_call_p(stat));
54 
55  the_call = instruction_call(statement_instruction(stat));
56 
57  /* this shouldn't be necessary
58  */
59  pips_assert("assignment", ENTITY_ASSIGN_P(call_function(the_call)));
60 
61  w = EXPRESSION(CAR(call_arguments(the_call)));
62 
63  pips_assert("reference",
67 
68  /* references to distributed arrays:
69  * w(A(I)) = B(I)
70  * so the whole list is to be considered.
71  */
72  lreftodistarray = FindRefToDistArrayFromList(call_arguments(the_call));
73 
74  /* generation of the code
75  */
76  MAP(SYNTAX, s,
77  {
78  list lhost;
79  list lnode;
80 
81  pips_debug(8, "considering reference to %s\n",
83 
84  generate_read_of_ref_for_all(s, &lhost, &lnode);
85 
86  (*lhp) = gen_nconc((*lhp), lhost);
87  (*lnp) = gen_nconc((*lnp), lnode);
88  },
89  lreftodistarray);
90 
91  /*
92  * then updated statements are to be added to both host and nodes:
93  */
94 
97  make_call(call_function(the_call),
99  call_arguments(the_call)))));
100 
103  make_call(call_function(the_call),
105  call_arguments(the_call)))));
106 
107  DEBUG_STAT(9, entity_name(host_module), staths);
108  DEBUG_STAT(9, entity_name(node_module), statns);
109 
110  (*lhp) = gen_nconc((*lhp), CONS(STATEMENT, staths, NIL));
111  (*lnp) = gen_nconc((*lnp), CONS(STATEMENT, statns, NIL));
112 
113  gen_free_list(lreftodistarray);
114 }
call make_call(entity a1, list a2)
Definition: ri.c:269
instruction make_instruction(enum instruction_utype tag, void *val)
Definition: ri.c:1166
void generate_read_of_ref_for_all(syntax s, list *lhp, list *lnp)
generate_read_of_ref_for_all
Definition: generate.c:316
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
Definition: statement.c:597
list lUpdateExpr(entity module, list l)
list FindRefToDistArrayFromList(list lexpr)
FindRefToDistArrayFromList.
Definition: hpfc-util.c:262
@ is_instruction_call
Definition: ri.h:1474

References array_distributed_p(), call_arguments, call_function, CAR, CONS, DEBUG_STAT, ENTITY_ASSIGN_P, entity_name, EXPRESSION, expression_syntax, FindRefToDistArrayFromList(), gen_free_list(), gen_nconc(), generate_read_of_ref_for_all(), host_module, instruction_call, instruction_to_statement(), is_instruction_call, lUpdateExpr(), make_call(), make_instruction(), MAP, NIL, node_module, pips_assert, pips_debug, reference_variable, STATEMENT, statement_call_p(), statement_instruction, SYNTAX, syntax_reference, and syntax_reference_p.

Referenced by hpf_compile_call().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_compute_local_indices()

void generate_compute_local_indices ( reference  ref,
list lsp,
list lindsp 
)

generate_compute_local_indices

this function generate the list of statement necessary to compute the local indices of the given reference. It gives back the new list of indices for the reference.

Parameters
refef
lspsp
lindspindsp

Definition at line 388 of file generate.c.

391 {
392  int i;
394  list inds = reference_indices(ref);
395 
396  pips_assert("distributed array", array_distributed_p(array));
397 
398  (*lsp) = NIL, (*lindsp) = NIL;
399 
400  pips_debug(9, "number of dimensions of %s to compute: %d\n",
402 
403  for(i=1; i<=NumberOfDimension(array); i++, inds = CDR(inds))
404  {
406  {
407  syntax s;
409  EXPRESSION(CAR(inds)), &s);
410 
412 
413  (*lsp) = gen_nconc((*lsp), CONS(STATEMENT, stat, NIL));
414  (*lindsp) =
415  gen_nconc((*lindsp), CONS(EXPRESSION,
417  }
418  else
419  {
420  expression expr =
422 
423  (*lindsp) =
424  gen_nconc((*lindsp),
425  CONS(EXPRESSION, expr, NIL));
426  }
427  }
428 
429  pips_debug(8, "result:\n");
430  ifdebug(8)
431  MAP(STATEMENT, s, DEBUG_STAT(8, entity_name(node_module), s), (*lsp));
432 }
expression make_expression(syntax a1, normalized a2)
Definition: ri.c:886
statement st_compute_ith_local_index(entity array, int i, expression expr, syntax *sp)
the returned expression is translated into variables of the node module.
Definition: generate.c:775
#define local_index_is_different_p(array, dim)
#define normalized_undefined
Definition: ri.h:1745

References array, array_distributed_p(), CAR, CDR, CONS, DEBUG_STAT, entity_name, EXPRESSION, gen_nconc(), ifdebug, local_index_is_different_p, make_expression(), MAP, NIL, node_module, normalized_undefined, NumberOfDimension(), pips_assert, pips_debug, ref, reference_indices, reference_variable, st_compute_ith_local_index(), STATEMENT, and UpdateExpressionForModule().

Referenced by generate_c1_alpha(), generate_get_value_locally(), generate_parallel_body(), generate_receive_from_computer(), generate_send_to_computer(), generate_update_distributed_value_from_host(), generate_update_values_on_computer_and_nodes(), generate_update_values_on_nodes(), and st_send_to_computer_if_necessary().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_copy_loop_nest()

statement generate_copy_loop_nest ( entity  src,
entity  trg 
)

statement generate_copy_loop_nest(src, trg) entity src, trg;

what: generates a parallel loop nest that copies src in trg. how: by building the corresponding AST. input: the two entities, which should be arrays with the same shape. output: a statement containing the loop nest. side effects:

  • adds a few new variables for the loop indexes. bugs or features:
  • could be more general?

of entities

of expressions

of dimensions

???

builds the set of indexes needed to scan the dimensions.

builds the assign statement to put in the body. TRG(indexes) = SRC(indexes)

builds the copy loop nest

Parameters
srcrc
trgrg

Definition at line 1568 of file dynamic.c.

1571 {
1572  type t = entity_type(src);
1573  list /* of entities */ indexes = NIL,
1574  /* of expressions */ idx_expr,
1575  /* of dimensions */ dims;
1577  entity module;
1578  int ndims, i;
1579 
1580  if (src==trg) return make_empty_statement();
1581 
1582  pips_assert("valid arguments",
1584  type_variable_p(t) &&
1585  load_primary_entity(src)==load_primary_entity(trg)); /* ??? */
1586 
1588  ndims = gen_length(dims);
1589 
1590  /* builds the set of indexes needed to scan the dimensions.
1591  */
1592  for(module=get_current_module_entity(), i=ndims; i>0; i--)
1593  indexes = CONS(ENTITY,
1595  indexes);
1596 
1597  idx_expr = entities_to_expressions(indexes);
1598 
1599  /* builds the assign statement to put in the body.
1600  * TRG(indexes) = SRC(indexes)
1601  */
1603  (reference_to_expression(make_reference(trg, idx_expr)),
1605 
1606  /* builds the copy loop nest
1607  */
1608  for(; ndims>0; POP(dims), POP(indexes), ndims--)
1609  {
1610  dimension d = DIMENSION(CAR(dims));
1611 
1613  (make_loop(ENTITY(CAR(indexes)),
1616  int_to_expression(1)),
1617  current,
1620  NIL));
1621  }
1622 
1623  DEBUG_STAT(7, concatenate(entity_name(src), " -> ", entity_name(trg), NULL),
1624  current);
1625 
1626  return current;
1627 }
execution make_execution(enum execution_utype tag, void *val)
Definition: ri.c:838
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
Definition: ri.c:1301
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
#define UU
Definition: newgen_types.h:98
#define loop_to_statement(l)
#define make_empty_statement
An alias for make_empty_block_statement.
list entities_to_expressions(list l_ent)
build a list of expressions from a list of entities
Definition: entity.c:2703
entity entity_empty_label(void)
Definition: entity.c:1105
@ is_execution_parallel
Definition: ri.h:1190
#define type_variable_p(x)
Definition: ri.h:2947
static size_t current
Definition: string.c:115

References array_distributed_p(), CAR, concatenate(), CONS, copy_expression(), current, DEBUG_STAT, DIMENSION, dimension_lower, dimension_upper, entities_to_expressions(), ENTITY, entity_empty_label(), entity_name, entity_type, gen_copy_seq(), gen_length(), get_current_module_entity(), hpfc_new_variable(), int_to_expression(), is_basic_int, is_execution_parallel, load_primary_entity(), loop_to_statement, make_assign_statement(), make_empty_statement, make_execution(), make_loop(), make_range(), make_reference(), MakeBasic(), module, NIL, pips_assert, POP, reference_to_expression(), src, type_variable, type_variable_p, UU, and variable_dimensions.

Referenced by clean_statement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_deducables()

statement generate_deducables ( list  le)

statement generate_deducables(list le)

the le list of expression is used to generate the deducables. The fields of interest are the variable which is referenced and the normalized field which is the expression that is going to be used to define the variable.

Parameters
leof expression

Definition at line 83 of file generate-util.c.

85 {
86  list rev = gen_nreverse(gen_copy_seq(le)), ls = NIL;
87 
88  MAP(EXPRESSION, e,
89  {
92 
93  ls = CONS(STATEMENT, Pvecteur_to_assign_statement(var, v), ls);
94  },
95  rev);
96 
97  gen_free_list(rev);
98  return make_block_statement(ls);
99 }
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
statement Pvecteur_to_assign_statement(entity var, Pvecteur v)
generates var = linear expression from the Pvecteur.
Definition: expression.c:1720

References CONS, EXPRESSION, expression_normalized, expression_reference(), gen_copy_seq(), gen_free_list(), gen_nreverse(), make_block_statement(), MAP, NIL, normalized_linear, Pvecteur_to_assign_statement(), reference_variable, and STATEMENT.

Referenced by elements_loop(), generate_io_statements_for_shared_arrays(), and GENERATION().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_full_copy()

statement generate_full_copy ( reference  left,
reference  right 
)

statement generate_full_copy(reference left, reference right)

what: copies directly right into left, that must conform... how: direct loop nest on local data input: both entities output: the returned statement side effects: bugs or features:

  • assumes that the references are ok, that is they come from a full_copy_p execution.
  • code generated based on the original entities. thus the code cleaning pass is trusted.

of entity

of dimension

indexes are reused. bounds are taken from the node entity declaration.

Parameters
lefteft
rightight

Definition at line 964 of file special_cases.c.

965 {
966  statement body;
967  int ndim, i;
968  list /* of entity */ lindexes, l,
969  /* of dimension */ ld;
971  new_array = load_new_node(array);
972 
974 
977 
978  /* indexes are reused. bounds are taken from the node entity declaration.
979  */
980  lindexes = expressions_to_entities(reference_indices(left));
982 
983  for(i=1, l=lindexes; i<=ndim; i++, POP(lindexes), POP(ld))
984  {
985  dimension d = DIMENSION(CAR(ld));
986 
988  (ENTITY(CAR(lindexes)),
991  int_to_expression(1)),
992  body,
995  NIL));
996  }
997 
998  gen_free_list(l);
999  return body;
1000 }
reference copy_reference(reference p)
REFERENCE.
Definition: ri.c:2047
list expressions_to_entities(list expressions)
map expression_to_entity on expressions
Definition: expression.c:3161
@ is_execution_sequential
Definition: ri.h:1189

References array, CAR, copy_expression(), copy_reference(), DIMENSION, dimension_lower, dimension_upper, ENTITY, entity_empty_label(), entity_type, expressions_to_entities(), gen_free_list(), gen_length(), int_to_expression(), is_execution_sequential, load_new_node(), loop_to_statement, make_assign_statement(), make_execution(), make_loop(), make_range(), NIL, POP, reference_indices, reference_to_expression(), reference_variable, type_variable, UU, and variable_dimensions.

Referenced by hpf_compile_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_get_value_locally()

void generate_get_value_locally ( reference  ref,
reference  goal,
list lstatp 
)

generate_get_value_locally

put the local value of ref in the variable local.

for every indexes, if necessary, compute the local value of the indices, by calling RTR support function LOCAL_INDEX(array_number, dimension) then the assignment is performed.

tempi = LOCAL_INDEX(array_number, dimension, indexi) ... goal = ref_local(tempi...)

Parameters
refef
goaloal
lstatpstatp

Definition at line 446 of file generate.c.

449 {
450  statement stat;
451  expression expr;
453  newarray = load_new_node(array);
454  list ls = NIL, newinds = NIL;
455 
456  pips_assert("distributed array", array_distributed_p(array));
457 
458  generate_compute_local_indices(ref, &ls, &newinds);
459  expr = reference_to_expression(make_reference(newarray, newinds));
461 
463 
464  (*lstatp) = gen_nconc(ls, CONS(STATEMENT, stat, NIL));
465 }

References array, array_distributed_p(), CONS, DEBUG_STAT, entity_name, gen_nconc(), generate_compute_local_indices(), load_new_node(), make_assign_statement(), make_reference(), NIL, node_module, pips_assert, ref, reference_to_expression(), reference_variable, and STATEMENT.

Referenced by st_get_value_for_computer(), and st_get_value_locally_and_send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_guarded_statement()

statement generate_guarded_statement ( statement  stat,
entity  proc,
list  lr 
)
Parameters
stattat
procroc
lrr

Definition at line 680 of file message-utils.c.

684 {
685  expression guard;
686 
687  return((make_guard_expression(proc, lr, &guard))?
690  make_test(guard,
691  stat,
693  (entity_empty_label()))))):
694  stat);
695 }
test make_test(expression a1, statement a2, statement a3)
Definition: ri.c:2607
statement make_continue_statement(entity)
Definition: statement.c:953
bool make_guard_expression(entity proc, list lrref, expression *pguard)
bool make_guard_expression(proc, lr, pguard)
@ is_instruction_test
Definition: ri.h:1470

References entity_empty_label(), instruction_to_statement(), is_instruction_test, make_continue_statement(), make_guard_expression(), make_instruction(), and make_test().

Referenced by loop_nest_guard(), and st_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_io_statements_for_distributed_arrays()

void generate_io_statements_for_distributed_arrays ( entity  ,
tag  ,
Psysteme  ,
Psysteme  ,
Psysteme  ,
list  ,
list  ,
list  ,
list  ,
statement ,
statement  
)

Referenced by generate_io_collect_or_update().

+ Here is the caller graph for this function:

◆ generate_io_statements_for_shared_arrays()

void generate_io_statements_for_shared_arrays ( entity  ,
tag  ,
Psysteme  ,
Psysteme  ,
list  ,
list  ,
list  ,
statement ,
statement  
)

Referenced by generate_io_collect_or_update().

+ Here is the caller graph for this function:

◆ generate_message_from_3_lists()

list generate_message_from_3_lists ( entity  array,
list  lcontent,
list  lneighbour,
list  ldomain 
)

list generate_message_from_3_lists(array, lcontent, lneighbour, ldomain)

Parameters
arrayrray
lcontentcontent
lneighbourneighbour
ldomaindomain

Definition at line 173 of file message-utils.c.

176 {
177  list lc = lcontent, ln = lneighbour, ld = ldomain, lm = NIL;
178  int len = gen_length(lcontent);
179 
180  assert(len==(int)gen_length(lneighbour) && len==(int)gen_length(ldomain));
181 
182  for ( ; lc!=NIL ; lc=CDR(lc), ln=CDR(ln), ld=CDR(ld))
183  {
184  lm = CONS(MESSAGE,
186  CONSP(CAR(lc)),
187  (Pvecteur)PVECTOR(CAR(ln)),
188  CONSP(CAR(ld))),
189  lm);
190  }
191 
192  return(lm);
193 }
message make_message(entity a1, list a2, Pvecteur a3, list a4)
Definition: message.c:54

References array, assert, CAR, CDR, CONS, CONSP, gen_length(), make_message(), MESSAGE, NIL, and PVECTOR.

Referenced by atomize_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_parallel_body()

void generate_parallel_body ( statement  body,
list lstatp,
list  lw,
list  lr 
)

the first written or read distributed ref is chosen as the computer

we are sure that computer is one of the owners

Parameters
bodyody
lstatpstatp
lww
lrr

Definition at line 511 of file generate.c.

514 {
515  statement statcc, statbody;
516  list lcomp = NIL, lcompr = NIL, lcompw = NIL,
517  lnotcomp = NIL, lnotcompr = NIL, lnotcompw = NIL;
518  syntax comp;
519 
520  pips_assert("at leat one written or read",
521  (gen_length(lw)+gen_length(lr))>0);
522 
523  /* the first written or read distributed ref is chosen as the computer
524  */
525  comp = lw? SYNTAX(CAR(lw)): SYNTAX(CAR(lr));
527 
528  MAP(SYNTAX, s,
529  {
530  list lco = NIL;
531  list lnotco = NIL;
532 
533  generate_read_of_ref_for_computer(s, &lco, &lnotco);
534 
535  lcompr = gen_nconc(lcompr, lco);
536  lnotcompr = gen_nconc(lnotcompr, lnotco);
537  },
538  lr);
539 
540  MAP(SYNTAX, s,
541  {
542  list lco = NIL;
543  list lnotco = NIL;
545  entity var = reference_variable(r);
547  entity_basic(var));
548  entity tempn ;
549 
551  tempn = load_new_node( temp);
552 
553  if (comp == s)
554  {
555  /* we are sure that computer is one of the owners
556  */
557  list lstat = NIL;
558  list linds = NIL;
559  entity newarray = load_new_node(var);
560 
561  generate_compute_local_indices(r, &lstat, &linds);
562  lstat =
563  gen_nconc
564  (lstat,
565  CONS(STATEMENT,
568  linds)),
569  entity_to_expression(tempn)),
570  NIL));
571 
573  (r, make_reference(tempn, NIL), &lco, &lnotco);
574 
575  lco = gen_nconc(lstat, lco);
576  }
577  else
578  {
580  (r, make_reference(tempn, NIL), &lco, &lnotco);
581  }
582 
583  lcompw = gen_nconc(lcompw, lco);
584  lnotcompw = gen_nconc(lnotcompw, lnotco);
585 
586  syntax_reference(s) = make_reference(temp, NIL);
587  },
588  lw);
589 
590 
591  pips_debug(6, "%zd statements for computer write:\n", gen_length(lcompw));
592 
593  ifdebug(8)
594  {
595  MAP(STATEMENT, s, DEBUG_STAT(8, entity_name(node_module), s), lcompw);
596  }
597 
598  pips_debug(6, "%zd statements for not computer write:\n",
599  gen_length(lnotcompw));
600 
601  ifdebug(8)
602  {
604  lnotcompw);
605  }
606 
607  statbody = UpdateStatementForModule(node_module, body);
608  DEBUG_STAT(7, entity_name(node_module), statbody);
609 
610  lcomp = gen_nconc(lcompr, CONS(STATEMENT, statbody, lcompw));
611  lnotcomp = gen_nconc(lnotcompr, lnotcompw);
612 
613  (*lstatp) = CONS(STATEMENT, statcc,
615  lcomp,
616  lnotcomp),
617  NIL));
618 
619  ifdebug(6)
620  {
621  pips_debug(6, "final statement:\n");
622  MAP(STATEMENT, s, DEBUG_STAT(6, entity_name(node_module),s), (*lstatp));
623  }
624 }
void generate_update_values_on_computer_and_nodes(reference ref, reference val, list *lscompp, list *lsnotcompp)
generate_update_values_on_computer_and_nodes
Definition: generate.c:634
statement UpdateStatementForModule(entity module, statement stat)
void AddEntityToHostAndNodeModules(entity e)
AddEntityToHostAndNodeModules.
Definition: hpfc-util.c:298
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
Definition: entity.c:1380
entity make_new_scalar_variable(entity, basic)
Definition: variable.c:741

References AddEntityToHostAndNodeModules(), CAR, condition_computerp, CONS, DEBUG_STAT, entity_basic(), entity_name, entity_to_expression(), gen_length(), gen_nconc(), generate_compute_local_indices(), generate_read_of_ref_for_computer(), generate_update_values_on_computer_and_nodes(), generate_update_values_on_nodes(), get_current_module_entity(), ifdebug, load_new_node(), make_assign_statement(), make_new_scalar_variable(), make_reference(), MAP, NIL, node_module, pips_assert, pips_debug, reference_to_expression(), reference_variable, st_compute_current_computer(), st_make_nice_test(), STATEMENT, SYNTAX, syntax_reference, and UpdateStatementForModule().

Referenced by hpf_compile_parallel_body().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_read_of_ref_for_all()

void generate_read_of_ref_for_all ( syntax  s,
list lhp,
list lnp 
)

generate_read_of_ref_for_all

this function organise the read of the given reference for all the nodes, and for host.

the receive statement is built for host:

COMPUTE_CURRENT_OWNERS(ref) temp = RECEIVEFROMSENDER(...)

a receive from sender is generated, however replicated the variable is FC 930623 (before was a call to st_receive_from(ref, ...))

the code for node is built, in order that temp has the wanted value.

COMPUTE_CURRENT_OWNERS(ref) IF OWNERP(ME) THEN local_ref = COMPUTE_LOCAL(ref) temp = (local_ref) IF SENDERP(ME) // this protection in case of replicated arrays. THEN SENDTOHOST(temp) SENDTONODE(ALL-OWNERS,temp) ENDIF ELSE temp = RECEIVEFROM(SENDER(...)) ENDIF

the new variable is inserted in the expression...

Parameters
lhphp
lnpnp

Definition at line 316 of file generate.c.

319 {
320  statement stathco, stathrcv, statnco, statngv;
322  entity temph, tempn,
323  var = reference_variable(ref),
325  entity_basic(var));
326 
327  pips_assert("distributed array", array_distributed_p(var));
328 
330  temph = load_new_host(temp);
331  tempn = load_new_node(temp);
332 
333  /* the receive statement is built for host:
334  *
335  * COMPUTE_CURRENT_OWNERS(ref)
336  * temp = RECEIVEFROMSENDER(...)
337  */
338  stathco = st_compute_current_owners(ref);
339 
340  /* a receive from sender is generated, however replicated the variable is
341  * FC 930623 (before was a call to st_receive_from(ref, ...))
342  */
343  stathrcv = st_receive_from(ref, make_reference(temph, NIL));
344 
345  (*lhp) = CONS(STATEMENT, stathco,
346  CONS(STATEMENT, stathrcv,
347  NIL));
348 
349  DEBUG_STAT(9, entity_name(host_module), stathco);
350  DEBUG_STAT(9, entity_name(host_module), stathrcv);
351 
352  /* the code for node is built, in order that temp has the
353  * wanted value.
354  *
355  * COMPUTE_CURRENT_OWNERS(ref)
356  * IF OWNERP(ME)
357  * THEN
358  * local_ref = COMPUTE_LOCAL(ref)
359  * temp = (local_ref)
360  * IF SENDERP(ME) // this protection in case of replicated arrays.
361  * THEN
362  * SENDTOHOST(temp)
363  * SENDTONODE(ALL-OWNERS,temp)
364  * ENDIF
365  * ELSE
366  * temp = RECEIVEFROM(SENDER(...))
367  * ENDIF
368  */
369  statnco = st_compute_current_owners(ref);
370  statngv = st_get_value_for_all(ref, make_reference(tempn, NIL));
371 
372  (*lnp) = CONS(STATEMENT, statnco, CONS(STATEMENT, statngv, NIL));
373 
374  DEBUG_STAT(9, entity_name(node_module), statnco);
375  DEBUG_STAT(9, entity_name(node_module), statngv);
376 
377  /* the new variable is inserted in the expression...
378  */
379  syntax_reference(s) = make_reference(temp, NIL);
380 }
statement st_get_value_for_all(reference ref, reference goal)
Definition: generate.c:842
statement st_receive_from(reference ref, reference goal)
if ref is replicated: goal = Receive_From_Sender()
Definition: generate.c:865
statement st_compute_current_owners(reference)
Definition: run-time.c:173

References AddEntityToHostAndNodeModules(), array_distributed_p(), CONS, DEBUG_STAT, entity_basic(), entity_name, get_current_module_entity(), host_module, load_new_host(), load_new_node(), make_new_scalar_variable(), make_reference(), NIL, node_module, pips_assert, ref, reference_variable, st_compute_current_owners(), st_get_value_for_all(), st_receive_from(), STATEMENT, and syntax_reference.

Referenced by generate_c1_beta().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_read_of_ref_for_computer()

void generate_read_of_ref_for_computer ( syntax  s,
list lcompp,
list lnotcompp 
)

generate_read_of_ref_for_computer

en cours d'adaptation...

the new variable is inserted in the expression...

Parameters
lcomppcompp
lnotcomppnotcompp

Definition at line 275 of file generate.c.

278 {
279  statement statcompco, statcompgv, statnotcompco, statnotcompmaysend;
281  entity tempn,
282  var = reference_variable(ref),
284  entity_basic(var));
285 
286  pips_assert("distributed array", array_distributed_p(var));
287 
289  tempn = load_new_node(temp);
290 
291  statcompco = st_compute_current_owners(ref);
292  statcompgv = st_get_value_for_computer(ref, make_reference(tempn, NIL));
293 
294  (*lcompp) = CONS(STATEMENT, statcompco,
295  CONS(STATEMENT, statcompgv, NIL));
296 
297  statnotcompco = st_compute_current_owners(ref);
298  statnotcompmaysend = st_send_to_computer_if_necessary(ref);
299 
300 
301  (*lnotcompp) =
302  CONS(STATEMENT, statnotcompco,
303  CONS(STATEMENT, statnotcompmaysend,
304  NIL));
305 
306  /* the new variable is inserted in the expression...
307  */
308  syntax_reference(s) = make_reference(temp, NIL);
309 }
statement st_send_to_computer_if_necessary(reference ref)
Definition: generate.c:817
statement st_get_value_for_computer(reference ref, reference goal)
Definition: generate.c:850

References AddEntityToHostAndNodeModules(), array_distributed_p(), CONS, entity_basic(), get_current_module_entity(), load_new_node(), make_new_scalar_variable(), make_reference(), NIL, pips_assert, ref, reference_variable, st_compute_current_owners(), st_get_value_for_computer(), st_send_to_computer_if_necessary(), STATEMENT, and syntax_reference.

Referenced by generate_c1_alpha(), and generate_parallel_body().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_receive_from_computer()

void generate_receive_from_computer ( reference  ref,
list lstatp 
)
Parameters
refef
lstatpstatp

Definition at line 491 of file generate.c.

494 {
495  statement statrcv;
496  entity
498  newarray = load_new_node(array);
499  list ls = NIL, newinds = NIL;
500 
501  pips_assert("distributed array", array_distributed_p(array));
502 
503  generate_compute_local_indices(ref, &ls, &newinds);
504  statrcv = st_receive_from_computer(make_reference(newarray, newinds));
505 
506  DEBUG_STAT(9, entity_name(node_module), statrcv);
507 
508  (*lstatp) = gen_nconc(ls, CONS(STATEMENT, statrcv, NIL));
509 }
#define st_receive_from_computer(goal)

References array, array_distributed_p(), CONS, DEBUG_STAT, entity_name, gen_nconc(), generate_compute_local_indices(), load_new_node(), make_reference(), NIL, node_module, pips_assert, ref, reference_variable, st_receive_from_computer, and STATEMENT.

+ Here is the call graph for this function:

◆ generate_send_to_computer()

void generate_send_to_computer ( reference  ref,
list lstatp 
)

generate_send_to_computer

sends the local value of ref to the current computer

Parameters
refef
lstatpstatp

Definition at line 471 of file generate.c.

474 {
475  statement statsnd;
476  entity
478  newarray = load_new_node(array);
479  list ls = NIL, newinds = NIL;
480 
481  pips_assert("distributed array", array_distributed_p(array));
482 
483  generate_compute_local_indices(ref, &ls, &newinds);
484  statsnd = st_send_to_computer(make_reference(newarray, newinds));
485 
486  DEBUG_STAT(9, entity_name(node_module), statsnd);
487 
488  (*lstatp) = gen_nconc(ls, CONS(STATEMENT, statsnd, NIL));
489 }
#define st_send_to_computer(val)
SND.

References array, array_distributed_p(), CONS, DEBUG_STAT, entity_name, gen_nconc(), generate_compute_local_indices(), load_new_node(), make_reference(), NIL, node_module, pips_assert, ref, reference_variable, st_send_to_computer, and STATEMENT.

+ Here is the call graph for this function:

◆ generate_subarray_shift()

statement generate_subarray_shift ( statement  s,
entity  var,
list  lshift 
)

statement generate_subarray_shift(s, var, lshift) statement s; entity var; list lshift;

generates a call to the runtime library shift subroutine for the given array, the given shift and the corresponding region in statement s. this function assumes that subarray_shift_p was true on s, and does not checks the conditions again.

gets the shifted dimension and the shift

all the arguments

Parameters
varar
lshiftshift

Definition at line 643 of file special_cases.c.

644 {
645  entity subroutine = make_shift_subroutine(var);
646  int array_number = load_hpf_number(array), shifted_dim = 0;
648  list ldecl = array_lower_upper_bounds_list(array), largs;
649  Pvecteur v;
650 
651  /* gets the shifted dimension and the shift
652  */
653  MAPL(cv,
654  {
655  v = (Pvecteur) PVECTOR(CAR(cv));
656  shifted_dim++;
657 
658  if (!vecteur_nul_p(v))
659  {
660  shift = make_vecteur_expression(v);
661  break;
662  }
663  },
664  lshift);
665 
666  pips_assert("shift defined", shift!=expression_undefined);
667  free_vector_list(lshift);
668 
669  /* all the arguments
670  */
671  largs =
673  CONS(EXPRESSION, int_to_expression(array_number),
674  CONS(EXPRESSION, int_to_expression(shifted_dim),
675  CONS(EXPRESSION, shift,
676  gen_nconc(ldecl, make_rectangular_area(s, var))))));
677 
678  return hpfc_make_call_statement(subroutine, largs);
679 }
bool vecteur_nul_p(Pvecteur v)
Definition: constraint.c:56
statement hpfc_make_call_statement(entity, list)
statement hpfc_make_call_statement(e, l) generate a call statement to function e, with expression lis...
Definition: run-time.c:318
expression make_vecteur_expression(Pvecteur pv)
make expression for vector (Pvecteur)
Definition: expression.c:1650
void free_vector_list(list l)
static entity make_shift_subroutine(entity var)
generates the needed subroutine
list make_rectangular_area(statement st, entity var)

References array, array_lower_upper_bounds_list(), CAR, CONS, entity_to_expression(), EXPRESSION, expression_undefined, free_vector_list(), gen_nconc(), hpfc_make_call_statement(), int_to_expression(), load_hpf_number(), make_rectangular_area(), make_shift_subroutine(), make_vecteur_expression(), MAPL, pips_assert, PVECTOR, and vecteur_nul_p().

Referenced by hpf_compile_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_system_for_distributed_variable()

Psysteme generate_system_for_distributed_variable ( entity  v)

Psysteme generate_system_for_variable(v) entity v;.

what: generates a system for DISTRIBUTED variable v. how: uses the declarations of v, t, p and align and distribute, and new declarations. input: entity (variable) v output: the built system, which is a new allocated system. side effects:

  • uses many functions that build and store systems... bugs or features:

Definition at line 789 of file build-system.c.

791 {
792  Psysteme result = sc_rn(NULL);
793  entity t, p;
794 
795  pips_assert("distributed array", array_distributed_p(v));
796 
799 
800  result = sc_append(result, entity_to_declaration_constraints(v, 0));
801  result = sc_append(result, entity_to_declaration_constraints(t, 1));
802  result = sc_append(result, entity_to_declaration_constraints(p, 2));
803  result = sc_append(result, entity_to_hpf_align_constraints(v));
804  result = sc_append(result, entity_to_hpf_distribute_constraints(t));
805  result = sc_append(result, entity_to_new_declaration(v));
806 
807  base_rm(sc_base(result)), sc_base(result) = NULL, sc_creer_base(result);
808 
809  return(result);
810 }
Psysteme entity_to_hpf_align_constraints(entity e)
Definition: build-system.c:480
Psysteme entity_to_declaration_constraints(entity e, tag what)
gives back the constraints due to the declarations.
Definition: build-system.c:285
Psysteme entity_to_hpf_distribute_constraints(entity e)
Definition: build-system.c:495
Psysteme entity_to_new_declaration(entity array)
Definition: build-system.c:732
Psysteme sc_rn(Pbase b)
Psysteme sc_rn(Pbase b): build a Psysteme without constraints to define R^n, where n is b's dimension...
Definition: sc_alloc.c:336
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...

References align_template, array_distributed_p(), base_rm, distribute_processors, entity_to_declaration_constraints(), entity_to_hpf_align_constraints(), entity_to_hpf_distribute_constraints(), entity_to_new_declaration(), load_hpf_alignment(), load_hpf_distribution(), pips_assert, sc_append(), sc_creer_base(), and sc_rn().

Referenced by generate_distributed_io_system(), and generate_remapping_system().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_system_for_equal_variables()

Psysteme generate_system_for_equal_variables ( int  n,
entity(*)(int gen1,
entity(*)(int gen2 
)

Definition at line 751 of file build-system.c.

755 {
756  Psysteme s = sc_rn(NULL);
757 
758  for(; n>0; n--)
760  (vect_make(VECTEUR_NUL, gen1(n), VALUE_ONE,
761  gen2(n), VALUE_MONE, TCST, VALUE_ZERO)));
762 
763  sc_creer_base(s); return s;
764 }
void sc_add_egalite(Psysteme p, Pcontrainte e)
void sc_add_egalite(Psysteme p, Pcontrainte e): macro ajoutant une egalite e a un systeme p; la base ...
Definition: sc_alloc.c:389

References contrainte_make(), sc_add_egalite(), sc_creer_base(), sc_rn(), TCST, VALUE_MONE, VALUE_ONE, VALUE_ZERO, vect_make(), and VECTEUR_NUL.

Referenced by generate_remapping_system(), and hpfc_unstutter_dummies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_update_distributed_value_from_host()

void generate_update_distributed_value_from_host ( syntax  s,
list lhstatp,
list lnstatp 
)

generate_update_distributed_value_from_host

call the necessary communication function

Parameters
lhstatphstatp
lnstatpnstatp

Definition at line 691 of file generate.c.

694 {
696  entity array, newarray, temp, temph;
697  statement statnco, stathco, stnrcv, stnif, sthsnd;
698  list linds = NIL, lnstat = NIL;
699 
700  pips_assert("distrivuted reference",
702 
704  newarray = load_new_node(array);
705 
708 
710  temph = load_new_host(temp);
711 
712  generate_compute_local_indices(r, &lnstat, &linds);
713  stnrcv = st_receive_from_host(make_reference(newarray, linds));
715  gen_nconc(lnstat,
716  CONS(STATEMENT, stnrcv, NIL)),
717  NIL);
718 
719  /* call the necessary communication function
720  */
721 
722  sthsnd = (replicated_p(array) ?
725 
726  syntax_reference(s) = make_reference(temp, NIL);
727 
728  statnco = st_compute_current_owners(r);
729  stathco = st_compute_current_owners(r);
730 
731  (*lhstatp) = CONS(STATEMENT, stathco, CONS(STATEMENT, sthsnd, NIL));
732  (*lnstatp) = CONS(STATEMENT, statnco, CONS(STATEMENT, stnif, NIL));
733 
734 }
bool replicated_p(entity e)
replicated_p
Definition: hpfc-util.c:96
#define condition_ownerp()
#define st_receive_from_host(goal)
#define st_send_to_owners(val)
#define st_send_to_owner(val)

References AddEntityToHostAndNodeModules(), array, array_distributed_p(), condition_ownerp, CONS, entity_basic(), gen_nconc(), generate_compute_local_indices(), get_current_module_entity(), load_new_host(), load_new_node(), make_new_scalar_variable(), make_reference(), NIL, pips_assert, reference_variable, replicated_p(), st_compute_current_owners(), st_make_nice_test(), st_receive_from_host, st_send_to_owner, st_send_to_owners, STATEMENT, and syntax_reference.

+ Here is the call graph for this function:

◆ generate_update_private_value_from_host()

void generate_update_private_value_from_host ( syntax  s,
list lhstatp,
list lnstatp 
)

generate_update_private_value_from_host

Parameters
lhstatphstatp
lnstatpnstatp

Definition at line 738 of file generate.c.

740 {
741  entity
743  varn = load_new_node(var),
744  varh = load_new_host(var);
745 
746  pips_assert("not distributed reference",
748 
749  (*lhstatp) = CONS(STATEMENT,
751  NIL);
752 
753  (*lnstatp) = CONS(STATEMENT,
755  NIL);
756 }
#define st_receive_mcast_from_host(goal)
#define st_host_send_to_all_nodes(val)

References array_distributed_p(), CONS, load_new_host(), load_new_node(), make_reference(), NIL, pips_assert, reference_variable, st_host_send_to_all_nodes, st_receive_mcast_from_host, STATEMENT, and syntax_reference.

+ Here is the call graph for this function:

◆ generate_update_values_on_computer_and_nodes()

void generate_update_values_on_computer_and_nodes ( reference  ref,
reference  val,
list lscompp,
list lsnotcompp 
)

generate_update_values_on_computer_and_nodes

inside a loop, a variable is defined, and the values have to be updated on the computer node itself, and on the other owners of the given variable.

computer is doing the job

all values have to be updated...

Parameters
refef
valal
lscomppscompp
lsnotcomppsnotcompp

Definition at line 634 of file generate.c.

637 {
638  entity
640  newarray = load_new_node(array);
641  statement
642  statif, statcompif, statco, statcompco, statcompassign,
643  statsndtoO, statsndtoOO, statrcvfromcomp;
644  list lstat, lstatcomp, linds, lindscomp;
645 
646  /* all values have to be updated...
647  */
648  statcompco = st_compute_current_owners(ref);
649  generate_compute_local_indices(ref, &lstatcomp, &lindscomp);
650 
651  statcompassign =
653  (reference_to_expression(make_reference(newarray, lindscomp)),
655 
656  if (replicated_p(array))
657  {
658  statsndtoOO = st_send_to_other_owners(val);
659  statsndtoO = st_send_to_owners(val);
660  }
661  else
662  {
664  statsndtoO = st_send_to_owner(val);
665  }
666  statcompif = st_make_nice_test
667  (condition_ownerp(),
668  gen_nconc(lstatcomp, CONS(STATEMENT, statcompassign,
669  CONS(STATEMENT, statsndtoOO,
670  NIL))),
671  CONS(STATEMENT, statsndtoO,
672  NIL));
673 
674  statco = st_compute_current_owners(ref);
675  generate_compute_local_indices(ref, &lstat, &linds);
676  statrcvfromcomp =
677  st_receive_from_computer(make_reference(newarray,linds));
679  gen_nconc(lstat, CONS(STATEMENT, statrcvfromcomp,
680  NIL)),
681  NIL);
682 
683  (*lscompp) = CONS(STATEMENT, statcompco,
684  CONS(STATEMENT, statcompif, NIL));
685  (*lsnotcompp) = CONS(STATEMENT, statco,
686  CONS(STATEMENT, statif, NIL));
687 }
#define st_send_to_other_owners(val)

References array, condition_ownerp, CONS, entity_undefined, gen_nconc(), generate_compute_local_indices(), load_new_node(), make_assign_statement(), make_continue_statement(), make_reference(), NIL, ref, reference_to_expression(), reference_variable, replicated_p(), st_compute_current_owners(), st_make_nice_test(), st_receive_from_computer, st_send_to_other_owners, st_send_to_owner, st_send_to_owners, and STATEMENT.

Referenced by generate_parallel_body().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_update_values_on_nodes()

void generate_update_values_on_nodes ( reference  ref,
reference  newref,
list lscompp,
list lsnotcompp 
)

generate_update_values_on_nodes

computer is doing the job

remote values have to be updated

the computer has to compute the owners in order to call the send to other owners function, because the owners are used to define the owners set, which was quite obvious:-)

bug fixed by FC, 930629

Parameters
refef
newrefewref
lscomppscompp
lsnotcomppsnotcompp

Definition at line 223 of file generate.c.

226 {
228 
229  if (replicated_p(array))
230  {
231  statement statif, statco, statco2, statsndtoon, statrcvfromcomp;
232  list lstat, linds;
233 
234  /* remote values have to be updated
235  */
236  statco = st_compute_current_owners(ref);
237 
238  /* the computer has to compute the owners in order to call
239  * the send to other owners function, because the owners
240  * are used to define the owners set, which was quite obvious:-)
241  *
242  * bug fixed by FC, 930629
243  */
244  statco2 = st_compute_current_owners(ref);
245  statsndtoon = st_send_to_other_owners(newref);
246  generate_compute_local_indices(ref, &lstat, &linds);
247  statrcvfromcomp =
249  linds));
251  gen_nconc(lstat,
252  CONS(STATEMENT,
253  statrcvfromcomp,
254  NIL)),
255  NIL);
256 
257  (*lscompp) = CONS(STATEMENT, statco2,
258  CONS(STATEMENT, statsndtoon,
259  NIL));
260  (*lsnotcompp) = CONS(STATEMENT, statco,
261  CONS(STATEMENT, statif,
262  NIL));
263  }
264  else
265  {
266  (*lscompp) = NIL;
267  (*lsnotcompp) = NIL;
268  }
269 }

References array, condition_ownerp, CONS, gen_nconc(), generate_compute_local_indices(), make_reference(), NIL, ref, reference_variable, replicated_p(), st_compute_current_owners(), st_make_nice_test(), st_receive_from_computer, st_send_to_other_owners, and STATEMENT.

Referenced by generate_c1_alpha(), and generate_parallel_body().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_alignment()

void get_alignment ( entity  array,
int  dim,
int ptdim,
int pa,
int pb 
)

a nicer interface to extract the needed information. FC 29/03/94

replication

Parameters
arrayrray
dimim
ptdimtdim
paa
pbb

Definition at line 606 of file hpfc-util.c.

609 {
611  alignment a;
612 
613  pips_assert("distributed array", array_distributed_p(array));
614 
616 
617  if (*ptdim==-1) /* replication */
618  {
619  *pa=0, *pb=0;
620  return;
621  }
622 
624 
625  if (a==alignment_undefined)
626  {
627  pips_assert("not aligned", *ptdim==0);
628  *pa = 0; *pb = 0;
629  }
630  else
631  {
632  pips_assert("aligned", *ptdim>=1);
635  }
636 }
int template_dimension_of_array_dimension(entity array, int dim)
Definition: hpfc-util.c:448

References align_alignment, alignment_constant, alignment_rate, alignment_undefined, array, array_distributed_p(), FindAlignmentOfTemplateDim(), HpfcExpressionToInt(), load_hpf_alignment(), pips_assert, and template_dimension_of_array_dimension().

Referenced by alignments_compatible_p(), and hpfc_compute_entity_to_new_declaration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_data_status()

data_status get_data_status ( void  )

??? previsous data_status lost: memory leak

Definition at line 308 of file declarations.c.

309 {
310  /* ??? previsous data_status lost: memory leak
311  */
312  return(make_data_status(get_new_declaration(),
317  list_of_processors()));
318 }
data_status make_data_status(newdeclmap a1, alignmap a2, distributemap a3, list a4, list a5, list a6)
Definition: hpf_private.c:109
alignmap get_hpf_alignment(void)
distributemap get_hpf_distribution(void)

References get_hpf_alignment(), get_hpf_distribution(), list_of_distributed_arrays(), list_of_processors(), list_of_templates(), and make_data_status().

Referenced by init_hpfc_status(), and save_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_distribution()

void get_distribution ( entity  template,
int  dim,
int ppdim,
int pn 
)
Parameters
templateemplate
dimim
ppdimpdim
pnn

Definition at line 638 of file hpfc-util.c.

641 {
645  dim, ppdim);
646 
647  *pn = (distribution_undefined_p(d) ?
649 }
#define distribution_undefined_p(x)
Definition: hpf.h:187

References distribute_distribution, distribution_parameter, distribution_undefined_p, FindDistributionOfDim(), HpfcExpressionToInt(), and load_hpf_distribution().

Referenced by hpfc_compute_entity_to_new_declaration(), and processor_dimension_of_template_dimension().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_dynamic_hpf()

entity_entities get_dynamic_hpf ( void  )

Referenced by get_dynamic_status().

+ Here is the caller graph for this function:

◆ get_dynamic_status()

dynamic_status get_dynamic_status ( void  )

get_similar_mapping()

Definition at line 99 of file dynamic.c.

100 {
103  get_renamings(),
105  /* get_similar_mapping() */
106 }
dynamic_status make_dynamic_status(entity_entities a1, entitymap a2, statement_renamings a3, statement_entities a4)
Definition: hpf_private.c:208
statement_entities get_maybeuseful_mappings(void)
statement_renamings get_renamings(void)
entity_entities get_dynamic_hpf(void)
entitymap get_primary_entity(void)

References get_dynamic_hpf(), get_maybeuseful_mappings(), get_primary_entity(), get_renamings(), and make_dynamic_status().

Referenced by init_hpfc_status(), and save_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_entity_dimensions()

void get_entity_dimensions ( entity  e,
int  dim,
int plow,
int pup 
)
Parameters
dimim
plowlow
pupup

Definition at line 651 of file hpfc-util.c.

654 {
656 
657  pips_assert("valid variable and dimension",
658  entity_variable_p(e) && dim>0 && dim<=7);
659 
660  d = entity_ith_dimension(e, dim),
661  *plow = ExpressionToInt(dimension_lower(d)),
662  *pup = ExpressionToInt(dimension_upper(d));
663 }
int ExpressionToInt(expression)
this function computes the value of an integer constant expression and returns it to the calling func...
Definition: size.c:562
#define dimension_undefined
Definition: ri.h:955

References dimension_lower, dimension_undefined, dimension_upper, entity_ith_dimension(), entity_variable_p, ExpressionToInt(), and pips_assert.

Referenced by conformant_entities_p(), extract_the_align(), full_linearization(), hpfc_compute_entity_to_new_declaration(), hpfc_compute_lid(), partial_linearization(), and safe_static_domain_bound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_entity_status()

entity_status get_entity_status ( void  )

Definition at line 93 of file host_node_entities.c.

94 {
96  get_new_node(),
97  get_old_host(),
98  get_old_node(),
100 }
entity_status make_entity_status(entitymap a1, entitymap a2, entitymap a3, entitymap a4, entity_int a5)
Definition: hpf_private.c:406
entitymap get_old_node(void)
entitymap get_old_host(void)
entitymap get_new_host(void)
entitymap get_new_node(void)
#define entity_int_undefined
Definition: ri.h:1043

References entity_int_undefined, get_new_host(), get_new_node(), get_old_host(), get_old_node(), and make_entity_status().

Referenced by init_hpfc_status(), and save_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_hpf_alignment()

alignmap get_hpf_alignment ( void  )

Referenced by get_data_status().

+ Here is the caller graph for this function:

◆ get_hpf_distribution()

distributemap get_hpf_distribution ( void  )

Referenced by get_data_status().

+ Here is the caller graph for this function:

◆ get_hpf_number()

entity_int get_hpf_number ( void  )

Referenced by get_hpf_number_status().

+ Here is the caller graph for this function:

◆ get_hpf_number_status()

numbers_status get_hpf_number_status ( void  )

Definition at line 134 of file declarations.c.

135 {
140 }
numbers_status make_numbers_status(entity_int a1, intptr_t a2, intptr_t a3, intptr_t a4)
Definition: hpf_private.c:698
static int current_template_index
Definition: declarations.c:113
static int current_array_index
Definition: declarations.c:112
static int current_processors_index
Definition: declarations.c:114
entity_int get_hpf_number(void)

References current_array_index, current_processors_index, current_template_index, get_hpf_number(), and make_numbers_status().

Referenced by init_hpfc_status(), and save_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_hpf_reductions()

statement_entities get_hpf_reductions ( void  )

Referenced by init_hpfc_status(), and save_hpfc_status().

+ Here is the caller graph for this function:

◆ get_hpfc_current_statement()

statement get_hpfc_current_statement ( void  )

Referenced by write_on_entity_p().

+ Here is the caller graph for this function:

◆ get_ith_array_dummy()

◆ get_ith_array_prime()

entity get_ith_array_prime ( int  )

Referenced by generate_remapping_system(), and remapping_variables().

+ Here is the caller graph for this function:

◆ get_ith_auxiliary_dummy()

entity get_ith_auxiliary_dummy ( int  )

Referenced by hpfc_compute_entity_to_new_declaration().

+ Here is the caller graph for this function:

◆ get_ith_auxiliary_prime()

entity get_ith_auxiliary_prime ( int  )

◆ get_ith_block_dummy()

entity get_ith_block_dummy ( int  )

◆ get_ith_block_prime()

entity get_ith_block_prime ( int  )

Referenced by remapping_variables().

+ Here is the caller graph for this function:

◆ get_ith_cycle_dummy()

entity get_ith_cycle_dummy ( int  )

◆ get_ith_cycle_prime()

entity get_ith_cycle_prime ( int  )

Referenced by remapping_variables().

+ Here is the caller graph for this function:

◆ get_ith_dim_new_declaration()

void get_ith_dim_new_declaration ( entity  array,
int  i,
int pmin,
int pmax 
)
Parameters
arrayrray
pminmin
pmaxmax

Definition at line 285 of file declarations.c.

288 {
290 
291  pips_assert("distributed array",
293 
296 }

References array, array_distributed_p(), dimension_lower, dimension_upper, entity_ith_dimension(), entity_variable_p, HpfcExpressionToInt(), load_new_node(), and pips_assert.

Referenced by hpfc_compute_entity_to_new_declaration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_ith_local_dummy()

◆ get_ith_local_prime()

entity get_ith_local_prime ( int  )

Referenced by remapping_stats(), and remapping_variables().

+ Here is the caller graph for this function:

◆ get_ith_processor_dummy()

◆ get_ith_processor_prime()

entity get_ith_processor_prime ( int  )

Referenced by broadcast(), generate_remapping_code(), generate_work_sharing_system(), and remapping_variables().

+ Here is the caller graph for this function:

◆ get_ith_region_dummy()

entity get_ith_region_dummy ( int  )

Referenced by clean_distributed_io_system(), clean_shared_io_system(), hpfc_unstutter_dummies(), and make_rectangular_area().

+ Here is the caller graph for this function:

◆ get_ith_region_prime()

entity get_ith_region_prime ( int  )

◆ get_ith_shift_dummy()

entity get_ith_shift_dummy ( int  )

Referenced by hpfc_compute_entity_to_new_declaration(), and hpfc_order_variables().

+ Here is the caller graph for this function:

◆ get_ith_shift_prime()

entity get_ith_shift_prime ( int  )

◆ get_ith_template_dummy()

◆ get_ith_template_prime()

entity get_ith_template_prime ( int  )

Referenced by remapping_variables().

+ Here is the caller graph for this function:

◆ get_ith_temporary_dummy()

entity get_ith_temporary_dummy ( int  )

◆ get_ith_temporary_prime()

entity get_ith_temporary_prime ( int  )

◆ get_maybeuseful_mappings()

statement_entities get_maybeuseful_mappings ( void  )

Referenced by get_dynamic_status().

+ Here is the caller graph for this function:

◆ get_new_host()

entitymap get_new_host ( void  )

Referenced by get_entity_status().

+ Here is the caller graph for this function:

◆ get_new_node()

entitymap get_new_node ( void  )

Referenced by get_entity_status().

+ Here is the caller graph for this function:

◆ get_old_host()

entitymap get_old_host ( void  )

Referenced by get_entity_status().

+ Here is the caller graph for this function:

◆ get_old_node()

entitymap get_old_node ( void  )

Referenced by get_entity_status().

+ Here is the caller graph for this function:

◆ get_only_io_map()

statement_mapping get_only_io_map ( void  )

◆ get_overlap()

int get_overlap ( entity  ent,
int  dim,
int  side 
)

returns the overlap for a given entity, dimension and side, to be used in the declaration modifications

returns the overlap for a given entity, dimension and side, to be used in the declaration modifications

Parameters
entnt
dimim
sideide

Definition at line 743 of file declarations.c.

746 {
747  overlap o;
748 
749  pips_assert("valid dimension", dim>0);
750  pips_debug(10, "%s (DIM=%d) %s\n", entity_name(ent), dim, side?"+":"-");
751 
752  if (!bound_overlap_status_p(ent)) create_overlaps(ent);
753  pips_assert("overlap ok", bound_overlap_status_p(ent));
754 
755  o = OVERLAP(gen_nth(dim-1, load_overlap_status(ent)));
756  return(side ? overlap_upper(o) : overlap_lower(o));
757 }
#define OVERLAP(x)
OVERLAP.
Definition: hpf_private.h:826
#define overlap_lower(x)
Definition: hpf_private.h:856
#define overlap_upper(x)
Definition: hpf_private.h:858
static void create_overlaps(entity e)
Definition: declarations.c:693
list load_overlap_status(entity)
bool bound_overlap_status_p(entity)

References assert, bound_overlap_status_p(), create_overlaps(), entity_name, gen_nth(), load_overlap_status(), OVERLAP, overlap_lower, overlap_upper, pips_assert, and pips_debug.

Referenced by deal_with_similars(), declaration_with_overlaps(), and update_overlaps_of().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_overlap_status()

overlapsmap get_overlap_status ( void  )

Referenced by init_hpfc_status(), and save_hpfc_status().

+ Here is the caller graph for this function:

◆ get_primary_entity()

entitymap get_primary_entity ( void  )

Referenced by get_dynamic_status().

+ Here is the caller graph for this function:

◆ get_read_effect_area()

Psysteme get_read_effect_area ( list  le,
entity  var 
)
Parameters
lee
varar

Definition at line 584 of file special_cases.c.

585 {
586  MAP(EFFECT, e,
587  {
588  if (action_read_p(effect_action(e)) &&
590  return effect_system(e);
591  },
592  le);
593 
594  return SC_UNDEFINED;
595 }
#define effect_system(e)
#define action_read_p(x)
Definition: effects.h:311

References action_read_p, EFFECT, effect_action, effect_any_reference, effect_system, MAP, and reference_variable.

Referenced by make_rectangular_area().

+ Here is the caller graph for this function:

◆ get_renamings()

statement_renamings get_renamings ( void  )

Referenced by get_dynamic_status().

+ Here is the caller graph for this function:

◆ get_similar_mapping()

entitymap get_similar_mapping ( void  )

◆ get_the_dynamics()

list get_the_dynamics ( void  )

Referenced by handle_hpf_directives(), and initial_alignment().

+ Here is the caller graph for this function:

◆ get_update_common_map()

entity_mapping get_update_common_map ( void  )

◆ GiveToHpfObjectsTheirNumber()

void GiveToHpfObjectsTheirNumber ( void  )

give to hpf objects listed in distributedarrays, templates and processors their number for the code generation...

Definition at line 166 of file declarations.c.

167 {
168  pips_debug(7, "Here I am!\n");
169 
170  MAP(ENTITY, e,
171  {
172  if (!bound_hpf_number_p(e))
174  },
175  distributed_arrays);
176 
177  MAP(ENTITY, e,
178  {
179  if (!bound_hpf_number_p(e))
181  },
182  templates);
183 
184  MAP(ENTITY, e,
185  {
186  if (!bound_hpf_number_p(e))
188  },
189  processors);
190 }
bool bound_hpf_number_p(entity)
void store_hpf_number(entity, intptr_t)

References bound_hpf_number_p(), current_array_index, current_processors_index, current_template_index, ENTITY, MAP, pips_debug, and store_hpf_number().

Referenced by NormalizeHpfDeclarations().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ global_array_cell_to_local_array_cell()

int global_array_cell_to_local_array_cell ( entity  array,
int  dim,
int  acell 
)

int global_array_cell_to_local_array_cell(array, dim, acell)

??? not enough general a function

Parameters
arrayrray
dimim
acellcell

Definition at line 550 of file hpfc-util.c.

553 {
555  int rate, constant;
556 
557  pips_assert("aligned", a!=alignment_undefined);
558 
561 
562  return template_cell_local_mapping(array, dim, rate*acell+constant);
563 }
int template_cell_local_mapping(entity array, int dim, int tc)
int template_cell_local_mapping(array, dim, tc)
Definition: hpfc-util.c:532
struct _newgen_struct_constant_ * constant

References alignment_constant, alignment_rate, alignment_undefined, array, FindArrayDimAlignmentOfArray, HpfcExpressionToInt(), pips_assert, and template_cell_local_mapping().

Referenced by shape_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle_hpf_directives()

void handle_hpf_directives ( statement  s,
bool  dyn 
)

void handle_hpf_directives(s) statement s;

what: handles the HPF directives in statement s. how: recurses thru the AST, looking for special "directive calls". when found, a special handler is called for the given directive. input: the code statement s output: none side effects: (many)

  • the hpfc data structures are set/updated to store the hpf mapping.
  • parallel loops are tagged parallel.
  • a static stack is used to retrieve the current statement.
  • the ctrl_graph travelling is used, so should be initialized.
  • the special calls are freed and replaced by continues. bugs or features:
  • the "new" directive is not used to tag private variables.
  • a non hpf "pure" directive is parsed.

INITIALIZE needed static stuff

PHASE 1

PHASE 2

PHASE 3

OPTIMIZATION

CLEAN

Parameters
dynyn

Definition at line 1069 of file directives.c.

1070 {
1071  /* INITIALIZE needed static stuff
1072  */
1073  make_current_stmt_stack();
1074  to_be_cleaned = NIL;
1075 
1076  if (!dyn)
1077  {
1078  /* PHASE 1
1079  */
1080  pips_debug(1, "starting phase 1\n");
1081  analysis_phase = 1;
1083  statement_domain, current_stmt_filter, current_stmt_rewrite,
1086  NULL);
1087  }
1088  else
1089  {
1090  /* PHASE 2
1091  */
1094  store_renamings(s, NIL);
1095 
1096  pips_debug(1, "starting phase 2\n");
1097  analysis_phase = 2;
1099  statement_domain, current_stmt_filter, current_stmt_rewrite,
1101  NULL);
1102 
1103  DEBUG_STAT(7, "between phase 2 and 3", s);
1104 
1105 
1106  /* PHASE 3
1107  */
1108  pips_debug(1, "starting phase 3\n");
1109  analysis_phase = 3;
1112  statement_domain, current_stmt_filter, current_stmt_rewrite,
1115  NULL);
1116 
1117  initial_alignment(s);
1118 
1119  ifdebug(7) dump_current_remapping_graph("after phase 3");
1120  DEBUG_STAT(7, "after phase 3", s);
1121 
1122  /* OPTIMIZATION
1123  */
1124  if (get_bool_property("HPFC_OPTIMIZE_REMAPPINGS"))
1125  {
1126  pips_debug(1, "starting optimization phase\n");
1128  }
1129 
1130  clean_ctrl_graph();
1131 
1133 
1136 
1137  DEBUG_STAT(7, "after optimization phase", s);
1138  }
1139 
1140  /* CLEAN
1141  */
1143  pips_assert("empty stack", current_stmt_empty_p());
1145  free_current_stmt_stack();
1146 
1147  DEBUG_CODE(5, "resulting code", get_current_module_entity(), s);
1148 }
void build_full_ctrl_graph(statement)
Definition: graph.c:238
void clean_ctrl_graph(void)
global mapping from statements to their control in the full control graph
Definition: graph.c:53
void close_dynamic_locals()
Definition: dynamic.c:817
void init_dynamic_locals()
DYNAMIC LOCAL DATA.
Definition: dynamic.c:806
void dump_current_remapping_graph(string when)
Definition: dynamic.c:1440
void simplify_remapping_graph(void)
void simplify_remapping_graph()
Definition: dynamic.c:1467
void hpfc_check_for_similarities(list le)
check all dynamic arrays for some similars...
Definition: dynamic.c:269
if(!(yy_init))
Definition: genread_lex.c:1029
bool gen_false(__attribute__((unused)) gen_chunk *unused)
Return false and ignore the argument.
Definition: genClib.c:2796
#define DEBUG_CODE(D, W, M, S)
static void initial_alignment(statement s)
handle s as the initial alignment...
Definition: directives.c:332
static bool prescription_filter(call c)
Definition: directives.c:1038
static bool directive_filter(call c)
newgen recursion thru the IR.
Definition: directives.c:1017
static int analysis_phase
HPFC module by Fabien COELHO.
Definition: directives.c:44
static list to_be_cleaned
list of statements to be cleaned.
Definition: directives.c:51
static void clean_statement(statement s)
the directive is freed and replaced by a continue call or a copy loop nest, depending on the renaming...
Definition: directives.c:56
list get_the_dynamics(void)
void close_the_dynamics(void)
void init_the_dynamics(void)
void store_renamings(statement, list)

References analysis_phase, build_full_ctrl_graph(), call_domain, clean_ctrl_graph(), clean_statement(), close_dynamic_locals(), close_the_dynamics(), DEBUG_CODE, DEBUG_STAT, directive_filter(), dump_current_remapping_graph(), expression_domain, gen_false(), gen_free_list(), gen_map(), gen_multi_recurse(), gen_null(), get_bool_property(), get_current_module_entity(), get_the_dynamics(), hpfc_check_for_similarities(), ifdebug, init_dynamic_locals(), init_the_dynamics(), initial_alignment(), NIL, pips_assert, pips_debug, prescription_filter(), simplify_remapping_graph(), statement_domain, store_renamings(), and to_be_cleaned.

Referenced by hpfc_directives_handler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle_hpf_reduction()

list handle_hpf_reduction ( statement  s)

of hpfc_reductions

of hpfc_reductions

Definition at line 274 of file special_cases.c.

275 {
276  list /* of hpfc_reductions */ lr = NIL;
277 
278  MAP(ENTITY, e,
279  lr = CONS(HPFC_REDUCTIONS, reduction_of_in(e, s), lr),
281 
282  return lr;
283 }
entities load_hpf_reductions(statement)
static hpfc_reductions reduction_of_in(entity e, statement s)
finally, I can do without replacement: the host keeps and contributes the initial value!

References CONS, entities_list, ENTITY, HPFC_REDUCTIONS, load_hpf_reductions(), MAP, NIL, and reduction_of_in().

Referenced by hpf_compiler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpf_alignment_undefined_p()

bool hpf_alignment_undefined_p ( void  )

◆ hpf_compiler()

void hpf_compiler ( statement  stat,
statement hoststatp,
statement nodestatp 
)

what: compile a statement into a host and SPMD node code.

how: double code rewriting in a recursive traversal of stat. input: statement stat. output: statements *hoststatp and *nodestatp side effects: ? bugs or features:

  • special care is made here of I/O and remappings.

of hpfc_reduction

necessary

remapping

HPF REDUCTION

else usual stuff

of statement

Parameters
stattat
hoststatpoststatp
nodestatpodestatp

Definition at line 710 of file compiler.c.

714 {
715  list /* of hpfc_reduction */ lr = NIL;
716  bool root_statement_p = stat==get_current_module_statement();
717 
718  DEBUG_STAT(9, "stat is", stat);
719  pips_debug(9, "only io %d, remapping %d, reduction %d\n",
721  bound_renamings_p(stat),
722  bound_hpf_reductions_p(stat));
723 
724  if (load_statement_only_io(stat)==1) /* necessary */
725  {
726  io_efficient_compile(stat, hoststatp, nodestatp);
727  return;
728  }
729  else if (bound_renamings_p(stat) && !root_statement_p) /* remapping */
730  {
731  remapping_compile(stat, hoststatp, nodestatp);
732  return;
733  }
734 
735  if (bound_hpf_reductions_p(stat)) /* HPF REDUCTION */
736  lr = handle_hpf_reduction(stat);
737 
738  /* else usual stuff
739  */
741  {
743  hpf_compile_block(stat, hoststatp, nodestatp);
744  break;
745  case is_instruction_test:
746  hpf_compile_test(stat, hoststatp, nodestatp);
747  break;
748  case is_instruction_loop:
749  hpf_compile_loop(stat, hoststatp, nodestatp);
750  break;
751  case is_instruction_call:
752  hpf_compile_call(stat, hoststatp, nodestatp);
753  break;
755  hpf_compile_unstructured(stat, hoststatp, nodestatp);
756  break;
757  case is_instruction_goto:
758  default:
759  pips_internal_error("unexpected instruction tag");
760  break;
761  }
762 
763  if (lr)
764  {
765  list /* of statement */ lh, ln;
766  lh = gen_nconc(compile_hpf_reduction(lr, true, true),
767  CONS(STATEMENT, *hoststatp,
768  compile_hpf_reduction(lr, false, true)));
769  ln = gen_nconc(compile_hpf_reduction(lr, true, false),
770  CONS(STATEMENT, *nodestatp,
771  compile_hpf_reduction(lr, false, false)));
772 
773  *hoststatp = make_block_statement(lh);
774  *nodestatp = make_block_statement(ln);
775  }
776 
777  if (root_statement_p && bound_renamings_p(stat))
778  {
779  *nodestatp = make_block_statement(
781  CONS(STATEMENT, *nodestatp, NIL)));
782  }
783 }
static void hpf_compile_loop(statement stat, statement *hoststatp, statement *nodestatp)
Definition: compiler.c:623
static void hpf_compile_call(statement stat, statement *hoststatp, statement *nodestatp)
returned node version
Definition: compiler.c:175
static void hpf_compile_unstructured(statement stat, statement *hoststatp, statement *nodestatp)
Definition: compiler.c:348
static void hpf_compile_test(statement s, statement *hoststatp, statement *nodestatp)
Definition: compiler.c:87
static void hpf_compile_block(statement stat, statement *hoststatp, statement *nodestatp)
Definition: compiler.c:58
statement get_current_module_statement(void)
Get the current module statement.
Definition: static.c:208
void remapping_compile(statement, statement *, statement *)
void remapping_compile(s, hsp, nsp) statement s, *hsp, *nsp;
Definition: remapping.c:1302
bool bound_hpf_reductions_p(statement)
bool bound_renamings_p(statement)
statement root_statement_remapping_inits(statement)
returns the initialization statement: must initialize the status and liveness of arrays
Definition: remapping.c:1265
void io_efficient_compile(statement, statement *, statement *)
compile an io statement
Definition: io-compile.c:911
list compile_hpf_reduction(list, bool, bool)
of statement
list handle_hpf_reduction(statement)
of hpfc_reductions
bool load_statement_only_io(statement)
#define is_instruction_block
soft block->sequence transition
@ is_instruction_goto
Definition: ri.h:1473
@ is_instruction_unstructured
Definition: ri.h:1475
@ is_instruction_loop
Definition: ri.h:1471
#define instruction_tag(x)
Definition: ri.h:1511

References bound_hpf_reductions_p(), bound_renamings_p(), compile_hpf_reduction(), CONS, DEBUG_STAT, gen_nconc(), get_current_module_statement(), handle_hpf_reduction(), hpf_compile_block(), hpf_compile_call(), hpf_compile_loop(), hpf_compile_test(), hpf_compile_unstructured(), instruction_tag, io_efficient_compile(), is_instruction_block, is_instruction_call, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, load_statement_only_io(), make_block_statement(), NIL, pips_debug, pips_internal_error, remapping_compile(), root_statement_remapping_inits(), STATEMENT, and statement_instruction.

Referenced by compile_control(), compile_module(), hpf_compile_block(), hpf_compile_sequential_loop(), hpf_compile_test(), and hpf_compile_unstructured().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpf_distribution_undefined_p()

bool hpf_distribution_undefined_p ( void  )

◆ hpf_number_undefined_p()

bool hpf_number_undefined_p ( void  )

◆ hpf_pure_p()

bool hpf_pure_p ( entity  f)

??? some intrinsics should also be considered as pure.

all of them ?

Definition at line 67 of file hpfc.c.

68 { return gen_in_list_p(f, the_pures_object);}

References f(), and gen_in_list_p().

Referenced by hpfc_compile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpf_reductions_undefined_p()

bool hpf_reductions_undefined_p ( void  )

hpfc.c

◆ hpfc_add_2()

statement hpfc_add_2 ( expression  exp)

expr = expr + 2

Parameters
expxp

Definition at line 141 of file generate-util.c.

143 {
145  return(make_assign_statement
146  (copy_expression(exp),
147  MakeBinaryCall(plus, exp, int_to_expression(2))));
148 
149 }
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References copy_expression(), entity_intrinsic(), exp, int_to_expression(), make_assign_statement(), MakeBinaryCall(), and PLUS_OPERATOR_NAME.

Referenced by hpfc_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_add_ahead_of_node_code()

void hpfc_add_ahead_of_node_code ( statement  s)

Definition at line 404 of file hpfc.c.

405 {
407 }
static list added_ahead_of_node_code
??? some quick hack to move bound computations ahead if possible
Definition: hpfc.c:402

References added_ahead_of_node_code, CONS, and STATEMENT.

Referenced by generate_optimized_code_for_loop_nest().

+ Here is the caller graph for this function:

◆ hpfc_add_n()

statement hpfc_add_n ( entity  var,
int  n 
)

returns statement VAR = VAR + N

added value

Parameters
varar
ninteger scalar variable

Definition at line 128 of file generate-util.c.

References entity_intrinsic(), entity_to_expression(), int_to_expression(), make_assign_statement(), MakeBinaryCall(), and PLUS_OPERATOR_NAME.

Referenced by hpfc_buffer_packing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_algorithm_row_echelon()

void hpfc_algorithm_row_echelon ( Psysteme  syst,
list  scanners,
Psysteme pcond,
Psysteme penum 
)

io-compile.c

this should improve conditions?

Parameters
systyst
scannerscanners
pcondcond
penumenum

Definition at line 127 of file io-compile.c.

132 {
133  Pbase base = entity_list_to_base(scanners);
134  algorithm_row_echelon_generic(syst, base, pcond, penum,
135  get_bool_property("HPFC_REDUNDANT_SYSTEMS_FOR_REMAPS"));
136  /* this should improve conditions? */
137  sc_find_equalities(pcond);
138  base_rm(base);
139 }
bdt base
Current expression.
Definition: bdt_read_paf.c:100
Pbase entity_list_to_base(list l)
Definition: entity.c:2860
void algorithm_row_echelon_generic(Psysteme scn, Pbase base_index, Psysteme *pcondition, Psysteme *penumeration, bool redundancy)
each variable should be at least within one <= and one >=; scn IS NOT modified.
void sc_find_equalities(Psysteme *ps)

References algorithm_row_echelon_generic(), base, base_rm, entity_list_to_base(), get_bool_property(), and sc_find_equalities().

Referenced by generate_io_collect_or_update(), hpf_remapping(), and processor_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_algorithm_tiling()

void hpfc_algorithm_tiling ( Psysteme  syst,
list  processors,
list  scanners,
Psysteme pcondition,
Psysteme pproc_echelon,
Psysteme ptile_echelon 
)
Parameters
systyst
processorsrocessors
scannerscanners
pconditioncondition
pproc_echelonproc_echelon
ptile_echelontile_echelon

Definition at line 689 of file io-compile.c.

696 {
697  Pbase
698  outer = entity_list_to_base(processors),
699  inner = entity_list_to_base(scanners);
700 
701  DEBUG_SYST(8, "initial system", syst);
702 
703  algorithm_tiling(syst, outer, inner,
704  pcondition, pproc_echelon, ptile_echelon);
705 
706  DEBUG_SYST(3, "condition", *pcondition);
707  DEBUG_BASE(3, "proc vars", outer);
708  DEBUG_SYST(3, "processors", *pproc_echelon);
709  DEBUG_BASE(3, "tile vars", inner);
710  DEBUG_SYST(3, "tiles", *ptile_echelon);
711 
712  base_rm(outer);
713  base_rm(inner);
714 }
void algorithm_tiling(Psysteme syst, Pbase outer, Pbase inner, Psysteme *pcondition, Psysteme *ptile_enum, Psysteme *piter_enum)

References algorithm_tiling(), base_rm, DEBUG_BASE, DEBUG_SYST, and entity_list_to_base().

Referenced by generate_io_collect_or_update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_array_bound()

expression hpfc_array_bound ( entity  array,
bool  upper,
int  dim 
)
Parameters
arrayrray
upperpper
dimim

Definition at line 516 of file run-time.c.

517 {
518  /*
519  return entity_to_expression
520  (argument_bound_entity(node_module, array, upper, dim));
521  */
523  upper?UPPER:LOWER, dim));
524 }

References array, bound_parameter_name(), LOWER, MakeCharacterConstantExpression(), and UPPER.

Referenced by array_bounds_list(), caller_list_of_bounds(), and declaration_with_overlaps().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_broadcast_if_necessary()

statement hpfc_broadcast_if_necessary ( entity  array,
entity  trg,
entity  lid,
entity  proc,
bool  is_lazy 
)

lazy or not...

Parameters
arrayrray
trgrg
lidid
procroc
is_lazys_lazy

Definition at line 404 of file generate-util.c.

410 {
411  expression not_empty;
412  statement send, pack;
413 
414  not_empty = buffer_full_condition(array, true, false);
415  send = hpfc_broadcast_buffers(array, trg, lid, proc);
417 
418  if (is_lazy)
419  return test_to_statement
420  (make_test(not_empty,
422  CONS(STATEMENT, send, NIL))),
424  else
425  return make_block_statement
426  (CONS(STATEMENT, test_to_statement(make_test(not_empty, pack,
431  NIL)));
432 }
static statement hpfc_broadcast_buffers(entity src, entity trg, entity lid, entity proc)
send the buffer, possibly a broadcast.
static expression buffer_full_condition(entity array, bool is_send, bool is_full)
generates the condition for testing the buffer state: returns (BUFFER_INDEX.
statement hpfc_packing_of_current__buffer(entity array, bool pack)
CALL (pvmtype) HPFC {,UN}PACK.
#define SND_NOT_INIT
#define test_to_statement(t)
#define not_expression(e)

References array, buffer_full_condition(), CONS, entity_to_expression(), entity_undefined, hpfc_broadcast_buffers(), hpfc_name_to_entity(), hpfc_packing_of_current__buffer(), make_block_statement(), make_continue_statement(), make_test(), NIL, not_expression, SND_NOT_INIT, STATEMENT, and test_to_statement.

Referenced by gen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_buffer_initialization()

statement hpfc_buffer_initialization ( bool  ,
bool  ,
bool   
)

◆ hpfc_buffer_packing()

statement hpfc_buffer_packing ( entity  ,
entity(*)(void)  ,
bool   
)

◆ hpfc_buffer_reference()

expression hpfc_buffer_reference ( entity  array,
entity  index 
)

returns a reference to the typed common hpfc_buffer buffer, that suits array basic type and with index as an index.

index variable

Parameters
arrayrray
indexarray to select the right typed buffer

Definition at line 267 of file generate-util.c.

270 {
274  NIL)));
275 }
static entity hpfc_buffer_entity(entity array, string suffix)
returns the buffer entity for array
#define BUFFER
common /hpfc_buffers/

References array, BUFFER, CONS, entity_to_expression(), EXPRESSION, hpfc_buffer_entity(), make_reference(), NIL, and reference_to_expression().

Referenced by hpfc_buffer_packing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_call_with_distributed_args_p()

bool hpfc_call_with_distributed_args_p ( call  c)

whether call c inplies a distributed argument

no intrinsics

else checks for distributed arguments

Definition at line 645 of file dynamic.c.

646 {
647  entity f = call_function(c);
648  int len = gen_length(call_arguments(c));
649 
650  /* no intrinsics */
652  hpf_directive_entity_p(f)) return false;
653 
654  /* else checks for distributed arguments */
655  for (; len>0; len--)
656  {
657  entity arg = find_ith_parameter(f, len);
658  if (array_distributed_p(arg)) return true;
659  }
660 
661  return false;
662 }
bool hpf_directive_entity_p(entity e)
Definition: hpfc.c:56
entity find_ith_parameter(entity, int)
Definition: util.c:93
#define value_intrinsic_p(x)
Definition: ri.h:3074
#define entity_initial(x)
Definition: ri.h:2796

References array_distributed_p(), call_arguments, call_function, entity_initial, f(), find_ith_parameter(), gen_length(), hpf_directive_entity_p(), and value_intrinsic_p.

Referenced by prescription_filter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_check_for_similarities()

void hpfc_check_for_similarities ( list  le)

check all dynamic arrays for some similars...

of entity

similar bases

Parameters
lee

Definition at line 269 of file dynamic.c.

270 {
271  MAP(ENTITY, array,
272  {
274  {
275  list /* of entity */
276  seens = CONS(ENTITY, array, NIL); /* similar bases */
277 
278  pips_assert("is a primary!", primary_entity_p(array));
279 
281 
282  MAP(ENTITY, a,
283  {
284  if (!gen_in_list_p(a, seens))
285  {
286  entity similar;
287  check_for_similarity(a, seens);
288  similar = load_similar_mapping(a);
289  pips_debug(1, "%s similar to %s\n",
290  entity_name(a), entity_name(similar));
291 
292  seens = gen_once(similar, seens);
293  }
294  },
296 
297  gen_free_list(seens);
298  }
299  },
300  le);
301 }
static void check_for_similarity(entity a, list others)
Definition: dynamic.c:230

References array, array_distributed_p(), check_for_similarity(), CONS, entities_list, ENTITY, entity_name, gen_free_list(), gen_in_list_p(), gen_once(), load_dynamic_hpf(), load_similar_mapping(), MAP, NIL, pips_assert, pips_debug, and primary_entity_p.

Referenced by handle_hpf_directives().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_close()

bool hpfc_close ( const string  name)

bool hpfc_close(string name)

what: closes the hpf compiler execution. to be called by pipsmake. input: the program (workspace) name. output: none. side effects:

  • deals with the commons.
  • generates global files. bugs or features:
  • ??? COMMON should be managable thru pipsmake ad-hoc rules.

global informations

not close, because it would free the memory and pipsdbm will run into troubles when trying to free the resource...

??? the next function is in pipsmake... (should be in pipsdbm only, but pipsmake manages its own cache which must be destroyed also...

fake

Parameters
nameame

Definition at line 798 of file hpfc.c.

799 {
800  debug_on("HPFC_DEBUG_LEVEL");
801  pips_debug(1, "considering program %s\n", name);
803 
805 
806  set_string_property("PRETTYPRINT_COMMONS", "declaration");
807  set_string_property("PIPSDBM_RESOURCES_TO_DELETE", "all");
808  gen_map((gen_iter_func_t)compile_common, get_the_commons());
809 
810  put_generated_resources_for_program(name); /* global informations */
811 
812  /* not close, because it would free the memory and
813  * pipsdbm will run into troubles when trying to free the resource...
814  */
816 
817  /* ??? the next function is in pipsmake... (should be in pipsdbm only,
818  * but pipsmake manages its own cache which must be destroyed also...
819  */
820  DB_PUT_FILE_RESOURCE(DBR_HPFC_COMMONS, name, NO_FILE); /* fake */
821 
823  debug_off();
824  return true;
825 }
void put_generated_resources_for_program(_UNUSED_ string program_name)
Definition: compile.c:567
static void save_hpfc_status()
GET them.
Definition: hpfc.c:209
static void compile_common(entity c)
Definition: hpfc.c:51
static void hpfc_error_handler(void)
Definition: hpfc.c:265
static void load_hpfc_status()
SET them.
Definition: hpfc.c:229
#define debug_on(env)
Definition: misc-local.h:157
#define debug_off()
Definition: misc-local.h:160
void reset_hooks_unregister(reset_func_t)
remove registered cleanup hook.
Definition: reset_hooks.c:73
void reset_hooks_register(reset_func_t)
reset_hooks.c
Definition: reset_hooks.c:44
void set_string_property(const char *, const char *)

References compile_common(), DB_PUT_FILE_RESOURCE, debug_off, debug_on, gen_map(), hpfc_error_handler(), load_hpfc_status(), NO_FILE, pips_debug, put_generated_resources_for_program(), reset_hooks_register(), reset_hooks_unregister(), save_hpfc_status(), and set_string_property().

+ Here is the call graph for this function:

◆ hpfc_close_dummy_to_prime()

void hpfc_close_dummy_to_prime ( void  )

Definition at line 168 of file build-system.c.

169 {
170  close_dummy_to_prime();
171 }

Referenced by compile_module().

+ Here is the caller graph for this function:

◆ hpfc_common()

bool hpfc_common ( const string  name)

bool hpfc_common(string name)

what: compile a common, that is generate the common for both host and nodes. how: generate files to be included. input: a common name. output: none. side effects:

  • uses the hpfc_status.
  • generates 4 files. bugs or features:
  • never called by pipsmake (:-)
Parameters
nameame

Definition at line 769 of file hpfc.c.

770 {
771  debug_on("HPFC_DEBUG_LEVEL");
772  pips_debug(1, "considering common %s\n", name);
774 
776 
777  set_string_property("PRETTYPRINT_COMMONS", "declaration");
779 
781 
783  debug_off();
784  return true;
785 }
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450

References compile_common(), debug_off, debug_on, hpfc_error_handler(), load_hpfc_status(), local_name_to_top_level_entity(), pips_debug, reset_hooks_register(), reset_hooks_unregister(), save_hpfc_status(), and set_string_property().

+ Here is the call graph for this function:

◆ hpfc_compile()

bool hpfc_compile ( const string  name)

bool hpfc_compile(string name)

what: hpf compile module name. to be called by pipsmake. input: the name of the module to compile. output: none side effects: (many)

  • creates the statements for the host and nodes.
  • store the generated resources. bugs or features:
  • fortran library, reduction and hpfc special functions are skipped.
  • a fake file is put as the generated resource for such modules.

just fake for pipsmake...

for callers

Parameters
nameame

Definition at line 699 of file hpfc.c.

700 {
702  bool do_compile;
703 
704  debug_on("HPFC_DEBUG_LEVEL");
705  pips_debug(1, "considering module %s\n", name);
707 
710 
711  do_compile =
716 
717  if (do_compile)
718  {
719  set_string_property("PRETTYPRINT_COMMONS", "none");
720 
721  if (hpfc_special_io(module))
723  else if (hpf_pure_p(module))
725  else
727  }
728  else /* just fake for pipsmake... */
729  {
730  pips_debug(2, "skipping %s compilation\n", name);
731  DB_PUT_FILE_RESOURCE(DBR_HPFC_PARAMETERS, name, NO_FILE);
732  DB_PUT_FILE_RESOURCE(DBR_HPFC_HOST, name, NO_FILE);
733  DB_PUT_FILE_RESOURCE(DBR_HPFC_NODE, name, NO_FILE);
734  DB_PUT_FILE_RESOURCE(DBR_HPFC_RTINIT, name, NO_FILE);
735  }
736 
737  /* for callers */
738  if (hpfc_special_io(module))
739  {
742  }
743  else if (hpf_pure_p(module))
744  {
747  }
748 
751 
753  debug_off();
754  return true;
755 }
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
void compile_a_special_io_function(entity module)
just copied for the host
Definition: compile.c:469
void compile_a_pure_function(entity module)
simply copied for both host and node...
Definition: compile.c:493
bool hpfc_special_fake(entity f)
Definition: hpfc.c:91
static void compile_module(entity module)
Definition: hpfc.c:410
bool hpf_pure_p(entity f)
??? some intrinsics should also be considered as pure.
Definition: hpfc.c:67
bool hpfc_special_io(entity f)
Definition: hpfc.c:77
bool fortran_library_entity_p(entity)
Definition: local-ri-util.c:52
bool hpfc_entity_reduction_p(entity)
special_cases.c
Definition: special_cases.c:82
#define CONTINUE_FUNCTION_NAME
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479

References compile_a_pure_function(), compile_a_special_io_function(), compile_module(), CONTINUE_FUNCTION_NAME, DB_PUT_FILE_RESOURCE, debug_off, debug_on, entity_intrinsic(), fortran_library_entity_p(), hpf_directive_entity_p(), hpf_pure_p(), hpfc_entity_reduction_p(), hpfc_error_handler(), hpfc_special_fake(), hpfc_special_io(), load_hpfc_status(), module, module_name_to_entity(), NO_FILE, pips_debug, reset_current_module_entity(), reset_hooks_register(), reset_hooks_unregister(), save_hpfc_status(), set_current_module_entity(), set_string_property(), store_new_host_variable(), and store_new_node_variable().

+ Here is the call graph for this function:

◆ hpfc_compile_error_handler()

void hpfc_compile_error_handler ( void  )

Definition at line 644 of file compile.c.

645 {
646  error_reset_c_stmt_stack();
647 }

Referenced by hpfc_error_handler().

+ Here is the caller graph for this function:

◆ hpfc_compute_entity_to_new_declaration()

Psysteme hpfc_compute_entity_to_new_declaration ( entity  array)

LALPHAi == ALPHAi

LALPHAi = ALPHAi - ALPHAi_min + 1

(|a|==1) LALPHA_i == DELTA_j + 1 generalized to: (|a|!=1) |a| * (LALPHA_i - 1) + IOTA_j == DELTA_j 0 <= IOTA_j < |a|

IOTA is not needed

LALPHA_i == N* (GAMMA_j - GAMMA_0) + DELTA_j + 1

LALPHA_i = iceil(N,|a|) * (GAMMA_j - GAMMA_0) + SIGMA_j +1 DELTA_j = |a|*SIGMA_j + IOTA_j 0 <= IOTA_j < |a|

Parameters
arrayrray

Definition at line 533 of file build-system.c.

535 {
536  int dim = NumberOfDimension(array);
537  Psysteme syst = sc_rn(NULL);
538 
539  pips_assert("distributed array", array_distributed_p(array));
540 
541  for (; dim>0; dim--)
542  {
543  entity lalpha = get_ith_local_dummy(dim),
544  alpha = get_ith_array_dummy(dim);
545 
546  switch (new_declaration_tag(array, dim))
547  {
548  case is_hpf_newdecl_none:
549  /* LALPHAi == ALPHAi
550  */
552  (syst,
554  alpha, VALUE_ONE,
555  lalpha, VALUE_MONE,
556  TCST, VALUE_ZERO)));
557  break;
559  {
560  /* LALPHAi = ALPHAi - ALPHAi_min + 1
561  */
562  int min = 314159;
563  int max = -314159;
564 
566 
568  (syst,
570  alpha, VALUE_ONE,
571  lalpha, VALUE_MONE,
572  TCST, int_to_value(1-min))));
573 
574  break;
575  }
576  case is_hpf_newdecl_beta:
577  {
578  /* (|a|==1) LALPHA_i == DELTA_j + 1
579  * generalized to:
580  * (|a|!=1) |a| * (LALPHA_i - 1) + IOTA_j == DELTA_j
581  * 0 <= IOTA_j < |a|
582  */
583  entity delta, template = array_to_template(array);
584  int tdim, pdim, a, b, n;
585 
586  get_alignment(array, dim, &tdim, &a, &b);
587  pips_assert("aligned dimension", a!=0 && tdim!=0);
588  get_distribution(template, tdim, &pdim, &n);
589 
590  delta = get_ith_block_dummy(pdim);
591 
592  if (abs(a)==1)
593  {
594  /* IOTA is not needed */
595  sc_add_egalite(syst,
597  delta, VALUE_ONE,
598  lalpha, VALUE_MONE,
599  TCST, VALUE_ONE)));
600  }
601  else
602  {
603  entity iota = get_ith_shift_dummy(pdim);
604  Pvecteur
605  v1 = vect_make(VECTEUR_NUL,
606  (Variable) lalpha, int_to_value(abs(a)),
607  (Variable) iota, VALUE_ONE,
608  (Variable) delta, VALUE_MONE,
609  TCST, int_to_value(-abs(a)));
610 
611  sc_add_egalite(syst, contrainte_make(v1));
612  sc_add_inegalite(syst,
614  VALUE_MONE)));
616  (syst,
618  (Variable) iota, VALUE_ONE,
619  TCST, int_to_value(-(abs(a)-1)))));
620  }
621 
622  break;
623  }
625  {
626  /* LALPHA_i == N* (GAMMA_j - GAMMA_0) + DELTA_j + 1
627  */
628  entity
629  gamma = entity_undefined,
630  delta = entity_undefined,
631  template = array_to_template(array),
632  processor = template_to_processors(template);
633  int gamma_0 = 0, tdim = -1, pdim = -1, a = 0, b = 0,
634  n, plow, pup, tlow, tup, alow, aup;
635 
636  get_alignment(array, dim, &tdim, &a, &b);
637  pips_assert("stride-1 aligned", abs(a)==1 && tdim!=0);
638 
639  get_distribution(template, tdim, &pdim, &n);
640  pips_assert("distributed dimension", pdim>0 && n>0);
641 
642  get_entity_dimensions(array, dim, &alow, &aup);
643  get_entity_dimensions(template, tdim, &tlow, &tup);
644  get_entity_dimensions(processor, pdim, &plow, &pup);
645 
646  delta = get_ith_block_dummy(pdim);
647  gamma = get_ith_cycle_dummy(pdim);
648 
649  gamma_0 = (a*alow + b - tlow) % (n * (pup - plow + 1));
650 
652  (syst,
654  (VECTEUR_NUL,
655  delta, VALUE_ONE,
656  gamma, int_to_value(n),
657  lalpha, VALUE_MONE,
658  TCST, int_to_value(1-(n*gamma_0)))));
659  break;
660  }
662  {
663  /* LALPHA_i = iceil(N,|a|) * (GAMMA_j - GAMMA_0) + SIGMA_j +1
664  * DELTA_j = |a|*SIGMA_j + IOTA_j
665  * 0 <= IOTA_j < |a|
666  */
667  entity sigma = entity_undefined,
668  iota = entity_undefined,
669  gamma = entity_undefined,
670  delta = entity_undefined,
671  template = array_to_template(array),
672  processor = template_to_processors(template);
673  int gamma_0 = 0, tdim = -1, pdim = -1, a = 0, b = 0,
674  n, icn, plow, pup, tlow, tup, alow, aup;
675 
676  get_alignment(array, dim, &tdim, &a, &b);
677  pips_assert("aligned dimension", tdim!=0);
678 
679  get_distribution(template, tdim, &pdim, &n);
680  pips_assert("distributed dimension", pdim>0 && n>0);
681 
682  get_entity_dimensions(array, dim, &alow, &aup);
683  get_entity_dimensions(template, tdim, &tlow, &tup);
684  get_entity_dimensions(processor, pdim, &plow, &pup);
685 
686  sigma = get_ith_auxiliary_dummy(pdim);
687  iota = get_ith_shift_dummy(pdim);
688  delta = get_ith_block_dummy(pdim);
689  gamma = get_ith_cycle_dummy(pdim);
690 
691  gamma_0 = (a*alow + b - tlow) % (n * (pup - plow + 1));
692  icn = iceil(n, abs(a));
693 
695  (syst,
698  sigma, VALUE_ONE,
699  gamma, int_to_value(icn),
700  lalpha, VALUE_MONE,
701  TCST, int_to_value(1-(icn*gamma_0)))));
702 
704  (syst,
707  delta, VALUE_ONE,
708  sigma, int_to_value(-abs(a)),
709  iota, VALUE_MONE,
710  TCST, VALUE_ZERO)));
711 
712  sc_add_inegalite(syst,
714  VALUE_MONE)));
716  (syst,
719  (Variable) iota, VALUE_ONE,
720  TCST, int_to_value(-(abs(a)-1)))));
721  break;
722  }
723  default:
724  pips_internal_error("unexpected new declaration tag");
725  }
726  }
727 
728  sc_creer_base(syst);
729  return syst;
730 }
#define min(a, b)
#define max(a, b)
void get_distribution(entity template, int dim, int *ppdim, int *pn)
Definition: hpfc-util.c:638
void get_ith_dim_new_declaration(entity array, int i, int *pmin, int *pmax)
Definition: declarations.c:285
#define template_to_processors(template)
entity get_ith_cycle_dummy(int)
entity get_ith_array_dummy(int)
entity get_ith_shift_dummy(int)
entity get_ith_block_dummy(int)
entity get_ith_auxiliary_dummy(int)
entity get_ith_local_dummy(int)

References abs, array, array_distributed_p(), array_to_template, contrainte_make(), entity_undefined, get_alignment(), get_distribution(), get_entity_dimensions(), get_ith_array_dummy(), get_ith_auxiliary_dummy(), get_ith_block_dummy(), get_ith_cycle_dummy(), get_ith_dim_new_declaration(), get_ith_local_dummy(), get_ith_shift_dummy(), iceil, int_to_value, is_hpf_newdecl_alpha, is_hpf_newdecl_beta, is_hpf_newdecl_delta, is_hpf_newdecl_gamma, is_hpf_newdecl_none, max, min, new_declaration_tag(), NumberOfDimension(), pips_assert, pips_internal_error, sc_add_egalite(), sc_add_inegalite(), sc_creer_base(), sc_rn(), TCST, template_to_processors, VALUE_MONE, VALUE_ONE, VALUE_ZERO, vect_make(), vect_new(), and VECTEUR_NUL.

Referenced by entity_to_new_declaration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_compute_lid()

statement hpfc_compute_lid ( entity  ,
entity  ,
entity(*)(void)  ,
entity   
)

◆ hpfc_compute_unicity_constraints()

Psysteme hpfc_compute_unicity_constraints ( entity  e)

Psysteme hpfc_compute_unicity_constraints(e) entity e should be an array;.

equations for non aligned template dimensions are computed: ???

theta_i - lower_template_i == 0

Definition at line 360 of file build-system.c.

362 {
363  align al = load_hpf_alignment(e);
364  entity template = align_template(al);
365  Psysteme new_system = sc_new();
366  int i;
367 
368  pips_assert("distributed array", array_distributed_p(e));
369 
370  for(i=1 ; i<=NumberOfDimension(template) ; i++)
371  {
372  alignment
374 
375  if (a==alignment_undefined)
376  {
377  entity
378  theta = get_ith_template_dummy(i);
379  int
380  low =
382  (dimension_lower(entity_ith_dimension(template, i)));
383 
385  (new_system,
387  theta, VALUE_ONE,
388  TCST, int_to_value(-low))));
389  }
390  }
391  sc_creer_base(new_system);
392  return(new_system);
393 }
entity get_ith_template_dummy(int)

References align_alignment, align_template, alignment_undefined, array_distributed_p(), contrainte_make(), dimension_lower, entity_ith_dimension(), FindAlignmentOfTemplateDim(), get_ith_template_dummy(), HpfcExpressionToInt(), int_to_value, load_hpf_alignment(), NumberOfDimension(), pips_assert, sc_add_egalite(), sc_creer_base(), sc_new(), TCST, VALUE_ONE, vect_make(), and VECTEUR_NUL.

Referenced by generate_distributed_io_system().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_current_statement_undefined_p()

bool hpfc_current_statement_undefined_p ( void  )

◆ hpfc_directives_error_handler()

void hpfc_directives_error_handler ( void  )

the local stack is used to retrieve the current statement while scanning the AST with gen_recurse.

Definition at line 109 of file directives.c.

110 {
111  error_reset_current_stmt_stack();
112 }

Referenced by hpfc_error_handler().

+ Here is the caller graph for this function:

◆ hpfc_dynamic_directives()

bool hpfc_dynamic_directives ( const  string)
Parameters
stringame

Definition at line 681 of file hpfc.c.

682 {
683  return hpfc_directives_handler(name, true);
684 }
static bool hpfc_directives_handler(string name, bool dyn)
what: deals with directives.
Definition: hpfc.c:632

References hpfc_directives_handler().

+ Here is the call graph for this function:

◆ hpfc_entity_reduction_p()

bool hpfc_entity_reduction_p ( entity  e)

special_cases.c

special_cases.c

true if a given call is a call to reduction function. ??? a generic function name should be managed here?

Definition at line 82 of file special_cases.c.

83 {
84  return find_reduction(module_local_name(e)) != NULL;
85 }
static t_reduction * find_reduction(const char *s)
static t_reduction *find_reduction(c)
Definition: special_cases.c:67

References find_reduction(), and module_local_name().

Referenced by call_reduction_p(), hpfc_compile(), and hpfc_directives_handler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_fclose()

void hpfc_fclose ( FILE *  f,
string  name 
)
Parameters
nameame

Definition at line 341 of file compile.c.

344 {
345  string base = pips_basename(name, NULL);
346  fprintf(f, "!\n! That is all for %s\n!\n", base);
347  free(base);
348  safe_fclose(f, name);
349 }
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
char * pips_basename(char *fullpath, char *suffix)
Definition: file.c:822

References base, f(), fprintf(), free(), pips_basename(), and safe_fclose().

Referenced by generate_hpf_remapping_file(), put_generated_resources_for_common(), put_generated_resources_for_module(), and put_generated_resources_for_program().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_filter()

bool hpfc_filter ( const  string)
Parameters
stringame

Definition at line 594 of file hpfc.c.

595 {
596  string file_name, dir_name, new_name, src_name;
597 
599  file_name = db_get_file_resource(DBR_SOURCE_FILE, name, true);
600  new_name = strdup(concatenate(name, HPFC_FILTERED_SUFFIX, NULL));
601  src_name = strdup(concatenate(dir_name, "/", file_name, NULL));
602 
603  debug_on("HPFC_DEBUG_LEVEL");
604  pips_debug(1, "considering module %s\n", name);
606 
608  "PATH=${PATH}:${PIPS_ROOT}/Share ",
609  hpf_directive_string_p(name) || !directive_in_file_p(src_name)?
610  "cat" : "hpfc_directives",
611  " < ", src_name, " > ", dir_name, "/", new_name, NULL));
612 
613  DB_PUT_FILE_RESOURCE(DBR_HPFC_FILTERED_FILE, name, new_name);
614 
615  free(src_name);
616 
618  debug_off();
619  return true;
620 }
static bool directive_in_file_p(string name)
Definition: hpfc.c:559
#define HPFC_FILTERED_SUFFIX
bool hpfc_filter(string name)
Definition: hpfc.c:557
void safe_system(string)
system.c
Definition: system.c:38
bool hpf_directive_string_p(const char *s)
recognize an hpf directive special entity.
Definition: hpfc.c:51

References concatenate(), db_get_current_workspace_directory(), db_get_file_resource, DB_PUT_FILE_RESOURCE, debug_off, debug_on, directive_in_file_p(), file_name, free(), hpf_directive_string_p(), hpfc_error_handler(), HPFC_FILTERED_SUFFIX, pips_debug, reset_hooks_register(), reset_hooks_unregister(), safe_system(), and strdup().

+ Here is the call graph for this function:

◆ hpfc_fopen()

FILE* hpfc_fopen ( string  name)
Parameters
nameame

Definition at line 329 of file compile.c.

331 {
332  string base = pips_basename(name, NULL);
333  FILE *f = (FILE *) safe_fopen(name, "w");
334  fprintf(f, "!\n! File %s\n! This file has been automatically generated "
335  "by the HPF compiler\n!\n", base);
336  free(base);
337  return f;
338 }
FILE * safe_fopen(const char *filename, const char *what)
Definition: file.c:67

References base, f(), fprintf(), free(), pips_basename(), and safe_fopen().

Referenced by generate_hpf_remapping_file(), put_generated_resources_for_common(), put_generated_resources_for_module(), and put_generated_resources_for_program().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_gen_n_vars_expr()

list hpfc_gen_n_vars_expr ( entity(*)(void)  ,
int   
)

◆ hpfc_generate_message()

statement hpfc_generate_message ( entity  ld,
bool  send,
bool  lazy 
)
Parameters
ldd
sendend
lazyazy

Definition at line 208 of file generate-util.c.

212 {
213  entity nc, nt;
214  expression lid, tid, chn;
215 
218  lid = entity_to_expression(ld);
220  (make_reference(nt, CONS(EXPRESSION, lid, NIL)));
223 
224  return lazy ? hpfc_lazy_message(tid, chn, send) :
225  hpfc_message(tid, chn, send);
226 }
statement hpfc_message(expression tid, expression channel, bool send)
static statement hpfc_lazy_message(expression tid, expression channel, bool snd)
IF (LAZY_snd) THEN PVMFsnd() LAZY_snd = false // if receive ENDIF.
#define SEND_CHANNELS
#define NODETIDS
#define RECV_CHANNELS

References CONS, copy_expression(), entity_to_expression(), EXPRESSION, hpfc_lazy_message(), hpfc_message(), hpfc_name_to_entity(), make_reference(), NIL, NODETIDS, RECV_CHANNELS, reference_to_expression(), and SEND_CHANNELS.

Referenced by broadcast(), gen(), and hpfc_lazy_packing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_init()

bool hpfc_init ( const string  name)

bool hpfc_init(string name)

what: initialize the hpfc status for a program. input: the program (workspace) name. output: none. side effects:

  • the hpfc status is initialized and stored in the pips dbm. bugs or features:
  • some callees are filtered out with a property, to deal with pipsmake.

vars local to commons

drop hpfc specials

Parameters
nameame

Definition at line 503 of file hpfc.c.

504 {
505  debug_on("HPFC_DEBUG_LEVEL");
506  pips_debug(1, "considering program %s\n", name);
507 
509 
510  set_string_property("PRETTYPRINT_VARIABLE_DIMENSIONS", "common");
511  set_bool_property("PRETTYPRINT_HPFC", true); /* vars local to commons */
512  set_bool_property("HPFC_FILTER_CALLEES", true); /* drop hpfc specials */
513  set_bool_property("GLOBAL_EFFECTS_TRANSLATION", false);
514  set_bool_property("WARNING_ON_STAT_ERROR", false); // for fake files
515 
516  // should not be there. if true, obscure coredump in proper
517  // effects on a preference which has been cleanup up...
518  // see validation/Hpfc/io_4.tpips that triggers the issue
519  set_bool_property("PRETTYPRINT_IO_EFFECTS", false); // ??????
520 
521  // too verbose...
522  set_bool_property("UNSPAGHETTIFY_DISPLAY_STATISTICS", false);
523  set_bool_property("CLEAN_UP_SEQUENCES_DISPLAY_STATISTICS", false);
524  set_bool_property("WARN_ABOUT_EMPTY_SEQUENCES", false);
525 
526  // where the specials dummy/variables are stored... ???
528 
529  // mkdir...
530  {
532  free(dir_name);
533  }
534 
537 
539  debug_off();
540  return true;
541 }
language make_language_fortran(void)
Definition: ri.c:1250
static void init_hpfc_status()
current hpfc status
Definition: hpfc.c:168
string db_get_directory_name_for_module(const char *name)
returns the allocated and mkdir'ed directory for module name
Definition: lowlevel.c:150
#define WORKSPACE_SRC_SPACE
Definition: pipsdbm-local.h:32
void set_bool_property(const char *, bool)
entity make_empty_program(const char *name, language l)
Definition: entity.c:261

References db_get_directory_name_for_module(), debug_off, debug_on, free(), hpfc_error_handler(), HPFC_PACKAGE, init_hpfc_status(), make_empty_program(), make_language_fortran(), pips_debug, reset_hooks_register(), reset_hooks_unregister(), save_hpfc_status(), set_bool_property(), set_string_property(), and WORKSPACE_SRC_SPACE.

+ Here is the call graph for this function:

◆ hpfc_init_dummy_to_prime()

void hpfc_init_dummy_to_prime ( void  )

Definition at line 155 of file build-system.c.

156 {
157  init_dummy_to_prime();
158  STORE(array);
159  STORE(template);
160  STORE(processor);
161  STORE(block);
162  STORE(cycle);
163  STORE(local);
164  STORE(shift);
165  STORE(auxiliary);
166 }
#define STORE(name)
Definition: build-system.c:152

References array, and STORE.

Referenced by compile_module().

+ Here is the caller graph for this function:

◆ hpfc_init_run_time_entities()

void hpfc_init_run_time_entities ( void  )

to be seen from outside of this file

they are declared as variables to avoid redefinitions ??? this fools pips typing (functions/variables and so) just okay for the pretty printer...

why not

dimensions are updated

Definition at line 751 of file run-time.c.

752 {
754  int i=0;
755  list l=NIL;
756 
757  if (RTSTable_initialized_p) return;
758  RTSTable_initialized_p = true;
759 
760  for(current=RTSTable;
761  current->what!=is_end;
762  current++)
763  {
764  pips_debug(6, "initializing %s, %d\n", current->name, current->arity);
765 
766  switch(current->what)
767  {
768  case is_fun:
769  current->object = MakeRunTimeSupportFunction(current->name,
770  current->arity,
771  current->basic);
772  break;
773  case is_sub:
775  current->arity);
776  break;
777  case is_ifn:
778  /* they are declared as variables to avoid redefinitions
779  * ??? this fools pips typing (functions/variables and so)
780  * just okay for the pretty printer...
781  */
782  case is_iof:
783  case is_var:
784  current->object =
786  HPFC_PACKAGE, /* why not */
787  current->basic);
788  /* dimensions are updated
789  */
790  l = NIL;
791  for(i=1; i<=current->arity; i++)
792  l = CONS(DIMENSION,
795  NIL),
796  l);
798  (type_variable(entity_type(current->object))) = l;
799  break;
800  default:
801  pips_internal_error("unexpected what field in Descriptor");
802  }
803  }
804 }
dimension make_dimension(expression a1, expression a2, list a3)
Definition: ri.c:565
#define is_iof
Definition: run-time.c:576
static RunTimeSupportDescriptor RTSTable[]
Definition: run-time.c:592
static bool RTSTable_initialized_p
Definition: run-time.c:590
#define is_sub
Definition: run-time.c:571
#define is_var
Definition: run-time.c:573
#define is_fun
Definition: run-time.c:572
entity MakeRunTimeSupportFunction(string local_name, _UNUSED_ int number_of_arguments, tag return_type)
entity MakeRunTimeSupportFunction (local_name, number_of_arguments, return_type)
Definition: run-time.c:61
#define is_ifn
Definition: run-time.c:575
#define is_end
this file stores the table that describes run time functions and variables that may be called or refe...
Definition: run-time.c:570
entity MakeRunTimeSupportSubroutine(string local_name, _UNUSED_ int number_of_arguments)
Runtime Support Functions Management.
Definition: run-time.c:44

References CONS, current, DIMENSION, entity_type, find_or_create_typed_entity(), HPFC_PACKAGE, int_to_expression(), is_end, is_fun, is_ifn, is_iof, is_sub, is_var, make_dimension(), MakeRunTimeSupportFunction(), MakeRunTimeSupportSubroutine(), NIL, pips_debug, pips_internal_error, RTSTable, RTSTable_initialized_p, type_variable, and variable_dimensions.

Referenced by hpfc_directives_handler(), and set_resources_for_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_initsend()

statement hpfc_initsend ( bool  lazy)

2 args to pvmfinitsend

Parameters
lazyazy

Definition at line 229 of file generate-util.c.

231 {
232  statement init;
233 
234  /* 2 args to pvmfinitsend
235  */
240  NIL)));
241 
242  return lazy ? make_block_statement
243  (CONS(STATEMENT, init,
245  NIL))) :
246  init ;
247 }
static expression pvm_encoding_option(int n)
HPFC module by Fabien COELHO.
Definition: generate-util.c:33
#define PVM_INITSEND
PVM functions that may be called by the generated code.
#define LAZY_SEND
#define BUFID
#define set_logical(var, b)
static int init
Maximal value set for Fortran 77.
Definition: entity.c:320

References BUFID, CONS, entity_to_expression(), EXPRESSION, hpfc_make_call_statement(), hpfc_name_to_entity(), init, LAZY_SEND, make_block_statement(), NIL, pvm_encoding_option(), PVM_INITSEND, set_logical, and STATEMENT.

Referenced by gen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_install()

bool hpfc_install ( const string  name)

bool hpfc_install(string name)

what: install generated files in a directory. done for wpips. how: all in the hpfc_install shell script. input: program name. output: none. side effects:

  • creates an hpfc directory in the database
  • copies the files in this directory... bugs or features:
Parameters
nameame

Definition at line 838 of file hpfc.c.

839 {
840  string dir, wks;
841  debug_on("HPFC_DEBUG_LEVEL");
842  pips_debug(1, "considering program %s\n", name);
843 
846 
847  safe_system(concatenate("hpfc_install -iob ", dir, " -n ", wks, NULL));
848 
849  DB_PUT_FILE_RESOURCE(DBR_HPFC_INSTALLATION, name, NO_FILE);
850 
851  debug_off();
852  return true;
853 }
string db_get_current_workspace_name(void)
the function is used to check that there is some current workspace...
Definition: workspace.c:82

References concatenate(), db_get_current_workspace_directory(), db_get_current_workspace_name(), DB_PUT_FILE_RESOURCE, debug_off, debug_on, NO_FILE, pips_debug, and safe_system().

+ Here is the call graph for this function:

◆ hpfc_integer_constant_expression_p()

bool hpfc_integer_constant_expression_p ( expression  e,
int pi 
)

just to avoid a gcc warning

Parameters
pii

Definition at line 514 of file align-checker.c.

517 {
519 
520  if (normalized_undefined_p(n))
521  {
522  n = NORMALIZE_EXPRESSION(e);
523  }
524 
525  switch (normalized_tag(n))
526  {
528  return(false);
529  break;
531  {
533  vp = vect_del_var(v, TCST);
534  int s = vect_size(vp);
535  bool result = (s==0);
536 
537  vect_rm(vp);
538 
539  if (result)
540  {
541  Value vi = vect_coeff(TCST, v);
542  *pi = VALUE_TO_INT(vi);
543  }
544 
545  return(result);
546  break;
547  }
548  default:
549  pips_internal_error("unexpected normalized tag");
550  break;
551  }
552 
553  return(false); /* just to avoid a gcc warning */
554 }
#define NORMALIZE_EXPRESSION(e)
#define normalized_tag(x)
Definition: ri.h:1778
#define normalized_undefined_p(x)
Definition: ri.h:1746
@ is_normalized_linear
Definition: ri.h:1760
@ is_normalized_complex
Definition: ri.h:1761

References expression_normalized, is_normalized_complex, is_normalized_linear, NORMALIZE_EXPRESSION, normalized_linear, normalized_tag, normalized_undefined_p, pips_internal_error, TCST, VALUE_TO_INT, vect_coeff(), vect_del_var(), vect_rm(), and vect_size().

Referenced by align_check(), compute_entity_to_declaration_constraints(), empty_range_p(), fprint_range(), lrange_larger_p(), safe_static_domain_bound(), and sprint_range().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_intrinsic_like_function()

bool hpfc_intrinsic_like_function ( entity  e)

Definition at line 828 of file run-time.c.

830 {
832 
833  return entry ? entry->what==is_ifn : false;
834 }
static RunTimeSupportDescriptor * find_entry_by_name(const char *name)
Definition: run-time.c:806

References entity_local_name(), find_entry_by_name(), is_ifn, and RunTimeSupportDescriptor::what.

+ Here is the call graph for this function:

◆ hpfc_io_like_function()

bool hpfc_io_like_function ( entity  e)

Definition at line 836 of file run-time.c.

838 {
840 
841  return entry ? entry->what==is_iof : false;
842 }

References entity_local_name(), find_entry_by_name(), is_iof, and RunTimeSupportDescriptor::what.

Referenced by only_io_call().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_io_util_error_handler()

void hpfc_io_util_error_handler ( void  )

??? neglect expression side effects...

Definition at line 82 of file io-util.c.

83 {
84  error_reset_current_statement_stack();
85 }

Referenced by hpfc_error_handler().

+ Here is the caller graph for this function:

◆ hpfc_lazy_buffer_packing()

statement hpfc_lazy_buffer_packing ( entity  ,
entity  ,
entity  ,
entity  ,
entity(*)(void)  ,
bool  ,
bool   
)

◆ hpfc_lazy_guard()

statement hpfc_lazy_guard ( bool  snd,
statement  then 
)

returns if (LAZY_{SEND,RECV}) then

Parameters
sndnd
thenhen

Definition at line 176 of file generate-util.c.

179 {
180  entity decision = hpfc_name_to_entity(snd ? LAZY_SEND : LAZY_RECV);
181  return test_to_statement
183 }
#define LAZY_RECV

References entity_to_expression(), hpfc_name_to_entity(), LAZY_RECV, LAZY_SEND, make_empty_statement, make_test(), and test_to_statement.

Referenced by broadcast(), and hpfc_lazy_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_lazy_packing()

statement hpfc_lazy_packing ( entity  ,
entity  ,
entity(*)(void)  ,
bool  ,
bool   
)

◆ hpfc_main_entity()

entity hpfc_main_entity ( entity  e)

returns the entity to which e is attached, that is first a common, then a function...

Definition at line 462 of file run-time.c.

463 {
464  storage s = entity_storage(e);
465  bool in_common = entity_in_common_p(e),
466  in_ram = storage_ram_p(s);
467  ram r = (in_ram ? storage_ram(s) : ram_undefined);
468 
469  pips_assert("not in rom", !storage_rom_p(s));
470 
471  return(in_ram ?
472  (in_common ? ram_section(r) : ram_function(r)):
475 }
#define storage_formal(x)
Definition: ri.h:2524
#define formal_function(x)
Definition: ri.h:1406
#define storage_rom_p(x)
Definition: ri.h:2525
#define storage_return_p(x)
Definition: ri.h:2516
#define storage_return(x)
Definition: ri.h:2518

References entity_in_common_p(), entity_storage, entity_undefined, formal_function, pips_assert, ram_function, ram_section, ram_undefined, storage_formal, storage_formal_p, storage_ram, storage_ram_p, storage_return, storage_return_p, and storage_rom_p.

Referenced by hpfc_main_entity_name(), and list_of_distributed_arrays_for_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_main_entity_name()

const char* hpfc_main_entity_name ( entity  e)

returns the name of the entity e belongs too (common, function...)

Definition at line 479 of file run-time.c.

480 {
482 }
entity hpfc_main_entity(entity e)
returns the entity to which e is attached, that is first a common, then a function....
Definition: run-time.c:462

References hpfc_main_entity(), and module_local_name().

Referenced by bound_parameter_name().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_make()

bool hpfc_make ( const string  name)

bool hpfc_make(string name)

what: compile the generated and installed code. for wpips. how: system call to $HPFC_MAKE input: the workspace name (which is not used) output: none. side effects: may stop if can't execute bugs or features:

Parameters
nameame

Definition at line 864 of file hpfc.c.

865 {
866  string dir = db_get_current_workspace_directory();
867 
868  debug_on("HPFC_DEBUG_LEVEL");
869  pips_debug(1, "considering program %s\n", name);
870 
871  safe_system(concatenate("cd ", dir, "/hpfc ; "
872  "${HPFC_MAKE:-gmake} make &", NULL));
873 
874  debug_off();
875  return true;
876 }

References concatenate(), db_get_current_workspace_directory(), debug_off, debug_on, pips_debug, and safe_system().

+ Here is the call graph for this function:

◆ hpfc_make_call_statement()

statement hpfc_make_call_statement ( entity  e,
list  l 
)

statement hpfc_make_call_statement(e, l) generate a call statement to function e, with expression list l as an argument.

Definition at line 318 of file run-time.c.

319 {
320  pips_assert("defined", !entity_undefined_p(e));
322  make_call(e, l)));
323 }
#define entity_undefined_p(x)
Definition: ri.h:2762

References entity_undefined_p, instruction_to_statement(), is_instruction_call, make_call(), make_instruction(), and pips_assert.

Referenced by add_pvm_init_and_end(), generate_subarray_shift(), hpfc_hcast(), hpfc_hmessage(), hpfc_initsend(), hpfc_message(), hpfc_nrecv(), hpfc_nsend(), hpfc_packing_of_current__buffer(), io_efficient_compile(), st_call_send_or_receive(), st_compute_current_computer(), st_compute_current_owners(), st_compute_neighbour(), st_generate_packing(), and statement_compute_bounds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_message()

statement hpfc_message ( expression  tid,
expression  channel,
bool  send 
)
Parameters
tidid
channelhannel
sendend

Definition at line 152 of file generate-util.c.

156 {
157  expression third;
158  entity pvmf;
159 
161  pvmf = hpfc_name_to_entity(send ? PVM_SEND : PVM_RECV);
162 
163  return make_block_statement
165  CONS(EXPRESSION, tid,
166  CONS(EXPRESSION, channel,
167  CONS(EXPRESSION, third,
168  NIL)))),
170  NIL)));
171 }
statement hpfc_add_2(expression exp)
expr = expr + 2
#define PVM_RECV
#define PVM_SEND
#define INFO

References BUFID, CONS, copy_expression(), entity_to_expression(), EXPRESSION, hpfc_add_2(), hpfc_make_call_statement(), hpfc_name_to_entity(), INFO, make_block_statement(), NIL, PVM_RECV, PVM_SEND, and STATEMENT.

Referenced by hpfc_generate_message(), and hpfc_lazy_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_module_suffix()

string hpfc_module_suffix ( entity  module)

else

to avoid a gcc warning

Parameters
moduleodule

Definition at line 126 of file host_node_entities.c.

128 {
129  if (module==node_module) return(NODE_NAME);
130  if (module==host_module) return(HOST_NAME);
131  /* else
132  */
133  pips_internal_error("unexpected module");
134  return string_undefined; /* to avoid a gcc warning */
135 }
#define string_undefined
Definition: newgen_types.h:40

References host_module, HOST_NAME, module, node_module, NODE_NAME, pips_internal_error, and string_undefined.

◆ hpfc_name_to_entity()

entity hpfc_name_to_entity ( const char *  name)

just to avoid a gcc warning

Parameters
nameame

Definition at line 817 of file run-time.c.

818 {
820 
821  if (entry) return entry->object;
822 
823  pips_internal_error("%s not found", name);
824 
825  return entity_undefined; /* just to avoid a gcc warning */
826 }
entity object
basic tag if necessary
Definition: run-time.c:587

References entity_undefined, find_entry_by_name(), RunTimeSupportDescriptor::object, and pips_internal_error.

Referenced by add_pvm_init_and_end(), broadcast(), buffer_full_condition(), define_node_processor_id(), elements_loop(), expr_compute_local_index(), gen(), generate_io_statements_for_shared_arrays(), generate_remapping_code(), generate_remapping_guard(), GENERATION(), hpfc_broadcast_if_necessary(), hpfc_buffer_entity(), hpfc_buffer_initialization(), hpfc_buffer_packing(), hpfc_compute_lid(), hpfc_generate_message(), hpfc_hcast(), hpfc_hmessage(), hpfc_initsend(), hpfc_lazy_buffer_packing(), hpfc_lazy_guard(), hpfc_lazy_message(), hpfc_lazy_packing(), hpfc_message(), hpfc_nrecv(), hpfc_nsend(), hpfc_translate_call_with_distributed_args(), if_different_pe_and_not_twin(), io_efficient_compile(), live_mapping_expression(), make_mypos_expression(), make_rectangular_area(), mylid_ne_lid(), processor_loop(), set_array_status_to_target(), set_resources_for_module(), st_compute_current_computer(), st_compute_current_owners(), st_compute_neighbour(), and statement_compute_bounds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_new_variable()

entity hpfc_new_variable ( entity  module,
basic  b 
)
Parameters
moduleodule

Definition at line 632 of file compile.c.

633 {
635  AddEntityToCurrentModule(new_ent);
636  return new_ent;
637 }
basic copy_basic(basic p)
BASIC.
Definition: ri.c:104
void AddEntityToCurrentModule(entity)
Add a variable entity to the current module declarations.
Definition: variable.c:260

References AddEntityToCurrentModule(), copy_basic(), make_new_scalar_variable(), and module.

Referenced by extract_lattice(), generate_copy_loop_nest(), loop_flt(), and NormalizeCodeForHpfc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_order_variables()

list hpfc_order_variables ( list  le,
bool  number_first 
)

list hpfc_order_variables(list)

the input list of entities is ordered so that: PSI_i's, GAMMA_i's, DELTA_i's, IOTA_i's, ALPHA_i's, LALPHA_i's...

reverse!

Parameters
lee
number_firstumber_first

Definition at line 629 of file io-compile.c.

632 {
633  list result = NIL;
634 
635  result =
636  gen_nconc(result,
638 
639  if (number_first)
640  {
641  int i;
642  list l = NIL, lr = NIL;
643 
644  for (i=7; i>0; i--)
649  l))));
650 
651  MAP(ENTITY, e,
652  {
653  if (gen_in_list_p(e, le)) lr = CONS(ENTITY, e, lr); /* reverse! */
654  },
655  l);
656 
657  gen_free_list(l);
658  result = gen_nconc(result, lr);
659  }
660  else
661  {
662  result =
663  gen_nconc(result,
665 
666  result =
667  gen_nconc(result,
669 
670  result =
671  gen_nconc(result,
673 
674  result =
675  gen_nconc(result,
677  }
678 
679  result =
680  gen_nconc(result,
682 
683  pips_assert("same length", gen_length(result)==gen_length(le));
684 
685  return(result);
686 }
entity get_ith_processor_dummy(int)
static list hpfc_order_specific_variables(list le, entity(*creation)())
output 7 entities created by creation if in list le
Definition: io-compile.c:605

References CONS, ENTITY, gen_free_list(), gen_in_list_p(), gen_length(), gen_nconc(), get_ith_array_dummy(), get_ith_block_dummy(), get_ith_cycle_dummy(), get_ith_local_dummy(), get_ith_processor_dummy(), get_ith_shift_dummy(), hpfc_order_specific_variables(), MAP, NIL, and pips_assert.

Referenced by put_variables_in_ordered_lists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_packing_of_current__buffer()

statement hpfc_packing_of_current__buffer ( entity  array,
bool  pack 
)

CALL (pvmtype) HPFC {,UN}PACK.

Parameters
arrayrray
packack

Definition at line 395 of file generate-util.c.

398 {
401 }
#define BUFPCK
hpfc packing and unpacking
#define BUFUPK

References array, BUFPCK, BUFUPK, hpfc_buffer_entity(), hpfc_make_call_statement(), and NIL.

Referenced by hpfc_broadcast_if_necessary(), hpfc_hcast(), hpfc_hmessage(), hpfc_nrecv(), and hpfc_nsend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_print_code()

void hpfc_print_code ( FILE *  file,
entity  module,
statement  stat 
)
Parameters
fileile
moduleodule
stattat

Definition at line 393 of file compile.c.

397 {
398  text t;
399  debug_on("PRETTYPRINT_DEBUG_LEVEL");
400 
403 
404  t = text_module(module, stat);
405  print_text(file, t);
406  free_text(t);
407 
410 
411  debug_off();
412 }
void free_text(text p)
Definition: text.c:74
void reset_prettyprinter_common_hook(void)
static string hpfc_head_hook(entity m)
to be used by the prettyprinter at the head of a file.
Definition: compile.c:366
static string hpfc_common_hook(entity module, entity common)
to be used by the prettyprinter when dealing with a common.
Definition: compile.c:381
void reset_prettyprinter_head_hook()
Definition: misc.c:3964
void set_prettyprinter_head_hook(string(*f)(entity))
Definition: misc.c:3963
text text_module(entity, statement)
void set_prettyprinter_common_hook(string(*)(entity, entity))
declarations2.c
void print_text(FILE *fd, text t)
Definition: print.c:195

References debug_off, debug_on, free_text(), hpfc_common_hook(), hpfc_head_hook(), module, print_text(), reset_prettyprinter_common_hook(), reset_prettyprinter_head_hook(), set_prettyprinter_common_hook(), set_prettyprinter_head_hook(), and text_module().

Referenced by put_generated_resources_for_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_print_common()

void hpfc_print_common ( FILE *  file,
entity  module,
entity  common 
)
Parameters
fileile
moduleodule
commonommon

Definition at line 154 of file debug-util.c.

158 {
159  text t;
160  debug_on("PRETTYPRINT_DEBUG_LEVEL");
161 
162  t = text_common_declaration(common, module);
163  print_text(file, t);
164  free_text(t);
165 
166  debug_off();
167 }
text text_common_declaration(entity common, entity module)
needed for hpfc

References debug_off, debug_on, free_text(), module, print_text(), and text_common_declaration().

Referenced by put_generated_resources_for_common().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_print_file()

void hpfc_print_file ( string  file_name)
Parameters
file_nameile_name

Definition at line 169 of file debug-util.c.

170 {
171  string dir_name = db_get_current_workspace_directory();
172 
173  safe_system(concatenate("cat ", dir_name, "/", file_name, " >&2", NULL));
174 }

References concatenate(), db_get_current_workspace_directory(), file_name, and safe_system().

Referenced by put_generated_resources_for_common(), put_generated_resources_for_module(), and put_generated_resources_for_program().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_run()

bool hpfc_run ( const string  name)

bool hpfc_run(string name)

what: run the program. how: system call sut $HPFC_MAKE... input: none. output: none. side effects:

  • forks a process.
  • may stop if cannot execute. bugs or features:
Parameters
nameame

Definition at line 889 of file hpfc.c.

890 {
891  string dir = db_get_current_workspace_directory();
892 
893  debug_on("HPFC_DEBUG_LEVEL");
894  pips_debug(1, "considering program %s\n", name);
895 
896  safe_system(concatenate("cd ", dir, "/hpfc ; "
897  "${HPFC_MAKE:-gmake} run &", NULL));
898 
899  debug_off();
900  return true;
901 }

References concatenate(), db_get_current_workspace_directory(), debug_off, debug_on, pips_debug, and safe_system().

+ Here is the call graph for this function:

◆ hpfc_simplify_condition()

void hpfc_simplify_condition ( Psysteme psc,
statement  stat,
tag  move 
)

void hpfc_simplify_condition(psc, stat, move)

remove conditions that are not usefull from *psc, i.e. that are redundent with pre/post conditions depending on when the movement is done

Parameters
pscsc
stattat
moveove

Definition at line 724 of file io-compile.c.

728 {
729  Psysteme
730  pstrue = statement_context(stat, move),
731  cleared = extract_nredund_subsystem(*psc, pstrue);
732 
733  *psc = (sc_rm(*psc), cleared);
734 }
static Psysteme statement_context(statement stat, tag move)
Definition: io-compile.c:116
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Definition: sc_alloc.c:277
Psysteme extract_nredund_subsystem(Psysteme s1, Psysteme s2)
Psysteme extract_nredund_subsystem(s1, s2) Psysteme s1, s2;.

References extract_nredund_subsystem(), sc_rm(), and statement_context().

Referenced by generate_io_collect_or_update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_special_cases_error_handler()

void hpfc_special_cases_error_handler ( void  )

Definition at line 705 of file special_cases.c.

706 {
707  error_reset_current_stmt_stack();
708  error_reset_current_call_stack();
709 }

Referenced by hpfc_error_handler().

+ Here is the caller graph for this function:

◆ hpfc_special_fake()

bool hpfc_special_fake ( entity  f)

Definition at line 91 of file hpfc.c.

92 { return gen_in_list_p(f, the_fakes_object);}

References f(), gen_in_list_p(), and the_fakes_object.

Referenced by hpfc_compile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_special_io()

bool hpfc_special_io ( entity  f)

Definition at line 77 of file hpfc.c.

78 { return gen_in_list_p(f, the_ios_object);}

References f(), and gen_in_list_p().

Referenced by hpfc_compile(), and only_io_call().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_static_directives()

bool hpfc_static_directives ( const  string)
Parameters
stringame

Definition at line 676 of file hpfc.c.

677 {
678  return hpfc_directives_handler(name, false);
679 }

References hpfc_directives_handler().

+ Here is the call graph for this function:

◆ hpfc_translate_call_with_distributed_args()

void hpfc_translate_call_with_distributed_args ( statement  s,
call  c 
)

??? only simple calls are handled.

imbrication may cause problems. ??? should recurse thru all the calls at a call instruction... the call. (not necessarily an instruction)

of remapping

of expression

the substitution in the call will be performed at the propagation phase of dynamic arrays, later on.

add the renaming in the list. ??? should be added only once! what about call(A,A)...

should always be the case

of statement

Do not forget to move forbidden information associated with block:

Parameters
cthe statement the call belongs to

Definition at line 687 of file dynamic.c.

690 {
691  list /* of remapping */ lr = NIL,
692  /* of expression */ args;
693  int len, i;
694  entity f;
695 
696  f = call_function(c);
697  args = call_arguments(c);
698  len = gen_length(args);
699 
700  pips_debug(1, "function %s\n", entity_name(f));
701 
702  for (i=1; i<=len; i++, POP(args))
703  {
704  entity arg = find_ith_parameter(f, i);
705  pips_debug(7, "considering argument %d\n", i);
706 
707  if (array_distributed_p(arg))
708  {
709  align al;
710  entity passed, copy;
711  expression e = EXPRESSION(CAR(args));
712 
713  passed = expression_to_entity(e);
714 
715  pips_debug(8, "passed:%s, arg:%s\n",
716  entity_name(passed), entity_name(arg));
717  pips_assert("distributed and conformant",
718  array_distributed_p(passed) &&
719  conformant_entities_p(passed, arg));
720 
721  set_entity_as_dynamic(passed);
722  add_a_dynamic(passed);
723 
724  al = copy_align(load_hpf_alignment(arg));
725  copy = array_synonym_aligned_as(passed, al);
726 
727  pips_debug(3, "%s (arg %d) %s -> %s\n", entity_name(arg), i,
728  entity_name(passed), entity_name(copy));
729 
730  /* the substitution in the call will be performed at the
731  * propagation phase of dynamic arrays, later on.
732  */
733  /* add the renaming in the list.
734  * ??? should be added only once! what about call(A,A)...
735  */
736  lr = add_once_to_renaming_list(lr, passed, copy);
737  }
738  }
739 
740  if (lr) /* should always be the case */
741  {
742  list /* of statement */ lpre = NIL, lpos = NIL;
744 
745  lpre = CONS(STATEMENT,
747  NIL);
748 
749  MAP(RENAMING, r,
750  {
751  entity passed = renaming_old(r);
752  entity copied = renaming_new(r);
753 
754  lpre = CONS(STATEMENT, call_to_statement(make_call(rename,
756  CONS(EXPRESSION, entity_to_expression(copied), NIL)))),
757  lpre);
758 
759  lpos = CONS(STATEMENT, call_to_statement(make_call(rename,
761  CONS(EXPRESSION, entity_to_expression(passed), NIL)))),
762  lpos);
763  },
764  lr);
765 
767  make_instruction_block(gen_nconc(lpre, lpos));
768  /* Do not forget to move forbidden information associated with
769  block: */
771 
772  DEBUG_STAT(3, "out", s);
773  }
774 }
align copy_align(align p)
ALIGN.
Definition: hpf.c:16
static list add_once_to_renaming_list(list l, entity o, entity n)
of renaming
Definition: dynamic.c:665
void set_entity_as_dynamic(entity e)
a new dynamic entity is stored.
Definition: dynamic.c:130
entity array_synonym_aligned_as(entity array, align a)
entity array_synonym_aligned_as(array, a) entity array; align a;
Definition: dynamic.c:449
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
Definition: instruction.c:106
void fix_sequence_statement_attributes(statement)
Since blocks are not represented in Fortran, they cannot carry a label.
Definition: statement.c:2016
#define RENAMING(x)
RENAMING.
Definition: hpf_private.h:939
#define RENAME_SUFFIX
void add_a_dynamic(entity c)
local primary dynamics
Definition: directives.c:99
#define HPF_PREFIX
moved here because needed by syntax:-(
#define call_to_statement(c)
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
Definition: expression.c:3140

References add_a_dynamic(), add_once_to_renaming_list(), array_distributed_p(), array_synonym_aligned_as(), call_arguments, call_function, call_to_statement, CAR, conformant_entities_p(), CONS, copy_align(), DEBUG_STAT, entity_name, entity_to_expression(), EXPRESSION, expression_to_entity(), f(), find_ith_parameter(), fix_sequence_statement_attributes(), gen_length(), gen_nconc(), HPF_PREFIX, hpfc_name_to_entity(), instruction_to_statement(), load_hpf_alignment(), make_call(), make_instruction_block(), MAP, NIL, pips_assert, pips_debug, POP, RENAME_SUFFIX, RENAMING, renaming_new, renaming_old, set_entity_as_dynamic(), STATEMENT, and statement_instruction.

Referenced by prescription_filter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_unstutter_dummies()

Psysteme hpfc_unstutter_dummies ( entity  array)
Parameters
arrayrray

Definition at line 767 of file build-system.c.

769 {
770  int ndim = variable_entity_dimension(array);
771 
774 }
Psysteme generate_system_for_equal_variables(int n, entity(*gen1)(int), entity(*gen2)(int))
Definition: build-system.c:751
entity get_ith_region_dummy(int)
int variable_entity_dimension(entity)
variable_entity_dimension(entity v): returns the dimension of variable v; scalar have dimension 0.
Definition: variable.c:1293

References array, generate_system_for_equal_variables(), get_ith_array_dummy(), get_ith_region_dummy(), and variable_entity_dimension().

Referenced by generate_distributed_io_system(), and generate_shared_io_system().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfc_util_error_handler()

void hpfc_util_error_handler ( void  )

removes IF (.TRUE.) THEN and DO X=n, n

Definition at line 785 of file hpfc-util.c.

786 {
787  error_reset_current_stmt_stack();
788 }

Referenced by hpfc_error_handler().

+ Here is the caller graph for this function:

◆ HpfcExpressionToInt()

int HpfcExpressionToInt ( expression  e)

HpfcExpressionToInt(e)

uses the normalized value if possible.

just to avoid a gcc warning

Definition at line 569 of file hpfc-util.c.

571 {
573  intptr_t val = 0;
574 
576 
578  {
580  int s = vect_size(v), val;
581  Value vval = vect_coeff(TCST, v);
582 
583  val = VALUE_TO_INT(vval);
584  if (s==0) return 0;
585  if ((s==1) && (val!=0)) return val;
586  }
587 
588  /*
589  if (expression_integer_constant_p(e))
590  return ExpressionToInt(e);
591  */
592  if(expression_integer_value(e, &val))
593  return val;
594  else
595  pips_internal_error("can't return anything, sorry");
596 
597  return -1; /* just to avoid a gcc warning */
598 }
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
Definition: expression.c:58
bool expression_integer_value(expression e, intptr_t *pval)
Definition: eval.c:792
#define normalized_linear_p(x)
Definition: ri.h:1779

References expression_integer_value(), expression_normalized, ifdebug, intptr_t, normalized_linear, normalized_linear_p, normalized_undefined, pips_internal_error, print_expression(), TCST, VALUE_TO_INT, vect_coeff(), and vect_size().

Referenced by align_check(), array_access_to_array_ranges(), array_ranges_to_template_ranges(), complementary_range(), compute_receive_content(), compute_receive_domain(), ComputeNewSizeOfIthDimension(), create_init_common_param_for_arrays(), create_init_common_param_for_processors(), create_init_common_param_for_templates(), create_parameters_h(), DistributionParameterOfArrayDim(), expr_compute_local_index(), generate_one_message(), get_alignment(), get_distribution(), get_ith_dim_new_declaration(), global_array_cell_to_local_array_cell(), handle_set_directive(), hpfc_compute_align_constraints(), hpfc_compute_distribute_constraints(), hpfc_compute_unicity_constraints(), loop_filter(), make_guard_expression(), NormalizeOneTemplateDistribution(), overlap_redefine_expression(), processor_number(), same_alignment_p(), shape_one_message(), simple_indices_p(), template_cell_local_mapping(), and template_ranges_to_processors_ranges().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hpfcompile()

void hpfcompile ( const char *  module_name)

Compiler call, obsole.

left here for allowing linking

Parameters
module_nameodule_name

Definition at line 601 of file compile.c.

602 {
603  debug_on("HPFC_DEBUG_LEVEL");
604  pips_debug(1, "module: %s\n", module_name);
605  pips_internal_error("obsolete");
606  debug_off();
607 }
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296

References debug_off, debug_on, module_name(), pips_debug, and pips_internal_error.

+ Here is the call graph for this function:

◆ IndicesOfRef()

list IndicesOfRef ( syntax  syn)

??? could check that the given call is a constant.

Parameters
synyn

Definition at line 156 of file compiler-util.c.

158 {
159  list l = NIL;
160 
161  pips_assert("reference", syntax_reference_p(syn));
162 
163  MAP(EXPRESSION, e,
164  {
165  syntax s = expression_syntax(e);
166 
167  switch (syntax_tag(s))
168  {
169  case is_syntax_reference:
170  l = CONS(SYNTAX, s, l);
171  break;
172  case is_syntax_range:
173  pips_internal_error("don't konw what to do with a range");
174  break;
175  case is_syntax_call:
176  /* ??? could check that the given call is a constant.
177  */
178  break;
179  default:
180  pips_internal_error("unexpected syntax tag");
181  }
182  },
184 
185  return(l);
186 }
#define syntax_tag(x)
Definition: ri.h:2727
@ is_syntax_range
Definition: ri.h:2692
@ is_syntax_call
Definition: ri.h:2693
@ is_syntax_reference
Definition: ri.h:2691

References CONS, EXPRESSION, expression_syntax, is_syntax_call, is_syntax_range, is_syntax_reference, MAP, NIL, pips_assert, pips_internal_error, reference_indices, SYNTAX, syntax_reference, syntax_reference_p, and syntax_tag.

Referenced by lIndicesOfRef().

+ Here is the caller graph for this function:

◆ indirections_inside_statement_p()

bool indirections_inside_statement_p ( statement  )

◆ init_data_status()

void init_data_status ( void  )

Definition at line 300 of file declarations.c.

301 {
302  init_new_declaration();
306 }
void init_hpf_alignment(void)
void init_hpf_distribution(void)

References init_hpf_alignment(), init_hpf_distribution(), and reset_hpf_object_lists().

Referenced by init_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_dynamic_hpf()

void init_dynamic_hpf ( void  )

Referenced by init_dynamic_status().

+ Here is the caller graph for this function:

◆ init_dynamic_locals()

void init_dynamic_locals ( void  )

DYNAMIC LOCAL DATA.

these static functions are used to store the remapping graph while it is built, or when optimizations are performed on it.

  • alive_synonym: used when building the remapping graph. synonym of a primary entity that has reached a given remapping statement. Used for both arrays and templates.
  • used_dynamics: from a remapping statement, the remapped arrays that are actually referenced in their new shape.
  • modified_dynamics: from a remapping statement, the remapped arrays that may be modified in their new shape.
  • remapping_graph: the remapping graph, based on the control domain. the control_statement is the remapping statement in the code. predecessors and successors are the possible remapping statements for the arrays remapped at that vertex.
  • reaching_mappings: the mappings that may reached a vertex.
  • leaving_mappings: the mappings that may leave the vertex. (simplification assumption: only one per array)
  • remapped: the (primary) arrays remapped at the vertex.

Definition at line 806 of file dynamic.c.

807 {
808  init_alive_synonym();
809  init_used_dynamics();
810  init_modified_dynamics();
811  init_reaching_mappings();
812  init_leaving_mappings();
813  init_remapped();
814  init_remapping_graph();
815 }

Referenced by handle_hpf_directives().

+ Here is the caller graph for this function:

◆ init_dynamic_status()

void init_dynamic_status ( void  )

DYNAMIC STATUS management.

Definition at line 81 of file dynamic.c.

82 {
88 }
void init_maybeuseful_mappings(void)
void init_similar_mapping(void)
void init_renamings(void)
void init_primary_entity(void)
void init_dynamic_hpf(void)

References init_dynamic_hpf(), init_maybeuseful_mappings(), init_primary_entity(), init_renamings(), and init_similar_mapping().

Referenced by init_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_entity_status()

void init_entity_status ( void  )

Definition at line 85 of file host_node_entities.c.

86 {
87  init_new_host();
88  init_old_host();
89  init_new_node();
90  init_old_node();
91 }
void init_old_node(void)
void init_new_host(void)
void init_old_host(void)
void init_new_node(void)

References init_new_host(), init_new_node(), init_old_host(), and init_old_node().

Referenced by init_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_host_and_node_entities()

void init_host_and_node_entities ( void  )

both host and node modules are initialized with the same declarations than the compiled module, but the distributed arrays declarations...

which are not declared in the case of the host_module, and the declarations of which are modified in the node_module (call to NewDeclarationsOfDistributedArrays)...

First, the commons are updated

COMMONS

Then, the other entities

parameters are selected. I think they may be either functional of variable (if declared...) FC 15/09/93

VARIABLES

PARAMETERS

Definition at line 246 of file compile.c.

247 {
249 
250  ifdebug(3)
251  {
252  text t;
253  debug_on("PRETTYPRINT_DEBUG_LEVEL");
254  pips_debug(3, "old declarations:\n");
256  print_text(stderr, t);
257  free_text(t);
258  debug_off();
259  }
260 
263 
264  /* First, the commons are updated
265  */
266  MAP(ENTITY, e,
267  {
268  type t = entity_type(e);
269 
270  if (type_area_p(t) && !entity_special_area_p(e))
271  {
272  debug(3, "init_host_and_node_entities", /* COMMONS */
273  "considering common %s\n", entity_name(e));
274 
276  add_a_common(e);
277  }
278  },
280 
281  /* Then, the other entities
282  */
283  MAP(ENTITY, e,
284  {
285  type t = entity_type(e);
286 
287  /* parameters are selected. I think they may be either
288  * functional of variable (if declared...) FC 15/09/93
289  */
290 
291  if ((type_variable_p(t)) || /* VARIABLES */
292  ((storage_rom_p(entity_storage(e))) &&
295  else
296  if (type_functional_p(t)) /* PARAMETERS */
297  {
300  }
301  },
303 
305 
308 
309  ifdebug(3)
310  {
311  text t;
312  debug_on("PRETTYPRINT_DEBUG_LEVEL");
313  pips_debug(3,"new declarations - node_module:\n");
316  print_text(stderr, t);
317  free_text(t);
318 
319  pips_debug(3, "new declarations - host_module:\n");
322  print_text(stderr, t);
323  free_text(t);
324  debug_off();
325  }
326 }
static string current_module
Definition: message.c:63
bool entity_consistent_p(entity p)
Definition: ri.c:2530
text text_declaration(entity module)
exported for hpfc.
void AddCommonToHostAndNodeModules(entity common)
Definition: hpfc-util.c:371
static void drop_distributed_arguments(entity module)
kind of a quick hack to remove distributed arguments for the host
Definition: compile.c:111
static void add_bound_arguments(entity module)
for the node
Definition: compile.c:196
void NewDeclarationsOfDistributedArrays()
this procedure generate the new declarations of every distributed arrays of the program,...
Definition: declarations.c:676
void add_a_common(entity c)
HPFC module by Fabien COELHO.
Definition: hpfc.c:48
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
#define entity_declarations(e)
MISC: newgen shorthands.
bool entity_special_area_p(entity e)
Definition: area.c:154
#define type_functional_p(x)
Definition: ri.h:2950
#define value_symbolic_p(x)
Definition: ri.h:3068
#define type_area_p(x)
Definition: ri.h:2944

References add_a_common(), add_bound_arguments(), AddCommonToHostAndNodeModules(), AddEntityToDeclarations(), AddEntityToHostAndNodeModules(), current_module, debug(), debug_off, debug_on, drop_distributed_arguments(), ENTITY, entity_consistent_p(), entity_declarations, entity_initial, entity_name, entity_special_area_p(), entity_storage, entity_type, free_text(), get_current_module_entity(), host_module, ifdebug, load_new_host(), load_new_node(), MAP, NewDeclarationsOfDistributedArrays(), node_module, pips_debug, print_text(), storage_rom_p, text_declaration(), type_area_p, type_functional_p, type_variable_p, and value_symbolic_p.

Referenced by compile_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_hpf_alignment()

void init_hpf_alignment ( void  )

Referenced by init_data_status().

+ Here is the caller graph for this function:

◆ init_hpf_distribution()

void init_hpf_distribution ( void  )

Referenced by init_data_status().

+ Here is the caller graph for this function:

◆ init_hpf_number()

void init_hpf_number ( void  )

Referenced by init_hpf_number_status().

+ Here is the caller graph for this function:

◆ init_hpf_number_status()

void init_hpf_number_status ( void  )

STANDARS STATIC MANAGEMENT.

functions: {init,get,set,reset,close}_hpf_number_status

Definition at line 128 of file declarations.c.

129 {
130  init_hpf_number();
131  init_currents();
132 }
void init_hpf_number(void)

References init_currents(), and init_hpf_number().

Referenced by init_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_hpf_reductions()

void init_hpf_reductions ( void  )

Referenced by init_hpfc_status().

+ Here is the caller graph for this function:

◆ init_maybeuseful_mappings()

void init_maybeuseful_mappings ( void  )

Referenced by init_dynamic_status().

+ Here is the caller graph for this function:

◆ init_new_host()

void init_new_host ( void  )

Referenced by init_entity_status().

+ Here is the caller graph for this function:

◆ init_new_node()

void init_new_node ( void  )

Referenced by init_entity_status().

+ Here is the caller graph for this function:

◆ init_old_host()

void init_old_host ( void  )

Referenced by init_entity_status().

+ Here is the caller graph for this function:

◆ init_old_node()

void init_old_node ( void  )

Referenced by init_entity_status().

+ Here is the caller graph for this function:

◆ init_overlap_status()

void init_overlap_status ( void  )

Referenced by init_hpfc_status().

+ Here is the caller graph for this function:

◆ init_primary_entity()

void init_primary_entity ( void  )

Referenced by init_dynamic_status().

+ Here is the caller graph for this function:

◆ init_renamings()

void init_renamings ( void  )

Referenced by init_dynamic_status().

+ Here is the caller graph for this function:

◆ init_similar_mapping()

void init_similar_mapping ( void  )

Referenced by init_dynamic_status().

+ Here is the caller graph for this function:

◆ init_the_dynamics()

void init_the_dynamics ( void  )

Referenced by handle_hpf_directives().

+ Here is the caller graph for this function:

◆ io_efficient_compile()

void io_efficient_compile ( statement  stat,
statement hp,
statement np 
)

compile an io statement

returned Node code

of effect

not implemented

Parameters
stattat
hpstatement to compile
npreturned Host code

Definition at line 911 of file io-compile.c.

915 {
916  list
917  /* of effect */ entities = load_rw_effects_list(stat),
918  lh_collect = NIL, lh_io = NIL, lh_update = NIL,
919  ln_collect = NIL, ln_io = NIL, ln_update = NIL;
920  statement sh, sn;
921 
922  debug_on("HPFC_IO_DEBUG_LEVEL");
923  pips_debug(1, "compiling!\n");
924  pips_debug(2, "statement %" _intFMT " (%p), %zd arrays\n",
925  statement_number(stat), stat, gen_length(entities));
926 
927  // quicker for continue and so...
928  if (empty_code_p(stat))
929  {
930  pips_debug(3, "empty statement\n");
931  *hp = copy_statement(stat);
932  *np = copy_statement(stat);
933  debug_off();
934  return;
935  }
936 
937  // for each effect e on that statement
938  FOREACH(effect, e, entities)
939  {
941  pips_debug(3, "variable %s\n", entity_name(array));
942 
943  if (io_effect_entity_p(array)) // skip LUNS
944  continue;
945 
946  action act = effect_action(e);
948 
949  pips_assert("avoid replicated array I/O", /* not implemented */
951 
952  if ((!array_distributed_p(array)) && action_read_p(act))
953  {
954  pips_debug(7, "skipping array %s movements - none needed\n",
955  entity_name(array));
956  continue;
957  }
958 
959  // add array declaration on host if necessary
962 
963  // collect data if necessary
964  if (array_distributed_p(array) &&
966  (action_read_p(act) ||
967  (action_write_p(act) &&
968  approximation_may_p(apr) &&
969  !get_bool_property("HPFC_IGNORE_MAY_IN_IO"))))
970  {
972  action_tag(act), &sh, &sn);
973  lh_collect = CONS(STATEMENT, sh, lh_collect);
974  ln_collect = CONS(STATEMENT, sn, ln_collect);
975  }
976 
977  // update data if necessary
978  // action = write and data may be used later (out regions)
980  {
982  action_tag(act), &sh, &sn);
983  lh_update = CONS(STATEMENT, sh, lh_update);
984  ln_update = CONS(STATEMENT, sn, ln_update);
985  }
986  }
987 
988  lh_io = CONS(STATEMENT, copy_statement(stat), NIL);
989 
990  if (get_bool_property("HPFC_SYNCHRONIZE_IO"))
991  {
992  // could do it only for write statements
994 
995  lh_io = CONS(STATEMENT, hpfc_make_call_statement(synchro, NIL), lh_io);
996  ln_io = CONS(STATEMENT, hpfc_make_call_statement(synchro, NIL), ln_io);
997  }
998 
999  *hp = make_block_statement(gen_nconc(lh_collect,
1000  gen_nconc(lh_io,
1001  lh_update)));
1002  *np = make_block_statement(gen_nconc(ln_collect,
1003  gen_nconc(ln_io,
1004  ln_update)));
1005 
1006  DEBUG_STAT(9, "Host", *hp);
1007  DEBUG_STAT(9, "Node", *np);
1008 
1009  debug_off();
1010 }
list load_rw_effects_list(statement)
bool io_effect_entity_p(entity)
Definition: effects.c:496
#define approximation_may_p(x)
Definition: effects.h:363
#define action_write_p(x)
Definition: effects.h:314
#define effect_approximation(x)
Definition: effects.h:644
bool empty_code_p(statement)
statement.c
Definition: statement.c:86
#define SYNCHRO
#define is_movement_update
#define is_movement_collect
Efficient I/O tags.
static bool current_entity_is_updated_before_p(statement stat, entity current_entity)
IN Regions(effects) are used to verify if the entity current_entity is initialized before it's used i...
Definition: io-compile.c:84
static void add_declaration_to_host_and_link(entity array)
add a local declaration for entity array on the host.
Definition: io-compile.c:876
static bool current_entity_is_used_later_p(statement stat, entity current_entity)
HPFC module by Fabien COELHO.
Definition: io-compile.c:47
static void generate_io_collect_or_update(entity array, statement stat, tag move, tag act, statement *psh, statement *psn)
Definition: io-compile.c:769
#define _intFMT
Definition: newgen_types.h:57
#define statement_number(x)
Definition: ri.h:2452

References _intFMT, action_read_p, action_tag, action_write_p, add_declaration_to_host_and_link(), approximation_may_p, array, array_distributed_p(), bound_new_host_p(), CONS, copy_statement(), current_entity_is_updated_before_p(), current_entity_is_used_later_p(), debug_off, debug_on, DEBUG_STAT, effect_action, effect_any_reference, effect_approximation, empty_code_p(), entity_name, FOREACH, gen_length(), gen_nconc(), generate_io_collect_or_update(), get_bool_property(), hpfc_make_call_statement(), hpfc_name_to_entity(), io_effect_entity_p(), is_movement_collect, is_movement_update, load_rw_effects_list(), make_block_statement(), NIL, pips_assert, pips_debug, reference_variable, replicated_p(), STATEMENT, statement_number, and SYNCHRO.

Referenced by hpf_compiler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_in_syntax_list()

bool is_in_syntax_list ( entity  e,
list  l 
)

Definition at line 200 of file compiler-util.c.

203 {
204  MAP(SYNTAX, s,
205  if (e==reference_variable(syntax_reference(s))) return(true),
206  l);
207 
208  return(false);
209 }

References MAP, reference_variable, SYNTAX, and syntax_reference.

Referenced by AddOnceToIndicesList(), and FindDefinitionsOf_rewrite().

+ Here is the caller graph for this function:

◆ ith_dim_distributed_p()

bool ith_dim_distributed_p ( entity  array,
int  i,
int pprocdim 
)

whether a dimension is distributed or not.

Parameters
arrayrray
pprocdimprocdim

Definition at line 160 of file hpfc-util.c.

163 {
165  list lal = align_alignment(al);
166  alignment alt = FindAlignmentOfDim(lal, i);
167  entity template = align_template(al);
168  distribute dis = load_hpf_distribution(template);
169  list ld = distribute_distribution(dis);
170  distribution d;
171 
172  if (alignment_undefined_p(alt)) return(false);
173  d = FindDistributionOfDim(ld, alignment_templatedim(alt), pprocdim);
174  return(!style_none_p(distribution_style(d)));
175 }

References align_alignment, align_template, alignment_templatedim, alignment_undefined_p, array, distribute_distribution, distribution_style, FindAlignmentOfDim(), FindDistributionOfDim(), load_hpf_alignment(), load_hpf_distribution(), and style_none_p.

Referenced by align_check(), atomize_one_message(), compute_receive_content(), generate_optimized_code_for_loop_nest(), loop_flt(), NewDeclarationOfDistributedArray(), number_of_distributed_dimensions(), shape_one_message(), simple_indices_p(), and subarray_shift_assignment_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ith_dim_overlapable_p()

bool ith_dim_overlapable_p ( entity  array,
int  i 
)
Parameters
arrayrray

Definition at line 178 of file hpfc-util.c.

181 {
183  list lal = align_alignment(al);
184  alignment alt = FindAlignmentOfDim(lal, i);
185  entity template = align_template(al);
186  distribute dis = load_hpf_distribution(template);
187  list ld = distribute_distribution(dis);
188  distribution d;
189  int p;
190 
191  if (alignment_undefined_p(alt)) return false;
193 
195 }

References align_alignment, align_template, alignment_templatedim, alignment_undefined_p, array, distribute_distribution, distribution_style, FindAlignmentOfDim(), FindDistributionOfDim(), load_hpf_alignment(), load_hpf_distribution(), and style_block_p.

Referenced by add_bound_arguments(), caller_list_of_bounds(), create_parameters_h(), and declaration_with_overlaps().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ith_dim_replicated_p()

bool ith_dim_replicated_p ( entity  ,
int  ,
list  ,
distribution   
)

◆ kill_statement_number_and_ordering()

void kill_statement_number_and_ordering ( statement  s)

Definition at line 232 of file hpfc-util.c.

234 {
236 }
static void stmt_rwt(statement s)
Definition: hpfc-util.c:225

References gen_recurse, gen_true(), statement_domain, and stmt_rwt().

Referenced by compile_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ larger_message_in_list()

bool larger_message_in_list ( message  m,
list  l 
)

Definition at line 351 of file message-utils.c.

354 {
355  MAP(MESSAGE, mp, if (message_larger_p(mp, m)) return true, l);
356  return(false);
357 }
bool message_larger_p(message m1, message m2)
bool message_larger_p(m1, m2)

References MAP, MESSAGE, and message_larger_p().

Referenced by remove_stammering_messages().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lIndicesOfRef()

list lIndicesOfRef ( list  lsyn)

computes the list of indices of the list of ref that are variables...

Parameters
lsynsyn

Definition at line 147 of file compiler-util.c.

149 {
150  return((ENDP(lsyn))?
151  (NULL):
153  lIndicesOfRef(CDR(lsyn)))));
154 }
list lIndicesOfRef(list lsyn)
computes the list of indices of the list of ref that are variables...
list IndicesOfRef(syntax syn)
list AddOnceToIndicesList(list l, list lsyn)

References AddOnceToIndicesList(), CAR, CDR, ENDP, IndicesOfRef(), and SYNTAX.

Referenced by hpf_compile_parallel_body().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ list_of_distributed_arrays()

◆ list_of_distributed_arrays_for_module()

list list_of_distributed_arrays_for_module ( entity  module)

returns the list of entities that are 'local' to module

Parameters
moduleodule

Definition at line 72 of file declarations.c.

74 {
75  list l = NIL;
76 
77  MAP(ENTITY, e,
78  {
79  if (hpfc_main_entity(e)==module) l = CONS(ENTITY, e, l);
80  },
82 
83  return(l);
84 }
entity hpfc_main_entity(entity)
returns the entity to which e is attached, that is first a common, then a function....
Definition: run-time.c:462

References CONS, ENTITY, hpfc_main_entity(), list_of_distributed_arrays(), MAP, module, and NIL.

Referenced by create_init_common_param_for_arrays(), create_parameters_h(), declaration_with_overlaps_for_module(), and root_statement_remapping_inits().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ list_of_processors()

list list_of_processors ( void  )

Referenced by create_init_common_param_for_processors(), get_data_status(), max_size_of_processors(), and print_processors().

+ Here is the caller graph for this function:

◆ list_of_templates()

list list_of_templates ( void  )

Referenced by create_init_common_param_for_templates(), get_data_status(), print_distributes(), and print_templates().

+ Here is the caller graph for this function:

◆ lNewVariableForModule()

list lNewVariableForModule ( entity  module,
list  le 
)
Parameters
moduleodule
lee

Definition at line 263 of file host_node_entities.c.

266 {
267  list result, last;
268 
269  if (ENDP(le)) return(NIL);
270 
271  for (result = CONS(ENTITY,
273  NIL),
274  last = result, le = CDR(le);
275  !ENDP(le);
276  le = CDR(le), last = CDR(last))
278  NIL);
279 
280  return(result);
281 }
entity NewVariableForModule(entity module, entity e)

References CAR, CDR, CONS, ENDP, ENTITY, module, NewVariableForModule(), and NIL.

Referenced by hpf_compile_sequential_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_dynamic_hpf()

◆ load_entity_update_common()

entity load_entity_update_common ( entity  )

Referenced by update_common_rewrite(), and update_loop_rewrite().

+ Here is the caller graph for this function:

◆ load_hpf_alignment()

◆ load_hpf_distribution()

◆ load_hpf_number()

◆ load_hpf_reductions()

entities load_hpf_reductions ( statement  )

Referenced by handle_hpf_reduction(), and handle_reduction_directive().

+ Here is the caller graph for this function:

◆ load_maybeuseful_mappings()

entities load_maybeuseful_mappings ( statement  )

Referenced by generate_dynamic_liveness_management(), and propagate_maybeuseful_mappings().

+ Here is the caller graph for this function:

◆ load_new_host()

◆ load_new_node()

◆ load_old_host()

entity load_old_host ( entity  )

Referenced by debug_host_node_variables(), old_name(), and STATIC_LIST_OF_HPF_OBJECTS().

+ Here is the caller graph for this function:

◆ load_old_node()

entity load_old_node ( entity  )

Referenced by add_bound_arguments(), debug_host_node_variables(), old_name(), and STATIC_LIST_OF_HPF_OBJECTS().

+ Here is the caller graph for this function:

◆ load_overlap_status()

list load_overlap_status ( entity  )

Referenced by get_overlap(), and set_overlap().

+ Here is the caller graph for this function:

◆ load_primary_entity()

◆ load_renamings()

◆ load_similar_mapping()

◆ load_statement_only_io()

bool load_statement_only_io ( statement  )

Referenced by hpf_compiler().

+ Here is the caller graph for this function:

◆ local_integer_constant_expression()

bool local_integer_constant_expression ( expression  e)

true is the expression is locally constant, that is in the whole loop nest, the reference is not written.

??? not very portable thru pips...

Definition at line 64 of file align-checker.c.

66 {
68 
69  if ((syntax_reference_p(s)) &&
71  {
73  if (write_on_entity_p(ent)) return false;
74  }
75 
76  return true;
77 }
static bool write_on_entity_p(entity e)
Definition: align-checker.c:50

References expression_normalized, expression_syntax, normalized_linear_p, reference_variable, syntax_reference, syntax_reference_p, and write_on_entity_p().

Referenced by align_check(), and simple_indices_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loop_index_to_range()

range loop_index_to_range ( entity  index)
Parameters
indexndex

Definition at line 390 of file compiler-util.c.

392 {
393  MAP(LOOP, l, if (loop_index(l)==index) return(loop_range(l)),
395  return range_undefined;
396 }

References current_loop_list, LOOP, loop_index, loop_range, MAP, and range_undefined.

Referenced by array_access_to_array_ranges(), and generate_one_message().

+ Here is the caller graph for this function:

◆ loop_nest_guard()

statement loop_nest_guard ( statement  stat,
reference  r,
list  lkref,
list  lvref 
)

??? memory leak of some expressions

Parameters
stattat
lkrefkref
lvrefvref

Definition at line 793 of file message-utils.c.

797 {
798  entity
800  template = array_to_template(array),
801  proc = template_to_processors(template);
802  list
803  lra = array_access_to_array_ranges(r, lkref, lvref),
805  lrp = template_ranges_to_processors_ranges(template, lrt);
806  statement
807  result = generate_guarded_statement(stat, proc, lrp);
808 
809  gen_free_list(lra); /* ??? memory leak of some expressions */
810  gen_free_list(lrt);
811  gen_free_list(lrp);
812 
813  return(result);
814 }
list array_access_to_array_ranges(reference r, list lkref, list lvref)
list template_ranges_to_processors_ranges(entity template, list lrt)
statement generate_guarded_statement(statement stat, entity proc, list lr)
list array_ranges_to_template_ranges(entity array, list lra)

References array, array_access_to_array_ranges(), array_ranges_to_template_ranges(), array_to_template, gen_free_list(), generate_guarded_statement(), reference_variable, template_ranges_to_processors_ranges(), and template_to_processors.

Referenced by Overlap_Analysis().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lrange_larger_p()

bool lrange_larger_p ( list  lr1,
list  lr2 
)

can look for formal equality...

??? something more intelligent could be expected

Parameters
lr1r1
lr2r2

Definition at line 381 of file message-utils.c.

383 {
384  list l1 = lr1, l2 = lr2;
385 
386  assert(gen_length(lr1) == gen_length(lr2));
387 
388  for ( ; l1; POP(l1), POP(l2))
389  {
390  range r1 = RANGE(CAR(l1)), r2 = RANGE(CAR(l2));
391  int lo1, up1, in1, lo2, up2, in2;
392  bool
399  bcst = (blo1 && bup1 && bin1 && blo2 && bup2 && bin2);
400 
401  if (!bcst) /* can look for formal equality... */
402  {
403  return(expression_equal_p(range_lower(r1), range_lower(r2)) &&
406  }
407 
408  if (in1!=in2) return(false);
409 
410  /* ??? something more intelligent could be expected */
411  if ((in1!=1) && ((lo1!=lo2) || (up1!=up2)))
412  return(false);
413 
414  if ((in1==1) && ((lo1>lo2) || (up1<up2)))
415  return(false);
416  }
417 
418  pips_debug(7, "returning TRUE\n");
419 
420  return true;
421 }
bool expression_equal_p(expression e1, expression e2)
Syntactic equality e1==e2.
Definition: expression.c:1347

References assert, CAR, expression_equal_p(), gen_length(), hpfc_integer_constant_expression_p(), pips_debug, POP, RANGE, range_increment, range_lower, and range_upper.

Referenced by message_larger_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lUpdateExpr()

list lUpdateExpr ( entity  module,
list  l 
)
Parameters
moduleodule
lof anything

Definition at line 256 of file host_node_entities.c.

257 {
258  list new = gen_full_copy_list(l);
260  return new;
261 }
list gen_full_copy_list(list l)
Copy a list structure with element copy.
Definition: list.c:535
void update_list_for_module(list l, entity module)

References gen_full_copy_list(), module, and update_list_for_module().

Referenced by generate_c1_beta(), hpf_compile_call(), st_compute_current_computer(), and st_compute_current_owners().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lUpdateExpr_but_distributed()

list lUpdateExpr_but_distributed ( entity  module,
list  l 
)

used for compiling calls.

Parameters
moduleodule
lof expression

Definition at line 237 of file host_node_entities.c.

240 {
241  list new = NIL;
242 
243  MAP(EXPRESSION, e,
244  {
246  new = CONS(EXPRESSION, copy_expression(e), new);
247  },
248  l);
249 
250  new = gen_nreverse(new);
252  return new;
253 }

References array_distributed_p(), CONS, copy_expression(), EXPRESSION, expression_to_entity(), gen_nreverse(), MAP, module, NIL, and update_list_for_module().

Referenced by hpf_compile_call().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_guard_expression()

bool make_guard_expression ( entity  proc,
list  lrref,
expression pguard 
)

bool make_guard_expression(proc, lr, pguard)

compute the expression for the processors ranges lr guard. return true if not empty, false if empty.

empty match case

??? memory leak with the content of conjonction

MYPOS(i, procnum).EQ.nn

MYPOS(i, procnum).GE.(rloexpr)

MYPOS(i, procnum).LE.(rupexpr)

use of conjonction

no guard

Parameters
procroc
lrrefrref
pguardguard

Definition at line 702 of file message-utils.c.

706 {
707  int i, len = -1;
709  list lr = lrref, conjonction = NIL;
710 
711  for (i=1 ; i<=NumberOfDimension(proc) ; i++, lr=CDR(lr))
712  {
713  range rg = RANGE(CAR(lr));
714  expression
715  rloexpr = range_lower(rg),
716  rupexpr = range_upper(rg);
717  dimension d = FindIthDimension(proc, i);
718  int
721  sz = up-lo+1,
722  rlo = HpfcExpressionToInt(rloexpr),
723  rup = HpfcExpressionToInt(rupexpr);
724 
725  if (rlo>rup) /* empty match case */
726  {
727  (*pguard) = entity_to_expression(entity_intrinsic(".FALSE."));
728  return(true); /* ??? memory leak with the content of conjonction */
729  }
730 
731  if ((rlo==rup) && (sz!=1) && (rlo>=lo) && (rup<=up))
732  {
733  /* MYPOS(i, procnum).EQ.nn
734  */
735  conjonction =
737  eq_expression(make_mypos_expression(i, procnum), rloexpr),
738  conjonction);
739  }
740  else
741  {
742  if (rlo>lo)
743  {
744  /* MYPOS(i, procnum).GE.(rloexpr)
745  */
746  conjonction =
748  ge_expression(make_mypos_expression(i, procnum), rloexpr),
749  conjonction);
750  }
751 
752  if (rup<up)
753  {
754  /* MYPOS(i, procnum).LE.(rupexpr)
755  */
756  conjonction =
758  le_expression(make_mypos_expression(i, procnum), rupexpr),
759  conjonction);
760  }
761  }
762  }
763 
764  /* use of conjonction
765  */
766 
767  len = gen_length(conjonction);
768 
769  if (len==0) /* no guard */
770  {
771  (*pguard) = expression_undefined;
772  return(false);
773  }
774  else
775  {
776  (*pguard) = expression_list_to_conjonction(conjonction);
777  gen_free_list(conjonction);
778  return(true);
779  }
780 }
expression make_mypos_expression(int i, expression exp)
#define ge_expression(e1, e2)
#define le_expression(e1, e2)
#define eq_expression(e1, e2)
expression expression_list_to_conjonction(list l)
Definition: expression.c:1937

References CAR, CDR, CONS, dimension_lower, dimension_upper, entity_intrinsic(), entity_to_expression(), eq_expression, EXPRESSION, expression_list_to_conjonction(), expression_undefined, FindIthDimension(), ge_expression, gen_free_list(), gen_length(), HpfcExpressionToInt(), int_to_expression(), le_expression, load_hpf_number(), make_mypos_expression(), NIL, NumberOfDimension(), RANGE, range_lower, and range_upper.

Referenced by generate_guarded_statement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_host_and_node_modules()

void make_host_and_node_modules ( entity  module)

compile.c

HOST and NODE empty routines...

Arity and result

then the variable corresponding to the function name must be created for those new functions. The overloaded basic is used to be sure that the variable will not be put in the declarations by the enforced coherency. ??? this issue could be managed by the coherency function ?

to allow the update of the call sites.

Parameters
moduleodule

Definition at line 45 of file compile.c.

46 {
47  const char* name = entity_local_name(module);
48  entity host, node;
49 
51  return;
52 
54  {
57  }
58  else
59  {
60  string tmp;
61 
62  /* HOST and NODE empty routines...
63  */
64  tmp = strdup(concatenate(name, "_", HOST_NAME, NULL));
66  free(tmp);
67 
68  tmp = strdup(concatenate(name, "_", NODE_NAME, NULL));
70  free(tmp);
71 
72  /* Arity and result
73  */
76 
78  {
79  /* then the variable corresponding to the function name
80  * must be created for those new functions. The overloaded
81  * basic is used to be sure that the variable will not be put
82  * in the declarations by the enforced coherency.
83  * ??? this issue could be managed by the coherency function ?
84  */
85  string
86  var_name = concatenate(name, MODULE_SEP_STRING, name, NULL);
87  entity
88  var = gen_find_tabulated(var_name, entity_domain), neh, nen;
89 
90  pips_assert("defined", !entity_undefined_p(var));
91 
92  const char* tmp_name = entity_local_name(host);
93  neh = find_or_create_scalar_entity(tmp_name, tmp_name,
95  tmp_name = entity_local_name(node);
96  nen = find_or_create_scalar_entity(tmp_name, tmp_name,
98  store_new_host_node_variable(neh, nen, var);
99  }
100  }
101 
102  /* to allow the update of the call sites.
103  */
106 }
static void node(FILE *out, string name)
Build for module name a node and link to its successors.
Definition: graph.c:56
void store_new_host_node_variable(entity neh, entity nen, entity old)
#define update_functional_as_model(e, model)
Definition: defines-local.h:98
#define MODULE_SEP_STRING
Definition: naming-local.h:30
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
entity make_empty_subroutine(const char *name, language l)
Definition: entity.c:268
bool entity_main_module_p(entity e)
Definition: entity.c:700
bool entity_function_p(entity e)
Definition: entity.c:724
entity find_or_create_scalar_entity(const char *, const char *, tag)
Looks for an entity which should be a scalar of the specified basic.
Definition: variable.c:1025
@ is_basic_overloaded
Definition: ri.h:574
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410

References bound_new_node_p(), concatenate(), entity_domain, entity_function_p(), entity_local_name(), entity_main_module_p(), entity_undefined_p, find_or_create_scalar_entity(), free(), gen_find_tabulated(), HOST_NAME, is_basic_overloaded, make_empty_subroutine(), make_language_fortran(), module, MODULE_SEP_STRING, node(), NODE_NAME, pips_assert, store_new_host_node_variable(), store_new_host_variable(), store_new_node_variable(), strdup(), and update_functional_as_model.

Referenced by compile_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_hpfc_current_mappings()

void make_hpfc_current_mappings ( void  )

??? used with a temporary hack to differentiate array and templates

Definition at line 192 of file build-system.c.

193 {
194  make_declaration_constraints_map();
195  make_hpf_align_constraints_map();
196  make_hpf_distribute_constraints_map();
197  make_new_declaration_constraints_map();
198 }

Referenced by set_resources_for_module().

+ Here is the caller graph for this function:

◆ make_list_of_dummy_variables()

list make_list_of_dummy_variables ( entity(*)(void)  ,
int   
)

◆ make_mypos_expression()

expression make_mypos_expression ( int  i,
expression  exp 
)
Parameters
expxp

Definition at line 782 of file message-utils.c.

785 {
790  NIL)))));
791 }

References CONS, exp, EXPRESSION, hpfc_name_to_entity(), int_to_expression(), make_reference(), MYPOS, NIL, and reference_to_expression().

Referenced by make_guard_expression().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_only_io_map()

void make_only_io_map ( void  )

◆ make_rectangular_area()

list make_rectangular_area ( statement  st,
entity  var 
)
Parameters
stt
varar

Definition at line 597 of file special_cases.c.

598 {
599  list l = NIL;
600  Psysteme
602  var));
604  Variable idx;
607 
609  c = sc_inegalites(s);
610  sc_inegalites(s) = (Pcontrainte)NULL,
611  sc_rm(s);
612 
613  for(; dim>0; dim--)
614  {
615  idx = (Variable) get_ith_region_dummy(dim);
616 
617  constraints_for_bounds(idx, &c, &lower, &upper);
618 
619  l = CONS(EXPRESSION, constraints_to_loop_bound(lower, idx, true, div),
620  CONS(EXPRESSION, constraints_to_loop_bound(upper, idx, false, div),
621  l));
622 
623  (void) contraintes_free(lower), lower=NULL;
624  (void) contraintes_free(upper), upper=NULL;
625  }
626 
627  (void) contraintes_free(c);
628 
629  return l;
630 }
#define CONTRAINTE_UNDEFINED
struct Scontrainte * Pcontrainte
void constraints_for_bounds(Variable, Pcontrainte *, Pcontrainte *, Pcontrainte *)
void constraints_for_bounds(var, pinit, plower, pupper) Variable var; Pcontrainte *pinit,...
Definition: unaires.c:176
expression constraints_to_loop_bound(Pcontrainte, Variable, bool, entity)
expression constraints_to_loop_bound(c, var, is_lower)
#define IDIVIDE
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
void sc_transform_eg_in_ineg(Psysteme sc)
Package sc.
Psysteme get_read_effect_area(list le, entity var)

References CONS, constraints_for_bounds(), constraints_to_loop_bound(), CONTRAINTE_UNDEFINED, contraintes_free(), entity_type, EXPRESSION, gen_length(), get_ith_region_dummy(), get_read_effect_area(), hpfc_name_to_entity(), IDIVIDE, load_statement_local_regions(), NIL, sc_dup(), sc_rm(), sc_transform_eg_in_ineg(), type_variable, and variable_dimensions.

Referenced by generate_subarray_shift().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_reference_expression()

expression make_reference_expression ( entity  ,
entity(*)(void)   
)

◆ make_update_common_map()

void make_update_common_map ( void  )

Referenced by hpfc_directives_handler().

+ Here is the caller graph for this function:

◆ MakeRunTimeSupportFunction()

entity MakeRunTimeSupportFunction ( string  ,
int  ,
tag   
)

Referenced by make_reduction_function().

+ Here is the caller graph for this function:

◆ MakeRunTimeSupportSubroutine()

entity MakeRunTimeSupportSubroutine ( string  ,
int   
)

run-time.c

Referenced by hpfc_ith_broadcast_function(), make_new_reduction_function(), and make_shift_subroutine().

+ Here is the caller graph for this function:

◆ MakeStatementLike()

statement MakeStatementLike ( statement  stat,
int  the_tag 
)

creates a new statement for the given module that looks like the stat one, i.e.

same comment, same label, and so on. The goto table is updated. The instruction is also created. (is that really a good idea?)

Parameters
stattat
the_taghe_tag

Definition at line 203 of file hpfc-util.c.

206 {
207  void* x = loop_undefined;
208  string c = statement_comments(stat);
209  statement new_s;
210 
211  if (the_tag==is_instruction_sequence)
212  x = make_sequence(NIL);
213 
214 
215  new_s = make_statement(statement_label(stat),
218  string_undefined_p(c)? c: strdup(c),
219  make_instruction(the_tag, x),NIL,NULL,
222  return new_s;
223 }
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
Definition: ri.c:2222
synchronization make_synchronization_none(void)
Definition: ri.c:2424
sequence make_sequence(list a)
Definition: ri.c:2125
extensions copy_extensions(extensions p)
EXTENSIONS.
Definition: ri.c:947
void fix_statement_attributes_if_sequence(statement)
Apply fix_sequence_statement_attributes() on the statement only if it really a sequence.
Definition: statement.c:2078
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
Definition: newgen-local.h:35
#define string_undefined_p(s)
Definition: newgen_types.h:41
#define STATEMENT_NUMBER_UNDEFINED
default values
#define loop_undefined
Definition: ri.h:1612
@ is_instruction_sequence
Definition: ri.h:1469
#define statement_extensions(x)
Definition: ri.h:2464
#define statement_comments(x)
Definition: ri.h:2456

References copy_extensions(), fix_statement_attributes_if_sequence(), is_instruction_sequence, loop_undefined, make_instruction(), make_sequence(), make_statement(), make_synchronization_none(), NIL, statement_comments, statement_extensions, statement_label, STATEMENT_NUMBER_UNDEFINED, STATEMENT_ORDERING_UNDEFINED, strdup(), string_undefined_p, and x.

Referenced by hpf_compile_block(), hpf_compile_call(), hpf_compile_parallel_loop(), hpf_compile_sequential_loop(), hpf_compile_test(), and hpf_compile_unstructured().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ max_size_of_processors()

int max_size_of_processors ( void  )

Definition at line 120 of file inits.c.

121 {
122  int current_max = 1;
123 
124  MAP(ENTITY, e,
125  {
126  variable a;
127 
128  pips_assert("variable", type_variable_p(entity_type(e)));
129  a = type_variable(entity_type(e));
130 
133  },
135 
136  return current_max;
137 }
static int current_max
int element_number(basic, list)
END_EOLE.
Definition: size.c:391
#define variable_basic(x)
Definition: ri.h:3120

References current_max, element_number(), ENTITY, entity_type, list_of_processors(), MAP, max, pips_assert, type_variable, type_variable_p, variable_basic, and variable_dimensions.

Referenced by create_common_parameters_h().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maybeuseful_mappings_undefined_p()

bool maybeuseful_mappings_undefined_p ( void  )

◆ message_larger_p()

bool message_larger_p ( message  m1,
message  m2 
)

bool message_larger_p(m1, m2)

true if m1>=m2... (caution, it is only a partial order)

Parameters
m11
m22

Definition at line 363 of file message-utils.c.

365 {
366  if (message_array(m1)!=message_array(m2))
367  return(false);
368 
371  return(false);
372 
373  /*
374  * same array and same destination, let's look at the content and domain...
375  */
376 
379 }
#define value_ne(v1, v2)
bool lrange_larger_p(list lr1, list lr2)

References lrange_larger_p(), message_array, message_content, message_dom, message_neighbour, TCST, value_ne, and vect_coeff().

Referenced by larger_message_in_list().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ messages_handling()

statement messages_handling ( list  Ro,
list  lRo 
)

messages.c

messages.c

first kind of messages generation

a message is an array, a mixed content on the local array, a set of neighbours (in a Pvecteur) and an array section concerned.

here should be performed some message coalescing and/or aggregation: a first simple version could check for messages sent twice, and so on.

RECEIVE

Parameters
Roo
lRoRo

Definition at line 724 of file messages.c.

726 {
727  list
728  lm1 = NIL,
729  lm2 = NIL,
730  lm2p = NIL,
731  lm3 = NIL,
732  lm3p = NIL,
733  lm4 = NIL,
734  lms = NIL,
735  lmr = NIL,
736  lsend = NIL,
737  lreceive = NIL;
738  int
739  len = gen_length(Ro);
740 
741  assert(len==(int)gen_length(lRo) && len>=1);
742 
743  /* first kind of messages generation
744  *
745  * a message is
746  * an array,
747  * a mixed content on the local array,
748  * a set of neighbours (in a Pvecteur) and
749  * an array section concerned.
750  */
751  lm1 = messages_generation(Ro, lRo);
752 
753  debug(6, "messages_handling", "lm1 length is %d\n", gen_length(lm1));
754  ifdebug(8)
755  {
756  fprint_lmessage(stderr, lm1);
757  }
758 
759  /*
760  * second kind of messages generation
761  *
762  * messages are atomized to real messages:
763  * a message is
764  * an array,
765  * a content (on the local array),
766  * a neighbour to send to (in a Pvecteur),
767  * a domain of the array concerned.
768  */
769  lm2 = messages_atomization(lm1);
770  gen_free_list(lm1);
771 
772  debug(6, "messages_handling",
773  "lm2 length is %d\n", gen_length(lm2));
774  ifdebug(8)
775  {
776  fprint_lmessage(stderr, lm2);
777  }
778 
780  gen_free_list(lm2);
781 
782  debug(6, "messages_handling",
783  "lm2p length is %d\n", gen_length(lm2p));
784  ifdebug(8)
785  {
786  fprint_lmessage(stderr, lm2p);
787  }
788 
789 
790  /*
791  * third kind of messages generation
792  *
793  * the domain is restricted to what is necessary for the
794  * given message, and this on every distributed dimension...
795  * this is important for the guards generation later on.
796  */
797  lm3 = messages_shaping(lm2p);
798  gen_free_list(lm2p);
799 
800  debug(6, "messages_handling",
801  "lm3 length is %d\n", gen_length(lm3));
802  ifdebug(8)
803  {
804  fprint_lmessage(stderr, lm3);
805  }
806 
807 
808  lm3p = keep_non_empty_domain_messages(lm3);
809  gen_free_list(lm3);
810 
811  debug(6, "messages_handling", "lm3p length is %d\n", gen_length(lm3p));
812  ifdebug(8) fprint_lmessage(stderr, lm3p);
813 
814  /*
815  * fourth kind of messages generation
816  *
817  * the array section domain is translated into a processors section,
818  * and the neighbour shift is computed for the linearized processors
819  * arrangement considered in the runtime resolution.
820  */
821  lm4 = messages_guards_and_neighbour(lm3p);
822  gen_free_list(lm3p);
823 
824  debug(6, "messages_handling", "lm4 length is %d\n", gen_length(lm4));
825  ifdebug(8) fprint_lmessage(stderr, lm4);
826 
827  /* here should be performed some message coalescing and/or aggregation:
828  * a first simple version could check for messages sent twice, and so on.
829  */
830  hpfc_warning("messages coalescing and aggregation not implemented\n");
831 
832  lms = remove_stammering_messages(lm4);
833 
834  /* RECEIVE
835  */
836  lmr = receive_messages_generation(lms);
837 
838  assert(gen_length(lmr)==gen_length(lms));
839 
840  ifdebug(8)
841  {
842  fprintf(stderr, "[message handling] lmr and lms\n");
843  fprint_lmessage(stderr, lmr);
844  fprint_lmessage(stderr, lms);
845  }
846 
847  lsend = generate_the_messages(lms, SEND);
848  lreceive = generate_the_messages(lmr, RECEIVE);
849 
850  return(make_block_statement(gen_nconc(lsend, lreceive)));
851 }
void fprint_lmessage(FILE *file, list l)
Definition: debug-util.c:231
#define RECEIVE
#define hpfc_warning
WARNING.
#define SEND
static list keep_non_empty_messages_with_destination(list l)
Definition: messages.c:438
static list messages_guards_and_neighbour(list l)
Definition: messages.c:588
static list keep_non_empty_domain_messages(list l)
Definition: messages.c:455
static list messages_generation(list Ro, list lRo)
list messages_generation(Ro, lRo)
Definition: messages.c:319
static list generate_the_messages(list lm, bool bsend)
Definition: messages.c:689
static list receive_messages_generation(list lms)
list receive_messages_generation(lms)
Definition: messages.c:623
static list remove_stammering_messages(list lm)
list remove_stammering_messages(lm)
Definition: messages.c:704
static list messages_shaping(list l)
Definition: messages.c:535
static list messages_atomization(list lm1)
Definition: messages.c:428
statement messages_handling(list Ro, list lRo)
every required conditions are supposed to be verified in this function.
Definition: messages.c:724

References assert, debug(), fprint_lmessage(), fprintf(), gen_free_list(), gen_length(), gen_nconc(), generate_the_messages(), hpfc_warning, ifdebug, keep_non_empty_domain_messages(), keep_non_empty_messages_with_destination(), make_block_statement(), messages_atomization(), messages_generation(), messages_guards_and_neighbour(), messages_shaping(), NIL, RECEIVE, receive_messages_generation(), remove_stammering_messages(), and SEND.

Referenced by Overlap_Analysis().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ new_align_with_template()

align new_align_with_template ( align  a,
entity  t 
)

Definition at line 474 of file dynamic.c.

477 {
478  align b = copy_align(a);
479  align_template(b) = t;
480  return b;
481 }

References align_template, and copy_align().

Referenced by one_distribute_directive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ new_declaration_tag()

tag new_declaration_tag ( entity  array,
int  dim 
)
Parameters
arrayrray
dimim

Definition at line 229 of file declarations.c.

232 {
233  tag t;
234 
235  pips_assert("valid dimension and distributed array",
236  dim>0 && dim<=7 && array_distributed_p(array));
237 
238  t = hpf_newdecl_tag
239  (HPF_NEWDECL(gen_nth(dim-1,
240  hpf_newdecls_dimensions(load_new_declaration(array)))));
241 
242  pips_debug(1, "%s[%d]: %d\n", entity_name(array), dim, t);
243 
244  return(t);
245 }
#define hpf_newdecls_dimensions(x)
Definition: hpf_private.h:739
#define hpf_newdecl_tag(x)
Definition: hpf_private.h:692
#define HPF_NEWDECL(x)
HPF_NEWDECL.
Definition: hpf_private.h:644

References array, array_distributed_p(), entity_name, gen_nth(), HPF_NEWDECL, hpf_newdecl_tag, hpf_newdecls_dimensions, pips_assert, and pips_debug.

Referenced by block_distributed_p(), create_init_common_param_for_arrays(), expr_compute_local_index(), and hpfc_compute_entity_to_new_declaration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ new_host_undefined_p()

bool new_host_undefined_p ( void  )

◆ new_node_undefined_p()

bool new_node_undefined_p ( void  )

◆ NewDeclarationsOfDistributedArrays()

void NewDeclarationsOfDistributedArrays ( void  )

this procedure generate the new declarations of every distributed arrays of the program, in order to minimize the amount of memory used.

The new declarations have to be suitable for the new index computation which is to be done dynamically...

Definition at line 676 of file declarations.c.

677 {
678  MAP(ENTITY, array,
679  {
680  if (!bound_new_declaration_p(array))
682  else
683  pips_debug(3, "skipping array %s\n", entity_name(array));
684  },
686 }
static void NewDeclarationOfDistributedArray(entity array)
for node this are reformated, and for host these variables are deleted.
Definition: declarations.c:615

References array, ENTITY, entity_name, list_of_distributed_arrays(), MAP, NewDeclarationOfDistributedArray(), and pips_debug.

Referenced by init_host_and_node_entities().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NewVariableForModule()

entity NewVariableForModule ( entity  module,
entity  e 
)
Parameters
moduleodule

Definition at line 283 of file host_node_entities.c.

286 {
287  if (module==host_module)
288  {
289  if (bound_new_host_p(e))
290  return load_new_host(e);
291  }
292  else
293  {
294  if (bound_new_node_p(e))
295  return load_new_node(e);
296  }
297 
298  pips_internal_error("unexpected entity %s", entity_name(e));
299 
300  return entity_undefined;
301 }

References bound_new_host_p(), bound_new_node_p(), entity_name, entity_undefined, host_module, load_new_host(), load_new_node(), module, and pips_internal_error.

Referenced by hpf_compile_parallel_loop(), hpf_compile_sequential_loop(), and lNewVariableForModule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalize_align()

void normalize_align ( entity  ,
align   
)

◆ normalize_distribute()

void normalize_distribute ( entity  t,
distribute  d 
)

of distribution

Definition at line 408 of file declarations.c.

411 {
413  list /* of distribution */ ld = distribute_distribution(d);
414  int tdim = 1, pdim = 1;
415 
417 
418  MAP(DISTRIBUTION, di,
419  NormalizeOneTemplateDistribution(di, t, &tdim, p, &pdim), ld);
420 
421  if ((pdim-1)!=NumberOfDimension(p))
422  pips_user_error("%s not enough distributions\n", entity_name(t));
423 
424 }
static void NormalizeOneTemplateDistribution(distribution d, entity templ, int *templdimp, entity procs, int *procsdimp)
NormalizeOneTemplateDistribution.
Definition: declarations.c:352
#define pips_user_error
Definition: misc-local.h:147
void normalize_first_expressions_of(void *obj)
Definition: normalize.c:694

References distribute_distribution, distribute_processors, DISTRIBUTION, entity_name, MAP, normalize_first_expressions_of(), NormalizeOneTemplateDistribution(), NumberOfDimension(), and pips_user_error.

Referenced by one_distribute_directive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalize_hpf_object()

void normalize_hpf_object ( entity  v)

Definition at line 431 of file declarations.c.

433 {
435 }

References entity_type, and normalize_first_expressions_of().

+ Here is the call graph for this function:

◆ NormalizeCodeForHpfc()

void NormalizeCodeForHpfc ( statement  s)

reference test

function call test

test condition test

range test

whileloop test

Definition at line 848 of file compile.c.

849 {
853  hpfc_decision, /* reference test */
854  (bool(*)(call,expression)) gen_false2, /* function call test */
855  (bool(*)(test,expression)) test_atomization,/* test condition test */
856  (bool(*)(range,expression)) gen_false2, /* range test */
857  (bool(*)(whileloop,expression)) gen_false2, /* whileloop test */
859 }
void atomize_as_required(statement, bool(*)(reference, expression), bool(*)(call, expression), bool(*)(test, expression), bool(*)(range, expression), bool(*)(whileloop, expression), entity(*)(entity, basic))
bool gen_false2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
Definition: genClib.c:2801
static void extract_distributed_non_constant_terms(statement s)
transformation: DOALL I,J ...
Definition: compile.c:826
static bool hpfc_decision(reference r, expression e)
break expression e in reference r if ...
Definition: compile.c:625
static bool test_atomization(test t, _UNUSED_ expression e)
Definition: compile.c:841
void normalize_all_expressions_of(void *obj)
Definition: normalize.c:668

References atomize_as_required(), extract_distributed_non_constant_terms(), gen_false2(), hpfc_decision(), hpfc_new_variable(), normalize_all_expressions_of(), and test_atomization().

Referenced by compile_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NormalizeCommonVariables()

void NormalizeCommonVariables ( entity  module,
statement  stat 
)

the new entities for the common variables are created and inserted in the common. The declarations are updated.

the references within the program are updated with the new entities

Parameters
moduleodule
stattat

Definition at line 940 of file compile.c.

943 {
944  list ldecl = code_declarations(entity_code(module)), lnewdecl = NIL, ltmp;
945  entity common, new_e;
946 
947  /* the new entities for the common variables are created and
948  * inserted in the common. The declarations are updated.
949  */
950  MAP(ENTITY, e,
951  {
952  if (entity_in_common_p(e))
953  {
954  common = ram_section(storage_ram(entity_storage(e)));
955  new_e = AddEntityToModule(e, common);
956  ltmp = area_layout(type_area(entity_type(common)));
957 
958  if (gen_find_eq(new_e, ltmp)==entity_undefined)
959  gen_insert_after(new_e, e, ltmp);
960 
961  lnewdecl = CONS(ENTITY, new_e, lnewdecl);
962  store_entity_update_common(e, new_e);
963 
964  pips_debug(8, "module %s: %s -> %s\n",
966  }
967  else
968  lnewdecl = CONS(ENTITY, e, lnewdecl);
969  },
970  ldecl);
971 
972  gen_free_list(ldecl);
973  code_declarations(entity_code(module)) = lnewdecl;
974 
975  /* the references within the program are updated with the new entities
976  */
978 }
void * gen_find_eq(const void *item, const list seq)
Definition: list.c:422
void gen_insert_after(const void *no, const void *o, list l)
Definition: list.c:223
void update_common_references_in_obj(void *obj)
Definition: compile.c:911
void store_entity_update_common(entity, entity)
code entity_code(entity e)
Definition: entity.c:1098
#define code_declarations(x)
Definition: ri.h:784
#define area_layout(x)
Definition: ri.h:546
#define type_area(x)
Definition: ri.h:2946

References AddEntityToModule(), area_layout, code_declarations, CONS, ENTITY, entity_code(), entity_in_common_p(), entity_name, entity_storage, entity_type, entity_undefined, gen_find_eq(), gen_free_list(), gen_insert_after(), MAP, module, NIL, pips_debug, ram_section, storage_ram, store_entity_update_common(), type_area, and update_common_references_in_obj().

Referenced by hpfc_directives_handler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NormalizeHpfDeclarations()

void NormalizeHpfDeclarations ( void  )

Definition at line 437 of file declarations.c.

438 {
440  ifdebug(8){print_hpf_dir();}
441 }
void print_hpf_dir(void)
Definition: debug-util.c:121
void GiveToHpfObjectsTheirNumber()
give to hpf objects listed in distributedarrays, templates and processors their number for the code g...
Definition: declarations.c:166

References GiveToHpfObjectsTheirNumber(), ifdebug, and print_hpf_dir().

Referenced by compile_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ number_of_distributed_arrays()

int number_of_distributed_arrays ( void  )

declarations.c

Referenced by create_common_parameters_h().

+ Here is the caller graph for this function:

◆ number_of_processors()

int number_of_processors ( void  )

Referenced by create_common_parameters_h().

+ Here is the caller graph for this function:

◆ number_of_templates()

int number_of_templates ( void  )

Referenced by create_common_parameters_h().

+ Here is the caller graph for this function:

◆ old_host_undefined_p()

bool old_host_undefined_p ( void  )

◆ old_node_undefined_p()

bool old_node_undefined_p ( void  )

◆ only_io_map_undefined_p()

bool only_io_map_undefined_p ( void  )

◆ only_io_mapping_initialize()

void only_io_mapping_initialize ( statement  program)
Parameters
programrogram

Definition at line 163 of file io-util.c.

165 {
166  debug_on("HPFC_IO_DEBUG_LEVEL");
168  debug_off();
169 }
void set_only_io_map(statement_mapping)
static statement_mapping only_io_mapping(statement program, statement_mapping map)
Definition: io-util.c:142
#define MAKE_STATEMENT_MAPPING()
Definition: newgen-local.h:43

References debug_off, debug_on, MAKE_STATEMENT_MAPPING, only_io_mapping(), and set_only_io_map().

Referenced by set_resources_for_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Overlap_Analysis()

bool Overlap_Analysis ( statement  stat,
statement pstat 
)

check conditions and compile...

keeps only written references of which dimensions are block distributed, and indices simple enough (=> normalization of loops may be usefull). ??? bug: should also search for A(i,i) things that are forbidden...

ok distributed variable written !

must chose the computer among read references!

??? what about loop splitting

??? memory leak

??? memory leak

Now, we have the following situation: Wa: set of aligned written refs, the first of which is `‘the’' ref.

here is the situation now:

Wa set of aligned references written, Ra set of aligned references read, Ro set of nearly aligned references that suits the overlap analysis

messages handling

generate the local loop for every processor, given the global loop bounds. The former indexes have to be computed, and the loops are based upon new indexes, of which names have to be propagated in the body of the loop. This generation is to be based on the normalized form computed for every references of Ro, but it is direct for Ra and Wa, since new declarations implied that the alignment is performed for distributed indices. Not distributed dimensions indices have not to be touched, (at least if no new declarations are the common case)

Parameters
stattat
pstatstat

Definition at line 870 of file o-analysis.c.

872 {
873  list lw = NIL, lr = NIL, Ra = NIL, Ro = NIL, Rrt = NIL,
874  lWa = NIL, lRa = NIL, lRo = NIL, W = NIL, Wa = NIL,
875  Wrt = NIL, lvect = NIL, lkind = NIL, R=NIL;
876  syntax the_computer_syntax = syntax_undefined;
877  reference the_computer_reference = reference_undefined;
878  statement innerbody, messages_stat, newloopnest;
879  bool computer_is_written = true;
880 
881  DEBUG_STAT(9, "considering statement", stat);
882 
884  set_current_loops(stat);
885 
886  lblocks = NIL,
887  lloop = NIL;
888  innerbody = parallel_loop_nest_to_body(stat, &lblocks, &lloop);
889 
890  FindRefToDistArrayInStatement(stat, &lw, &lr);
891 
892  /* keeps only written references of which dimensions are block distributed,
893  * and indices simple enough (=> normalization of loops may be usefull).
894  * ??? bug: should also search for A(i,i) things that are forbidden...
895  */
896  MAP(SYNTAX, s,
897  {
900 
901  if ((block_distributed_p(array)) &&
902  (simple_indices_p(r)) && (!replicated_p(array)))
903  W = CONS(SYNTAX, s, W);
904  else
905  Wrt = CONS(SYNTAX, s, Wrt);
906  },
907  lw);
908 
909  pips_debug(9, "choosing computer\n");
910 
911  if (W) /* ok distributed variable written ! */
912  {
913  the_computer_syntax = choose_one_syntax_in_references_list(&W);
914  the_computer_reference = syntax_reference(the_computer_syntax);
915  Wa = CONS(SYNTAX, the_computer_syntax, NIL);
916  }
917  else /* must chose the computer among read references! */
918  {
919  computer_is_written = false;
920 
921  MAP(SYNTAX, s,
922  {
925 
926  if ((block_distributed_p(array)) &&
927  (simple_indices_p(r)) && (!replicated_p(array)))
928  R = CONS(SYNTAX, s, R);
929  },
930  lr);
931 
932  if (R)
933  {
934  the_computer_syntax = choose_one_syntax_in_references_list(&R);
935  the_computer_reference = syntax_reference(the_computer_syntax);
936  Ra = CONS(SYNTAX, the_computer_syntax, NIL);
937  }
938  else
939  RETURN(false);
940  }
941 
942  if (!align_check(the_computer_reference,
943  the_computer_reference, &lvect, &lkind))
944  pips_internal_error("no self alignment!");
945 
946  if (computer_is_written)
947  lWa = CONS(LIST, CONS(LIST, lkind, CONS(LIST, lvect, NIL)), NIL);
948  else
949  lRa = CONS(LIST, CONS(LIST, lkind, CONS(LIST, lvect, NIL)), NIL);
950 
951  pips_debug(9, "checking alignments\n");
952 
953  MAP(SYNTAX, s,
954  {
956  if (the_computer_reference==r)
957  continue;
958  if (align_check(the_computer_reference, r, &lvect, &lkind))
959  {
960  if (aligned_p(the_computer_reference, r, lvect, lkind))
961  {
962  Wa = gen_nconc(Wa, CONS(SYNTAX, s, NIL));
963  lWa = gen_nconc(lWa, CONS(LIST,
964  CONS(LIST, lkind,
965  CONS(LIST, lvect, NIL)),
966  NIL));
967  }
968  else /* ??? what about loop splitting */
969  {
970  Wrt = gen_nconc(Wrt, CONS(SYNTAX, s, NIL));
972  gen_free_list(lkind); /* ??? memory leak */
973  }
974  }
975  else
976  {
977  Wrt = gen_nconc(Wrt, CONS(SYNTAX, s, NIL));
979  gen_free_list(lkind); /* ??? memory leak */
980  }
981  },
982  W);
983 
984  pips_debug(5, "Wa length is %zd (%zd), Wrt lenght is %zd\n",
985  gen_length(Wa), gen_length(lWa), gen_length(Wrt));
986 
987  if (gen_length(Wrt)!=0)
988  RETURN(false);
989 
990  /* Now, we have the following situation:
991  * Wa: set of aligned written refs, the first of which is ``the'' ref.
992  */
993  MAP(SYNTAX, s,
994  {
997  list lvect = NIL;
998  list lkind = NIL;
999 
1000  if (the_computer_reference==r) continue;
1001 
1002  pips_debug(6, "dealing with reference of array %s\n",
1003  entity_name(array));
1004 
1005  ifdebug(6)
1006  {
1007  fprintf(stderr, "[Overlap_Analysis]\nreference is:\n");
1008  print_reference(r);
1009  fprintf(stderr, "\n");
1010  }
1011 
1012  if (align_check(the_computer_reference, r, &lvect, &lkind))
1013  {
1014  if (aligned_p(the_computer_reference, r, lvect, lkind))
1015  {
1016  Ra = gen_nconc(Ra, CONS(SYNTAX, s, NIL));
1017  lRa = gen_nconc(lRa, CONS(LIST,
1018  CONS(LIST, lkind,
1019  CONS(LIST, lvect, NIL)),
1020  NIL));
1021  }
1022  else
1023  if (message_manageable_p(array, lvect, lkind))
1024  {
1025  Ro = gen_nconc(Ro, CONS(SYNTAX, s, NIL));
1026  lRo = gen_nconc(lRo, CONS(LIST,
1027  CONS(LIST, lkind,
1028  CONS(LIST, lvect, NIL)),
1029  NIL));
1030  }
1031  else
1032  {
1033  Rrt = gen_nconc(Rrt, CONS(SYNTAX, s, NIL));
1035  gen_free_list(lkind);
1036  }
1037  }
1038  else
1039  {
1040  Rrt = gen_nconc(Rrt, CONS(SYNTAX, s, NIL));
1042  gen_free_list(lkind);
1043  }
1044  },
1045  lr);
1046 
1047  debug(5, "Overlap_Analysis",
1048  "Ra length is %d, Ro length is %d, Rrt lenght is %d\n",
1049  gen_length(Ra), gen_length(Ro), gen_length(Rrt));
1050 
1051  if (gen_length(Rrt)!=0)
1052  RETURN(false);
1053 
1054  /* here is the situation now:
1055  *
1056  * Wa set of aligned references written,
1057  * Ra set of aligned references read,
1058  * Ro set of nearly aligned references that suits the overlap analysis
1059  */
1060 
1061  /* messages handling
1062  */
1063  messages_stat = ((gen_length(Ro)>0)?
1064  (messages_handling(Ro, lRo)):
1066 
1067  /* generate the local loop for every processor, given the global loop
1068  * bounds. The former indexes have to be computed, and the loops are
1069  * based upon new indexes, of which names have to be propagated in the
1070  * body of the loop. This generation is to be based on the normalized
1071  * form computed for every references of Ro, but it is direct for
1072  * Ra and Wa, since new declarations implied that the alignment is
1073  * performed for distributed indices. Not distributed dimensions
1074  * indices have not to be touched, (at least if no new declarations are
1075  * the common case)
1076  */
1078  (innerbody, &newloopnest, the_computer_syntax,
1079  Wa, Ra, Ro, lWa, lRa, lRo))
1080  RETURN(false);
1081 
1082  DEBUG_STAT(9, entity_name(node_module), newloopnest);
1083 
1084  (*pstat) =
1086  (CONS(STATEMENT, messages_stat,
1087  CONS(STATEMENT,
1088  loop_nest_guard(newloopnest,
1089  the_computer_reference,
1090  CONSP(CAR(CONSP(CAR(computer_is_written? lWa: lRa)))),
1091  CONSP(CAR(CDR(CONSP(CAR(computer_is_written? lWa: lRa)))))),
1092  NIL)));
1093 
1094  DEBUG_STAT(8, entity_name(node_module), *pstat);
1095 
1096  RETURN(true);
1097 }
bool align_check(reference r1, reference r2, list *plvect, list *plkind)
computes the shift vector that links the two references, true if every thing is ok,...
void set_current_loops(statement obj)
void FindRefToDistArrayInStatement(statement obj, list *lwp, list *lrp)
void set_hpfc_current_statement(statement)
statement messages_handling(list, list)
messages.c
Definition: messages.c:724
statement loop_nest_guard(statement, reference, list, list)
static syntax choose_one_syntax_in_references_list(list *pls)
one of the syntax is chosen from the list.
Definition: o-analysis.c:601
static bool generate_optimized_code_for_loop_nest(statement innerbody, statement *pstat, syntax the_computer_syntax, list Wa, list Ra, list Ro, list lWa, list lRa, list lRo)
Definition: o-analysis.c:739
static list lblocks
Overlap Analysis Module for HPFC.
Definition: o-analysis.c:38
static bool message_manageable_p(entity array, list lpref, list lkref)
every thing should be manageable, i.e.
Definition: o-analysis.c:202
static bool simple_indices_p(reference r)
true if indices are constants or index
Definition: o-analysis.c:64
#define RETURN(x)
must clear everything before returning in Overlap_Analysis...
Definition: o-analysis.c:860
bool block_distributed_p(entity array)
true if there is no cyclic distribution for the array
Definition: o-analysis.c:44
static bool aligned_p(reference r1, reference r2, list lvref, list lkref)
true if references are aligned or, for constants, on the same processor...
Definition: o-analysis.c:144
static list lloop
Definition: o-analysis.c:38
#define reference_undefined
Definition: ri.h:2302
#define syntax_undefined
Definition: ri.h:2676
static list lvect

References align_check(), aligned_p(), array, block_distributed_p(), CAR, CDR, choose_one_syntax_in_references_list(), CONS, CONSP, debug(), DEBUG_STAT, entity_empty_label(), entity_name, FindRefToDistArrayInStatement(), fprintf(), gen_free_list(), gen_length(), gen_nconc(), generate_optimized_code_for_loop_nest(), ifdebug, lblocks, LIST, lloop, loop_nest_guard(), lvect, make_block_statement(), make_continue_statement(), MAP, message_manageable_p(), messages_handling(), NIL, node_module, parallel_loop_nest_to_body(), pips_debug, pips_internal_error, print_reference(), reference_undefined, reference_variable, replicated_p(), RETURN, set_current_loops(), set_hpfc_current_statement(), simple_indices_p(), STATEMENT, SYNTAX, syntax_reference, and syntax_undefined.

Referenced by hpf_compile_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ overlap_status_undefined_p()

bool overlap_status_undefined_p ( void  )

◆ parallel_loop_nest_to_body()

statement parallel_loop_nest_to_body ( statement  loop_nest,
list pblocks,
list ploops 
)

nothing was done for the first !

Parameters
loop_nestoop_nest
pblocksblocks
ploopsloops

Definition at line 336 of file compiler-util.c.

339 {
340  loops=NIL, n_loops=0;
341  blocks=NIL, n_levels=0;
343 
345 
346  gen_multi_recurse(loop_nest,
349  NULL);
350 
351  pips_assert("loops found", n_loops!=0 && (n_loops-n_levels==1));
352 
353  *pblocks = CONS(LIST, NIL, blocks); /* nothing was done for the first ! */
354  *ploops=loops;
355 
356  return(inner_body);
357 }
static int n_loops
list of lists, may be NIL if none
static bool loop_filter(loop l)
static list blocks
lisp of loops
static void loop_rewrite(loop l)
static void sequence_rewrite(sequence s)
static int n_levels
static list loops
static statement inner_body
#define instruction_loop_p(x)
Definition: ri.h:1518
#define loop_domain
newgen_language_domain_defined
Definition: ri.h:218
#define sequence_domain
newgen_reference_domain_defined
Definition: ri.h:346

References blocks, CONS, gen_multi_recurse(), gen_true(), inner_body, instruction_loop_p, LIST, loop_domain, loop_filter(), loop_rewrite(), loops, n_levels, n_loops, NIL, pips_assert, sequence_domain, sequence_rewrite(), statement_instruction, and statement_undefined.

Referenced by full_copy_p(), and Overlap_Analysis().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ primary_entity_undefined_p()

bool primary_entity_undefined_p ( void  )

◆ print_align()

void print_align ( align  a)

debug-util.c

debug-util.c

Fabien Coelho, May 1993.

Definition at line 38 of file debug-util.c.

39 {
40  (void) fprintf(stderr, "aligned (%zd dimensions)\n",
43  (void) fprintf(stderr, "to template %s\n\n",
45 }
void print_alignment(alignment a)
Definition: debug-util.c:47

References align_alignment, align_template, entity_name, fprintf(), gen_length(), gen_map(), and print_alignment().

Referenced by array_synonym_aligned_as(), ComputeNewSizeOfIthDimension(), one_align_directive(), and print_aligns().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_alignment()

void print_alignment ( alignment  a)

Definition at line 47 of file debug-util.c.

48 {
49  (void) fprintf(stderr,
50  "Alignment: arraydim %"PRIdPTR", templatedim %"PRIdPTR",\n",
53 
54  (void) fprintf(stderr,"rate: ");
56  (void) fprintf(stderr,"\nconstant: ");
58  (void) fprintf(stderr,"\n");
59 }

References alignment_arraydim, alignment_constant, alignment_rate, alignment_templatedim, fprintf(), and print_expression().

Referenced by print_align().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_aligns()

void print_aligns ( void  )

Definition at line 61 of file debug-util.c.

62 {
63  fprintf(stderr,"Aligns:\n");
64  MAP(ENTITY, a,
65  {
66  (void) fprintf(stderr, "of array %s\n", entity_name(a));
68  (void) fprintf(stderr,"\n");
69  },
71 }

References ENTITY, entity_name, fprintf(), list_of_distributed_arrays(), load_hpf_alignment(), MAP, and print_align().

Referenced by print_hpf_dir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_distribute()

void print_distribute ( distribute  d)

Definition at line 87 of file debug-util.c.

88 {
89  (void) fprintf(stderr,"distributed\n");
90 
92 
93  (void) fprintf(stderr, "to processors %s\n\n",
95 }
void print_distribution(distribution d)
Definition: debug-util.c:97

References distribute_distribution, distribute_processors, entity_name, fprintf(), gen_map(), and print_distribution().

Referenced by ComputeNewSizeOfIthDimension(), and print_distributes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_distributed_arrays()

void print_distributed_arrays ( void  )

Definition at line 148 of file debug-util.c.

149 {
150  (void) fprintf(stderr,"Distributed Arrays:\n");
152 }
void print_entity_variable(entity e)
print_entity_variable(e)
Definition: entity.c:56

References fprintf(), gen_map(), list_of_distributed_arrays(), and print_entity_variable().

Referenced by print_hpf_dir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_distributes()

void print_distributes ( void  )

Definition at line 73 of file debug-util.c.

74 {
75  fprintf(stderr,"Distributes:\n");
76 
77  MAP(ENTITY, t,
78  {
79  (void) fprintf(stderr, "of template %s\n", entity_name(t));
81  (void) fprintf(stderr,"\n");
82  },
84 
85 }
void print_distribute(distribute d)
Definition: debug-util.c:87

References ENTITY, entity_name, fprintf(), list_of_templates(), load_hpf_distribution(), MAP, and print_distribute().

Referenced by print_hpf_dir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_distribution()

void print_distribution ( distribution  d)

Definition at line 97 of file debug-util.c.

98 {
99  switch(style_tag(distribution_style(d)))
100  {
101  case is_style_none:
102  (void) fprintf(stderr,"none, ");
103  break;
104  case is_style_block:
105  (void) fprintf(stderr,"BLOCK(");
107  (void) fprintf(stderr,"), ");
108  break;
109  case is_style_cyclic:
110  (void) fprintf(stderr,"CYCLIC(");
112  (void) fprintf(stderr,"), ");
113  break;
114  default:
115  pips_internal_error("unexpected style tag");
116  break;
117  }
118  (void) fprintf(stderr,"\n");
119 }

References distribution_parameter, distribution_style, fprintf(), is_style_block, is_style_cyclic, is_style_none, pips_internal_error, print_expression(), and style_tag.

Referenced by print_distribute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_hpf_dir()

void print_hpf_dir ( void  )

Definition at line 121 of file debug-util.c.

122 {
123  (void) fprintf(stderr,"HPF directives:\n");
124 
125  print_templates();
126  (void) fprintf(stderr,"--------\n");
128  (void) fprintf(stderr,"--------\n");
130  (void) fprintf(stderr,"--------\n");
131  print_aligns();
132  (void) fprintf(stderr,"--------\n");
134 }
void print_processors(void)
Definition: debug-util.c:142
void print_distributes(void)
Definition: debug-util.c:73
void print_distributed_arrays(void)
Definition: debug-util.c:148
void print_aligns(void)
Definition: debug-util.c:61
void print_templates(void)
Definition: debug-util.c:136

References fprintf(), print_aligns(), print_distributed_arrays(), print_distributes(), print_processors(), and print_templates().

Referenced by NormalizeHpfDeclarations().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_processors()

void print_processors ( void  )

Definition at line 142 of file debug-util.c.

143 {
144  (void) fprintf(stderr,"Processors:\n");
146 }

References fprintf(), gen_map(), list_of_processors(), and print_entity_variable().

Referenced by print_hpf_dir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_templates()

void print_templates ( void  )

Definition at line 136 of file debug-util.c.

137 {
138  (void) fprintf(stderr,"Templates:\n");
140 }

References fprintf(), gen_map(), list_of_templates(), and print_entity_variable().

Referenced by print_hpf_dir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processor_dimension_of_template_dimension()

int processor_dimension_of_template_dimension ( entity  template,
int  dim 
)
Parameters
templateemplate
dimim

Definition at line 462 of file hpfc-util.c.

465 {
466  int pdim = 0, n;
467  if (dim>=0) get_distribution(template, dim, &pdim, &n);
468  return pdim;
469 }

References get_distribution().

+ Here is the call graph for this function:

◆ processor_number()

int processor_number ( entity  template,
int  tdim,
int  tcell,
int pprocdim 
)

int processor_number(template, tdim, tcell, pprocdim)

the processor number of a template cell, on dimension *pprocdim template dimension, template cell

just to avoid a gcc warning

Parameters
templateemplate
tdimdim
tcellcell
pprocdimprocdim

Definition at line 492 of file hpfc-util.c.

495 {
496  distribute d = load_hpf_distribution(template);
498  entity procs = distribute_processors(d);
499  distribution di = FindDistributionOfDim(ld, tdim, pprocdim);
500  style st = distribution_style(di);
501  int n, tmin, pmin, psiz;
502 
503  if (style_none_p(st))
504  {
505  *pprocdim = -1;
506  return -1;
507  }
508 
509  tmin = HpfcExpressionToInt
510  (dimension_lower(FindIthDimension(template, tdim)));
511  pmin = HpfcExpressionToInt
512  (dimension_lower(FindIthDimension(procs, *pprocdim)));
513  psiz = SizeOfIthDimension(procs, *pprocdim);
515 
516  if (style_block_p(st))
517  return ((tcell-tmin)/n)+pmin;
518 
519  if (style_cyclic_p(st))
520  return (((tcell-tmin)/n)%psiz)+pmin;
521 
522  *pprocdim = -1; /* just to avoid a gcc warning */
523  return -1;
524 }

References dimension_lower, distribute_distribution, distribute_processors, distribution_parameter, distribution_style, FindDistributionOfDim(), FindIthDimension(), HpfcExpressionToInt(), load_hpf_distribution(), SizeOfIthDimension(), style_block_p, style_cyclic_p, and style_none_p.

Referenced by aligned_p(), on_same_proc_p(), and template_ranges_to_processors_ranges().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processors_dim_replicated_p()

bool processors_dim_replicated_p ( entity  ,
entity  ,
int   
)

◆ propagate_synonym()

void propagate_synonym ( statement  s,
entity  old,
entity  new,
bool  is_array 
)
Parameters
oldld
newew
is_arrays_array

Definition at line 1096 of file dynamic.c.

1101 {
1103 
1104  what_stat_debug(3, s);
1105  pips_debug(3, "%s -> %s (%s)\n", entity_name(old), entity_name(new),
1106  is_array? "array": "template");
1107  DEBUG_STAT(7, "before propagation", get_current_module_statement());
1108 
1110  array_propagation = is_array;
1111  array_used = false;
1112  array_modified = false;
1113  initial_statement = s;
1114 
1116 
1118 
1121 
1123 
1126 
1129 
1130  DEBUG_STAT(7, "after propagation", get_current_module_statement());
1131 
1132  pips_debug(4, "out\n");
1133 }
bool next_ctrl_graph_travel(statement *)
Definition: graph.c:325
void init_ctrl_graph_travel(statement, bool(*)(statement))
Definition: graph.c:315
void close_ctrl_graph_travel(void)
Definition: graph.c:340
static void lazy_initialize_for_statement(statement s)
starting point
Definition: dynamic.c:870
static entity new_variable
entity to be replaced, the primary?
Definition: dynamic.c:860
static bool continue_propagation_p(statement s)
Definition: dynamic.c:990
static void simple_switch_old_to_new(statement s)
Definition: dynamic.c:941
static void add_as_a_modified_variable(entity e)
Definition: dynamic.c:910
static void add_as_a_used_variable(entity e)
Definition: dynamic.c:897
static entity old_variable
void propagate_synonym(s, old, new) statement s; entity old, new;
Definition: dynamic.c:859
static bool array_used
true if an array is propagated, false if template
Definition: dynamic.c:863
static bool array_modified
true if the array was actually used
Definition: dynamic.c:864
static statement initial_statement
true if the array may be modified...
Definition: dynamic.c:866
static bool array_propagation
replacement
Definition: dynamic.c:862

References add_as_a_modified_variable(), add_as_a_used_variable(), array_modified, array_propagation, array_used, close_ctrl_graph_travel(), continue_propagation_p(), current, DEBUG_STAT, entity_name, entity_undefined, get_current_module_statement(), init_ctrl_graph_travel(), initial_statement, lazy_initialize_for_statement(), new_variable, next_ctrl_graph_travel(), old_variable, pips_debug, safe_load_primary_entity(), simple_switch_old_to_new(), and what_stat_debug.

Referenced by handle_prescriptive_directive(), initial_alignment(), one_align_directive(), and one_distribute_directive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ put_generated_resources_for_common()

void put_generated_resources_for_common ( entity  common)
Parameters
commonommon

Definition at line 417 of file compile.c.

418 {
419  FILE *host_file, *node_file, *parm_file, *init_file;
420  string host_name, node_name, parm_name, init_name, dir_name;
421  entity node_common, host_common;
422 
423  node_common = load_new_node(common),
424  host_common = load_new_host(common);
425  const char *prefix = module_local_name(common);
427 
428  host_name = src(prefix, HINC_SUFFIX);
429  node_name = src(prefix, NINC_SUFFIX);
430  parm_name = src(prefix, PARM_SUFFIX);
431  init_name = src(prefix, INIT_SUFFIX);
432 
433  host_file = hpfc_fopen(full_name(dir_name, host_name));
434  hpfc_print_common(host_file, host_module, host_common);
435  hpfc_fclose(host_file, host_name);
436 
437  node_file = hpfc_fopen(full_name(dir_name, node_name));
438  hpfc_print_common(node_file, node_module, node_common);
439  hpfc_fclose(node_file, node_name);
440 
441  parm_file = hpfc_fopen(full_name(dir_name, parm_name));
442  create_parameters_h(parm_file, common);
443  hpfc_fclose(parm_file, parm_name);
444 
445  init_file = hpfc_fopen(full_name(dir_name, init_name));
446  create_init_common_param_for_arrays(init_file, common);
447  hpfc_fclose(init_file, init_name);
448 
449  ifdebug(1)
450  {
451  fprintf(stderr, "Result of HPFC for common %s\n", entity_name(common));
452  fprintf(stderr, "-----------------\n");
453 
454  hpfc_print_file(parm_name);
455  hpfc_print_file(init_name);
456  hpfc_print_file(host_name);
457  hpfc_print_file(node_name);
458  }
459 
460  free(parm_name),
461  free(init_name),
462  free(host_name),
463  free(node_name);
464 }
void hpfc_print_file(string file_name)
Definition: debug-util.c:169
void hpfc_print_common(FILE *file, entity module, entity common)
Definition: debug-util.c:154
#define full_name(dir, name)
Definition: compile.c:414
FILE * hpfc_fopen(string name)
Definition: compile.c:329
void hpfc_fclose(FILE *f, string name)
Definition: compile.c:341
#define NINC_SUFFIX
#define PARM_SUFFIX
#define HINC_SUFFIX
#define INIT_SUFFIX
void create_init_common_param_for_arrays(FILE *, entity)
Definition: inits.c:158
void create_parameters_h(FILE *, entity)
create_parameters_h
Definition: inits.c:65

References create_init_common_param_for_arrays(), create_parameters_h(), db_get_current_workspace_directory(), entity_name, fprintf(), free(), full_name, HINC_SUFFIX, host_module, hpfc_fclose(), hpfc_fopen(), hpfc_print_common(), hpfc_print_file(), ifdebug, INIT_SUFFIX, load_new_host(), load_new_node(), module_local_name(), NINC_SUFFIX, node_module, PARM_SUFFIX, prefix, and src.

Referenced by compile_common().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ put_generated_resources_for_module()

void put_generated_resources_for_module ( statement  ,
statement  ,
statement   
)

◆ put_generated_resources_for_program()

void put_generated_resources_for_program ( string  )

◆ pvm_what_option_expression()

expression pvm_what_option_expression ( entity  v)

Definition at line 74 of file run-time.c.

75 {
76  pips_assert("variable", entity_variable_p(v));
77 
80 }
string pvm_what_options(basic b)
string pvm_what_options(b)
Definition: run-time.c:86

References entity_basic(), entity_variable_p, MakeCharacterConstantExpression(), pips_assert, pvm_what_options(), and strdup().

Referenced by st_call_send_or_receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pvm_what_options()

string pvm_what_options ( basic  b)

string pvm_what_options(b)

the pvm what option is given back as a string, fellowing the basic given.

Definition at line 86 of file run-time.c.

88 {
89  switch (basic_tag(b))
90  {
91  case is_basic_int:
92  switch (basic_int(b))
93  {
94  case 2: return(PVM_INTEGER2);
95  case 4: return(PVM_INTEGER4);
96  default:
97  pips_internal_error("unexpected integer*%d", basic_int(b));
98  }
99  case is_basic_float:
100  switch (basic_float(b))
101  {
102  case 4: return(PVM_REAL4);
103  case 8: return(PVM_REAL8);
104  default:
105  pips_internal_error("unexpected real*%d", basic_float(b));
106  }
107  case is_basic_logical:
108  switch (basic_logical(b))
109  {
110  case 2: return(PVM_INTEGER2);
111  case 4: return(PVM_INTEGER4);
112  default:
113  pips_internal_error("unexpected logical*%d", basic_logical(b));
114  }
115  case is_basic_overloaded:
116  pips_internal_error("overloaded not welcomed");
117  case is_basic_complex:
118  switch (basic_complex(b))
119  {
120  case 8: return(PVM_COMPLEX8);
121  case 16: return(PVM_COMPLEX16);
122  default:
123  pips_internal_error("unexpected complex*%d", basic_complex(b));
124  }
125  case is_basic_string:
126  return(PVM_STRING);
127  default:
128  pips_internal_error("unexpected basic tag");
129  }
130  return("ERROR");
131 }
#define PVM_REAL4
#define PVM_COMPLEX16
#define PVM_COMPLEX8
#define PVM_REAL8
#define PVM_INTEGER2
#define PVM_STRING
#define PVM_INTEGER4
@ is_basic_string
Definition: ri.h:576
@ is_basic_float
Definition: ri.h:572
@ is_basic_logical
Definition: ri.h:573
@ is_basic_complex
Definition: ri.h:575
#define basic_int(x)
Definition: ri.h:616
#define basic_tag(x)
Definition: ri.h:613
#define basic_logical(x)
Definition: ri.h:622
#define basic_float(x)
Definition: ri.h:619
#define basic_complex(x)
Definition: ri.h:628

References basic_complex, basic_float, basic_int, basic_logical, basic_tag, is_basic_complex, is_basic_float, is_basic_int, is_basic_logical, is_basic_overloaded, is_basic_string, pips_internal_error, PVM_COMPLEX16, PVM_COMPLEX8, PVM_INTEGER2, PVM_INTEGER4, PVM_REAL4, PVM_REAL8, and PVM_STRING.

Referenced by hpfc_buffer_entity(), make_new_reduction_function(), make_packing_function(), make_reduction_function(), make_shift_subroutine(), and pvm_what_option_expression().

+ Here is the caller graph for this function:

◆ ref_to_dist_array_p()

bool ref_to_dist_array_p ( void *  obj)

hpfc-util.c

hpfc-util.c

Fabien Coelho, May 1993. Predicates true if there is a reference to a distributed array within obj

??? not very intelligent, should use the regions, the problem is that I should normalize the code before the pips analysis...

Parameters
objbj

Definition at line 48 of file hpfc-util.c.

49 {
50  list l = FindRefToDistArray(obj);
51  bool b = (l!=NIL);
52 
53  gen_free_list(l); return(b);
54 }

References FindRefToDistArray(), gen_free_list(), and NIL.

Referenced by call_filter(), hpf_compile_call(), and test_atomization().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ references_aligned_p()

bool references_aligned_p ( reference  r1,
reference  r2 
)

of expression

both references must be aligned to the same template and be of the same arity.

Parameters
r11
r22

Definition at line 726 of file hpfc-util.c.

727 {
728  entity e1 = reference_variable(r1),
729  e2 = reference_variable(r2);
730  list /* of expression */ le1 = reference_indices(r1),
731  le2 = reference_indices(r2);
732  int dim1 = 1, dim2;
733  entity index;
734  align a1, a2;
735 
736  if (!array_distributed_p(e1) || !array_distributed_p(e2))
737  {
738  XDEBUG("not distributed"); return false;
739  }
740 
741  a1 = load_hpf_alignment(e1);
742  a2 = load_hpf_alignment(e2);
743 
744  /* both references must be aligned to the same template
745  * and be of the same arity.
746  */
747  if (align_template(a1)!=align_template(a2))
748  {
749  XDEBUG("template is different"); return false;
750  }
751 
752  if (gen_length(le1)!=gen_length(le2))
753  {
754  XDEBUG("arities are different"); return false;
755  }
756 
757  MAP(EXPRESSION, ind,
758  {
759  if (!expression_reference_p(ind))
760  return false;
761 
763  dim2 = expression_number_for_index(index, le2);
764 
765  if (!alignments_compatible_p(e1, dim1, e2, dim2))
766  {
767  XDEBUG("alignments are incompatible"); return false;
768  }
769 
770  dim1++;
771  },
772  le1);
773 
774  XDEBUG("aligned!"); return true;
775 }
#define XDEBUG(msg)
Definition: hpfc-util.c:722
bool alignments_compatible_p(entity e1, int dim1, entity e2, int dim2)
bool alignments_compatible_p(entity e1, int dim1, entity e2, int dim2)
Definition: hpfc-util.c:678
static int expression_number_for_index(entity index, list le)
bool references_aligned_p(reference r1, reference r2)
Definition: hpfc-util.c:706

References align_template, alignments_compatible_p(), array_distributed_p(), EXPRESSION, expression_number_for_index(), expression_reference_p(), expression_syntax, gen_length(), load_hpf_alignment(), MAP, reference_indices, reference_variable, syntax_reference, and XDEBUG.

Referenced by full_copy_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remapping_already_computed_p()

bool remapping_already_computed_p ( renaming  x)

list of already computed remappings...

exported interface

Definition at line 105 of file hpfc.c.

106 {
107  entity src = renaming_old(x), trg = renaming_new(x);
108 
109  MAP(REMAPPING, r,
110  {
112  if (renaming_old(p)==src && renaming_new(p)==trg)
113  return true;
114  },
115  get_computed_remaps());
116 
117  return false;
118 }

References MAP, REMAPPING, remapping_renaming, renaming_new, renaming_old, src, and x.

Referenced by remapping_compile().

+ Here is the caller graph for this function:

◆ remapping_compile()

void remapping_compile ( statement  s,
statement hsp,
statement nsp 
)

void remapping_compile(s, hsp, nsp) statement s, *hsp, *nsp;

what: generates the remapping code for s. how: polyhedron technique. input: s, the statement. output: statements *hsp and *nsp, the host and SPMD node code. side effects: (none?) bugs or features: idem Node

of statements

nothing for host

comment at the end

dynamic liveness management if required

remapping codes (indirect thru include)

KILL => status update

comment at the beginning

block of remaps for the nodes

Parameters
hspinitial statement in the source code
nspHost Statement Pointer

Definition at line 1302 of file remapping.c.

1306 {
1307  statement tmp;
1308  list /* of statements */ l = NIL;
1309 
1310  debug_on("HPFC_REMAPPING_DEBUG_LEVEL");
1311  what_stat_debug(1, s);
1312 
1313  *hsp = make_empty_statement(); /* nothing for host */
1314 
1315  /* comment at the end
1316  */
1317  tmp = make_empty_statement();
1318  {
1319  string comment = strdup(concatenate("! end remappings\n", NULL));
1321  free(comment);
1322  }
1323  l = CONS(STATEMENT, tmp, l);
1324 
1325  /* dynamic liveness management if required
1326  */
1327  if (get_bool_property("HPFC_DYNAMIC_LIVENESS"))
1328  {
1330  }
1331 
1332  /* remapping codes (indirect thru include)
1333  */
1334  MAP(RENAMING, r,
1335  {
1336  pips_debug(7, "remapping %s -> %s\n", entity_name(renaming_old(r)),
1338  if (renaming_old(r)==renaming_new(r)) /* KILL => status update */
1340  l);
1341  else
1342  {
1345 
1348  }
1349  },
1350  load_renamings(s));
1351 
1352  /* comment at the beginning
1353  */
1354  tmp = make_empty_statement();
1355  {
1356  string comment = strdup(concatenate("! begin remappings\n", NULL));
1358  free(comment);
1359  }
1360  l = CONS(STATEMENT, tmp, l);
1361 
1362  *nsp = make_block_statement(l); /* block of remaps for the nodes */
1363  DEBUG_STAT(8, "result", *nsp);
1364 
1365  debug_off();
1366 }
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
Definition: freia_spoc.c:52
void insert_comments_to_statement(statement, const char *)
Insert a comment string (if non empty) at the beginning of the comments of a statement.
Definition: statement.c:1916
void add_remapping_as_used(renaming x)
Definition: hpfc.c:135
bool remapping_already_computed_p(renaming x)
list of already computed remappings...
Definition: hpfc.c:105
list load_renamings(statement)
static statement generate_dynamic_liveness_management(statement s)
Definition: remapping.c:985
static statement generate_remapping_include(renaming r)
just a hack because pips does not have 'include'
Definition: remapping.c:1246
static void generate_hpf_remapping_file(renaming r)
Definition: remapping.c:1200
static statement set_array_status_to_target(entity trg)
Definition: remapping.c:801

References add_remapping_as_used(), comment(), concatenate(), CONS, debug_off, debug_on, DEBUG_STAT, entity_name, free(), generate_dynamic_liveness_management(), generate_hpf_remapping_file(), generate_remapping_include(), get_bool_property(), insert_comments_to_statement(), load_renamings(), make_block_statement(), make_empty_statement, MAP, NIL, pips_debug, remapping_already_computed_p(), RENAMING, renaming_new, renaming_old, set_array_status_to_target(), STATEMENT, strdup(), and what_stat_debug.

Referenced by hpf_compiler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_variables_from_system()

void remove_variables_from_system ( Psysteme ps,
list plv 
)
Parameters
pss
plvlv

Definition at line 345 of file io-compile.c.

348 {
349  MAP(ENTITY, e,
350  {
351  pips_debug(8, "removing variable %s\n", entity_local_name(e));
352  sc_projection_along_variable_ofl_ctrl(ps, (Variable) e, NO_OFL_CTRL);
353  },
354  *plv);
355 
356  gen_free_list(*plv), *plv=NIL;
357 }
#define NO_OFL_CTRL

References ENTITY, entity_local_name(), gen_free_list(), MAP, NIL, NO_OFL_CTRL, and pips_debug.

Referenced by clean_the_system().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_variables_if_possible()

void remove_variables_if_possible ( Psysteme psyst,
list plvars 
)
Parameters
psystsyst
plvarslvars

Definition at line 245 of file io-compile.c.

248 {
249  Psysteme syst = *psyst;
250  list kept = NIL;
251 
252  MAP(ENTITY, e,
253  {
254  Variable var = (Variable) e;
255  Value coeff = VALUE_MONE;
256 
257  (void) contrainte_var_min_coeff(sc_egalites(syst), var, &coeff, false);
258 
259  if (value_one_p(coeff))
260  {
261  Pvecteur v = vect_new(var, VALUE_ONE);
262  bool exact = true;
263 
264  pips_debug(7, "removing variable %s\n",
265  entity_local_name((entity) var));
266 
267  sc_projection_along_variables_with_test_ofl_ctrl
268  (&syst, v, &exact, NO_OFL_CTRL);
269 
270  pips_assert("exact projection", exact);
271  vect_rm(v);
272  }
273  else
274  kept = CONS(ENTITY, (entity) var, kept);
275  },
276  *plvars);
277 
278  base_rm(sc_base(syst)), sc_base(syst) = BASE_NULLE, sc_creer_base(syst);
279 
280  *psyst = syst;
281  gen_free_list(*plvars), *plvars=kept;
282 }
#define value_one_p(val)
Pcontrainte contrainte_var_min_coeff(Pcontrainte, Variable, Value *, bool)
Pcontrainte contrainte_var_min_coeff(Pcontrainte contraintes, Variable v, int *coeff) input : a list ...
Definition: unaires.c:345

References BASE_NULLE, base_rm, CONS, contrainte_var_min_coeff(), ENTITY, entity_local_name(), gen_free_list(), MAP, NIL, NO_OFL_CTRL, pips_assert, pips_debug, sc_creer_base(), VALUE_MONE, VALUE_ONE, value_one_p, vect_new(), and vect_rm().

Referenced by clean_shared_io_system(), and clean_the_system().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renamings_undefined_p()

bool renamings_undefined_p ( void  )

◆ replicated_p()

bool replicated_p ( entity  e)

replicated_p

check whether the distributed array e is replicated or not.

Definition at line 96 of file hpfc-util.c.

97 {
98  int i, ntdim;
99  align a;
100  list la, ld;
101  entity template;
102  distribute d;
103 
104  pips_assert("distributed array", array_distributed_p(e));
105 
106  a = load_hpf_alignment(e);
107  la = align_alignment(a);
108  template = align_template(a);
109  d = load_hpf_distribution(template);
110  ld = distribute_distribution(d);
111  ntdim = NumberOfDimension(template);
112 
113  for(i=1; i<=ntdim; i++, POP(ld))
114  if (ith_dim_replicated_p(template, i, la, DISTRIBUTION(CAR(ld))))
115  return true;
116 
117  return false;
118 }
bool ith_dim_replicated_p(_UNUSED_ entity template, int i, list la, distribution dist)
bool ith_dim_replicated_p(template, i, la, dist)
Definition: hpfc-util.c:125

References align_alignment, align_template, array_distributed_p(), CAR, distribute_distribution, DISTRIBUTION, ith_dim_replicated_p(), load_hpf_alignment(), load_hpf_distribution(), NumberOfDimension(), pips_assert, and POP.

Referenced by generate_update_distributed_value_from_host(), generate_update_values_on_computer_and_nodes(), generate_update_values_on_nodes(), hpfc_broadcast_buffers(), if_different_pe_and_not_twin(), io_efficient_compile(), Overlap_Analysis(), st_receive_from(), st_send_to_computer_if_necessary(), and st_send_to_host_and_nodes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset_current_loops()

void reset_current_loops ( void  )

Definition at line 377 of file compiler-util.c.

378 {
381 }

References current_loop_list, gen_free_list(), and NIL.

+ Here is the call graph for this function:

◆ reset_data_status()

void reset_data_status ( void  )

Definition at line 320 of file declarations.c.

321 {
322  reset_new_declaration();
326 }
void reset_hpf_alignment(void)
void reset_hpf_distribution(void)

References reset_hpf_alignment(), reset_hpf_distribution(), and reset_hpf_object_lists().

Referenced by reset_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset_dynamic_hpf()

void reset_dynamic_hpf ( void  )

Referenced by reset_dynamic_status().

+ Here is the caller graph for this function:

◆ reset_dynamic_status()

void reset_dynamic_status ( void  )

reset_similar_mapping();

Definition at line 90 of file dynamic.c.

91 {
96  /* reset_similar_mapping(); */
97 }
void reset_maybeuseful_mappings(void)
void reset_dynamic_hpf(void)
void reset_renamings(void)
void reset_primary_entity(void)

References reset_dynamic_hpf(), reset_maybeuseful_mappings(), reset_primary_entity(), and reset_renamings().

Referenced by reset_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset_entity_status()

void reset_entity_status ( void  )

Definition at line 110 of file host_node_entities.c.

111 {
112  reset_new_host();
113  reset_old_host();
114  reset_new_node();
115  reset_old_node();
116 }
void reset_new_node(void)
void reset_old_node(void)
void reset_old_host(void)
void reset_new_host(void)

References reset_new_host(), reset_new_node(), reset_old_host(), and reset_old_node().

Referenced by reset_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset_hpf_alignment()

void reset_hpf_alignment ( void  )

Referenced by reset_data_status().

+ Here is the caller graph for this function:

◆ reset_hpf_distribution()

void reset_hpf_distribution ( void  )

Referenced by reset_data_status().

+ Here is the caller graph for this function:

◆ reset_hpf_number()

void reset_hpf_number ( void  )

Referenced by reset_hpf_number_status().

+ Here is the caller graph for this function:

◆ reset_hpf_number_status()

void reset_hpf_number_status ( void  )

Definition at line 142 of file declarations.c.

143 {
145  init_currents();
146 }
void reset_hpf_number(void)

References init_currents(), and reset_hpf_number().

Referenced by reset_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset_hpf_object_lists()

void reset_hpf_object_lists ( void  )

Definition at line 91 of file declarations.c.

92 {
93  distributed_arrays = NIL,
94  templates = NIL,
95  processors = NIL;
96 }

References NIL.

Referenced by free_hpf_object_lists(), init_data_status(), and reset_data_status().

+ Here is the caller graph for this function:

◆ reset_hpf_reductions()

void reset_hpf_reductions ( void  )

Referenced by reset_hpfc_status().

+ Here is the caller graph for this function:

◆ reset_hpfc_current_statement()

void reset_hpfc_current_statement ( void  )

◆ reset_maybeuseful_mappings()

void reset_maybeuseful_mappings ( void  )

Referenced by reset_dynamic_status().

+ Here is the caller graph for this function:

◆ reset_new_host()

void reset_new_host ( void  )

Referenced by reset_entity_status().

+ Here is the caller graph for this function:

◆ reset_new_node()

void reset_new_node ( void  )

Referenced by reset_entity_status().

+ Here is the caller graph for this function:

◆ reset_old_host()

void reset_old_host ( void  )

Referenced by reset_entity_status().

+ Here is the caller graph for this function:

◆ reset_old_node()

void reset_old_node ( void  )

Referenced by reset_entity_status().

+ Here is the caller graph for this function:

◆ reset_only_io_map()

void reset_only_io_map ( void  )

◆ reset_overlap_status()

void reset_overlap_status ( void  )

Referenced by reset_hpfc_status().

+ Here is the caller graph for this function:

◆ reset_primary_entity()

void reset_primary_entity ( void  )

Referenced by reset_dynamic_status().

+ Here is the caller graph for this function:

◆ reset_renamings()

void reset_renamings ( void  )

Referenced by reset_dynamic_status().

+ Here is the caller graph for this function:

◆ reset_similar_mapping()

void reset_similar_mapping ( void  )

◆ reset_the_dynamics()

void reset_the_dynamics ( void  )

◆ reset_update_common_map()

void reset_update_common_map ( void  )

◆ root_statement_remapping_inits()

statement root_statement_remapping_inits ( statement  root)

returns the initialization statement: must initialize the status and liveness of arrays

of statement

of entity

LIVENESS(...) = .TRUE. STATUS(...) = ...

LIVENESS(...) = .FALSE.

Parameters
rootoot

Definition at line 1265 of file remapping.c.

1267 {
1268  list /* of statement */ ls = NIL;
1269  list /* of entity */ le =
1271 
1272  /* LIVENESS(...) = .TRUE.
1273  * STATUS(...) = ...
1274  */
1275  MAP(RENAMING, r,
1277  load_renamings(root));
1278 
1279  /* LIVENESS(...) = .FALSE.
1280  */
1281  MAP(ENTITY, array,
1283  ls = CONS(STATEMENT, generate_all_liveness(array, false), ls),
1284  le);
1285 
1286  gen_free_list(le), le = NIL;
1287 
1288  return make_block_statement(ls);
1289 }
bool bound_dynamic_hpf_p(entity)
statement generate_all_liveness(entity primary, bool val)
Definition: remapping.c:940
static statement update_runtime_for_remapping(entity trg)
Definition: remapping.c:829

References array, bound_dynamic_hpf_p(), CONS, ENTITY, gen_free_list(), generate_all_liveness(), get_current_module_entity(), list_of_distributed_arrays_for_module(), load_renamings(), make_block_statement(), MAP, NIL, primary_entity_p, RENAMING, renaming_new, STATEMENT, and update_runtime_for_remapping().

Referenced by hpf_compiler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ safe_load_primary_entity()

entity safe_load_primary_entity ( entity  e)

HPFC module by Fabien COELHO.

This file provides functions used by directives.c to deal with dynamic mappings (re*). It includes keeping track of variables tagged as dynamic, and managing the static synonyms introduced to deal with them in HPFC. DYNAMIC MANAGEMENT

the synonyms of a given array are stored in a entities. What I intend as a synonym is a version of the array or template which is distributed or aligned in a different way. the renamings are associated to the remapping statements here.

  • dynamic_hpf: keeps track of entities declared as dynamic.
  • primary_entity: primary entity of an entity, when synonyms are introduced to handle remappings.
  • renamings: remappings associated to a statement.
  • maybeuseful_mappings: to be kept for a statement.
  • similar_mapping: copies with similar mappings...

Definition at line 61 of file dynamic.c.

62 {
63  if (!bound_dynamic_hpf_p(e))
64  pips_user_error("%s is not dynamic\n", entity_local_name(e));
65 
66  return load_primary_entity(e);
67 }

References bound_dynamic_hpf_p(), entity_local_name(), load_primary_entity(), and pips_user_error.

Referenced by alive_arrays(), continue_propagation_p(), and propagate_synonym().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ same_primary_entity_p()

bool same_primary_entity_p ( entity  e1,
entity  e2 
)
Parameters
e11
e22

Definition at line 70 of file dynamic.c.

71 {
74  else
75  return false;
76 }
bool bound_primary_entity_p(entity)

References bound_primary_entity_p(), and load_primary_entity().

Referenced by simple_switch_old_to_new().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_array_as_distributed()

void set_array_as_distributed ( entity  )

Referenced by array_as_template(), new_synonym_array(), and one_align_directive().

+ Here is the caller graph for this function:

◆ set_current_loops()

void set_current_loops ( statement  obj)
Parameters
objbj

Definition at line 371 of file compiler-util.c.

372 {
373  pips_assert("no current loop", current_loop_list==NIL);
375 }
static void set_current_loops_rewrite(loop l)

References current_loop_list, gen_recurse, gen_true(), loop_domain, NIL, pips_assert, and set_current_loops_rewrite().

Referenced by Overlap_Analysis().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_data_status()

void set_data_status ( data_status  s)

Definition at line 328 of file declarations.c.

330 {
331  set_new_declaration(data_status_newdeclmap(s));
334  distributed_arrays = data_status_arrays(s);
335  templates = data_status_templates(s);
336  processors = data_status_processors(s);
337 }
#define data_status_templates(x)
Definition: hpf_private.h:297
#define data_status_alignmap(x)
Definition: hpf_private.h:291
#define data_status_processors(x)
Definition: hpf_private.h:299
#define data_status_distributemap(x)
Definition: hpf_private.h:293
#define data_status_newdeclmap(x)
Definition: hpf_private.h:289
#define data_status_arrays(x)
Definition: hpf_private.h:295
void set_hpf_distribution(distributemap)
void set_hpf_alignment(alignmap)

References data_status_alignmap, data_status_arrays, data_status_distributemap, data_status_newdeclmap, data_status_processors, data_status_templates, set_hpf_alignment(), and set_hpf_distribution().

Referenced by load_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_dynamic_hpf()

void set_dynamic_hpf ( entity_entities  )

Referenced by set_dynamic_status().

+ Here is the caller graph for this function:

◆ set_dynamic_status()

void set_dynamic_status ( dynamic_status  d)

set_similar_mapping(...)

Definition at line 108 of file dynamic.c.

109 {
114  /* set_similar_mapping(...) */
115 }
#define dynamic_status_dynamics(x)
Definition: hpf_private.h:376
#define dynamic_status_renamings(x)
Definition: hpf_private.h:380
#define dynamic_status_tokeep(x)
Definition: hpf_private.h:382
#define dynamic_status_primary(x)
Definition: hpf_private.h:378
void set_dynamic_hpf(entity_entities)
void set_maybeuseful_mappings(statement_entities)
void set_primary_entity(entitymap)
void set_renamings(statement_renamings)

References dynamic_status_dynamics, dynamic_status_primary, dynamic_status_renamings, dynamic_status_tokeep, set_dynamic_hpf(), set_maybeuseful_mappings(), set_primary_entity(), and set_renamings().

Referenced by load_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_entity_as_dynamic()

void set_entity_as_dynamic ( entity  e)

a new dynamic entity is stored.

HPF allows arrays and templates as dynamic. ??? could be asserted, but not here. should be checked afterward.

else the entity was already declared as dynamic...

Definition at line 130 of file dynamic.c.

131 {
132  if (!bound_dynamic_hpf_p(e))
133  {
135  store_primary_entity(e, e);
136 
137  store_similar_mapping(e, e);
138  }
139  /* else the entity was already declared as dynamic... */
140 }
void store_similar_mapping(entity, entity)
void store_primary_entity(entity, entity)
void store_dynamic_hpf(entity, entities)

References bound_dynamic_hpf_p(), CONS, ENTITY, make_entities(), NIL, store_dynamic_hpf(), store_primary_entity(), and store_similar_mapping().

Referenced by hpfc_translate_call_with_distributed_args(), and new_dynamic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_entity_status()

void set_entity_status ( entity_status  s)

Definition at line 102 of file host_node_entities.c.

103 {
108 }
#define entity_status_new_node(x)
Definition: hpf_private.h:535
#define entity_status_old_node(x)
Definition: hpf_private.h:539
#define entity_status_new_host(x)
Definition: hpf_private.h:533
#define entity_status_old_host(x)
Definition: hpf_private.h:537
void set_old_host(entitymap)
void set_new_node(entitymap)
void set_new_host(entitymap)
void set_old_node(entitymap)

References entity_status_new_host, entity_status_new_node, entity_status_old_host, entity_status_old_node, set_new_host(), set_new_node(), set_old_host(), and set_old_node().

Referenced by load_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_hpf_alignment()

void set_hpf_alignment ( alignmap  )

Referenced by set_data_status().

+ Here is the caller graph for this function:

◆ set_hpf_distribution()

void set_hpf_distribution ( distributemap  )

Referenced by set_data_status().

+ Here is the caller graph for this function:

◆ set_hpf_number()

void set_hpf_number ( entity_int  )

Referenced by set_hpf_number_status().

+ Here is the caller graph for this function:

◆ set_hpf_number_status()

void set_hpf_number_status ( numbers_status  s)

Definition at line 148 of file declarations.c.

150 {
155 }
#define numbers_status_arrays(x)
Definition: hpf_private.h:818
#define numbers_status_processors(x)
Definition: hpf_private.h:822
#define numbers_status_templates(x)
Definition: hpf_private.h:820
#define numbers_status_numbermap(x)
Definition: hpf_private.h:816
void set_hpf_number(entity_int)

References current_array_index, current_processors_index, current_template_index, numbers_status_arrays, numbers_status_numbermap, numbers_status_processors, numbers_status_templates, and set_hpf_number().

Referenced by load_hpfc_status().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_hpf_reductions()

void set_hpf_reductions ( statement_entities  )

Referenced by load_hpfc_status().

+ Here is the caller graph for this function:

◆ set_hpfc_current_statement()

void set_hpfc_current_statement ( statement  )

Referenced by Overlap_Analysis().

+ Here is the caller graph for this function:

◆ set_maybeuseful_mappings()

void set_maybeuseful_mappings ( statement_entities  )

Referenced by set_dynamic_status().

+ Here is the caller graph for this function:

◆ set_new_host()

void set_new_host ( entitymap  )

Referenced by set_entity_status().

+ Here is the caller graph for this function:

◆ set_new_node()

void set_new_node ( entitymap  )

Referenced by set_entity_status().

+ Here is the caller graph for this function:

◆ set_old_host()

void set_old_host ( entitymap  )

Referenced by set_entity_status().

+ Here is the caller graph for this function:

◆ set_old_node()

void set_old_node ( entitymap  )

Referenced by set_entity_status().

+ Here is the caller graph for this function:

◆ set_only_io_map()

void set_only_io_map ( statement_mapping  )

Referenced by only_io_mapping_initialize().

+ Here is the caller graph for this function:

◆ set_overlap()

void set_overlap ( entity  ent,
int  dim,
int  side,
int  width 
)

set the overlap value for entity ent, on dimension dim, dans side side to width, which must be a positive integer.

if necessary, the overlap is updates with the value width.

set the overlap value for entity ent, on dimension dim, dans side side to width, which must be a positive integer.

set the overlap value for entity ent, on dimension dim, dans side side to width, which must be a positive integer. if necessary, the overlap is updates with the value width.

upper

lower

upper

lower

Parameters
entnt
dimim
sideide
widthidth

Definition at line 713 of file declarations.c.

716 {
717  overlap o;
718  int current;
719 
720  pips_assert("valid dimension", dim>0);
721 
722  pips_debug(10, "%s:(DIM=%d) %s%d\n",
723  entity_name(ent), dim, side?"+":"-", width);
724 
725  if (!bound_overlap_status_p(ent)) create_overlaps(ent);
726  o = OVERLAP(gen_nth(dim-1, load_overlap_status(ent)));
727 
728  if (side) /* upper */
729  {
730  current = overlap_upper(o);
731  if (current<width) overlap_upper(o)=width;
732  }
733  else /* lower */
734  {
735  current = overlap_lower(o);
736  if (current<width) overlap_lower(o)=width;
737  }
738 }

References assert, bound_overlap_status_p(), create_overlaps(), current, entity_name, gen_nth(), load_overlap_status(), OVERLAP, overlap_lower, overlap_upper, pips_assert, and pips_debug.

Referenced by deal_with_similars(), message_manageable_p(), and update_overlaps_of().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_overlap_status()

void set_overlap_status ( overlapsmap  )

Referenced by load_hpfc_status().

+ Here is the caller graph for this function:

◆ set_primary_entity()

void set_primary_entity ( entitymap  )

Referenced by set_dynamic_status().

+ Here is the caller graph for this function:

◆ set_processor()

void set_processor ( entity  )

Referenced by new_processor().

+ Here is the caller graph for this function:

◆ set_renamings()

void set_renamings ( statement_renamings  )

Referenced by set_dynamic_status().

+ Here is the caller graph for this function:

◆ set_similar_mapping()

void set_similar_mapping ( entitymap  )

◆ set_similar_mappings_for_updates()

void set_similar_mappings_for_updates ( void  )

??? for final update after compilation! hummm....

??? should not deal with the same array twice...

may be in another module

Definition at line 162 of file dynamic.c.

163 {
164  /* ??? for final update after compilation! hummm....
165  */
166 
167  MAP(ENTITY, array,
168  {
169  pips_debug(7, "considering array %s\n", entity_name(array));
170 
171  /* ??? should not deal with the same array twice...
172  */
173  if (dynamic_entity_p(array) &&
175  bound_new_node_p(array)) /* may be in another module */
176  {
179  entity ns = load_new_node(s);
180 
181  pips_debug(7, "array %s\n", entity_name(array));
182 
183  if (!bound_new_node_p(n)) {
186  }
187  }
188  },
190 }

References array, bound_new_node_p(), bound_similar_mapping_p(), dynamic_entity_p, ENTITY, entity_name, list_of_distributed_arrays(), load_new_node(), load_similar_mapping(), MAP, pips_debug, and store_new_node_variable().

Referenced by compile_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_template()

void set_template ( entity  )

Referenced by array_as_template(), new_synonym_template(), and new_template().

+ Here is the caller graph for this function:

◆ set_the_dynamics()

void set_the_dynamics ( list  )

◆ set_update_common_map()

void set_update_common_map ( entity_mapping  )

◆ shift_system_to_prime_variables()

Psysteme shift_system_to_prime_variables ( Psysteme  s)

Definition at line 173 of file build-system.c.

175 {
176  return sc_rename_variables(s, (bool (*)())bound_dummy_to_prime_p,
177  (Variable(*)()) load_dummy_to_prime);
178 }
Psysteme sc_rename_variables(Psysteme s, bool(*renamed_p)(), Variable(*new_variable)())
Psysteme sc_rename_variables(s, renamed_p, new_variable) Psysteme s; bool (*renamed_p)(Variable); Var...
Definition: sc.c:198

References sc_rename_variables().

Referenced by generate_remapping_system(), and processor_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ similar_mapping_undefined_p()

bool similar_mapping_undefined_p ( void  )

◆ simple_statement()

statement simple_statement ( statement  s)

Definition at line 735 of file special_cases.c.

736 {
737  ok = true;
738  simple_found = (statement) NULL;
739  make_current_stmt_stack();
740 
742  (s,
743  statement_domain, current_stmt_filter, current_stmt_rewrite,
748  NULL);
749 
750  free_current_stmt_stack();
751 
752  return (ok && simple_found) ? simple_found : NULL;
753 }
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
#define test_domain
newgen_entity_domain_defined
Definition: ri.h:418
static bool check_simple(call c)
static statement simple_found
tests whether a loop nest is a full copy loop nest, i.e.
static bool not_simple(_UNUSED_ void *x)

References call_domain, check_simple(), expression_domain, gen_false(), gen_multi_recurse(), gen_null(), loop_domain, not_simple(), ok, simple_found, statement_domain, and test_domain.

Referenced by full_copy_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ simplify_deducable_variables()

list simplify_deducable_variables ( Psysteme  syst,
list  vars,
list pleftvars 
)

list simplify_deducable_variables(syst, vars, pleftvars) Psysteme syst; list vars, *pleftvars;

variables from entity list vars that can be rebuilt by the Psysteme syst are removed from it and stored as an expression list which is returned. The variables that are not removed are returned as another entity list, *pleftvars. of expression

Parameters
systyst
varsars
pleftvarsleftvars

Definition at line 562 of file io-compile.c.

566 {
567  list result = NIL;
568  *pleftvars = NIL;
569 
570  MAP(ENTITY, dummy,
571  {
573  Value coeff = VALUE_ZERO;
574 
575  if (eq = eq_v_min_coeff(sc_egalites(syst), (Variable) dummy, &coeff),
576  value_one_p(coeff))
577  {
578  result =
583  vect_dup(eq->vecteur))),
584  result);
585 
586  syst = sc_variable_substitution_with_eq_ofl_ctrl(syst, eq,
587  (Variable) dummy,
588  FWD_OFL_CTRL);
589  }
590  else
591  {
592  *pleftvars = CONS(ENTITY, dummy, *pleftvars);
593  }
594  },
595  vars);
596 
597  base_rm(sc_base(syst)), sc_base(syst) = BASE_NULLE, sc_creer_base(syst);
598 
599  return(result);
600 }
normalized make_normalized(enum normalized_utype tag, void *val)
Definition: ri.c:1447
syntax make_syntax(enum syntax_utype tag, void *val)
Definition: ri.c:2491
Pvecteur vecteur
#define FWD_OFL_CTRL

References BASE_NULLE, base_rm, CONS, CONTRAINTE_UNDEFINED, ENTITY, eq, EXPRESSION, FWD_OFL_CTRL, is_normalized_linear, is_syntax_reference, make_expression(), make_normalized(), make_reference(), make_syntax(), MAP, NIL, sc_creer_base(), value_one_p, VALUE_ZERO, vect_dup(), and Scontrainte::vecteur.

Referenced by extract_lattice(), hpf_remapping(), and put_variables_in_ordered_lists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ simplify_remapping_graph()

void simplify_remapping_graph ( void  )

void simplify_remapping_graph()

what: simplifies the remapping graph. how: propagate unused reaching mappings to the next remappings, and remove unnecessary remappings. input: none. output: none. side effects: all is there!

  • the remapping graph remappings are modified.
  • some static structures are used.
  • current module statement needed. bugs or features:
  • special treatment of the current module statement to model the initial mapping at the entry of the module. The initial mapping may be modified by the algorithm if it is remapped before being used.
  • ??? the convergence and correctness are to be proved.
  • expected complexity: n vertices (small!), q nexts, m arrays, r remaps. assumes fast sets instead of lists, with O(1) tests/add/del... closure: O(n^2*vertex_operation) (if it is a simple propagation...) map: O(n*vertex_operation) C = n^2 q m r

of statements

Definition at line 1467 of file dynamic.c.

1468 {
1469  list /* of statements */ ls = list_of_remapping_statements();
1471  what_stat_debug(4, root);
1472 
1473  ifdebug(8) dump_remapping_graph("0", ls);
1474 
1479 
1480  ifdebug(4) dump_remapping_graph("1", ls);
1481 
1482  pips_debug(4, "used array propagation\n");
1484 
1485  pips_debug(4, "may be useful mapping propagation\n");
1487 
1488  ifdebug(4) dump_remapping_graph("2", ls);
1489 
1490  if (bound_remapped_p(root)) remove_unused_remappings(root);
1491 
1493 
1494  gen_free_list(ls);
1495 }
static void initialize_maybeuseful_mappings(statement s)
must be called after useless leaving mappings removal
Definition: dynamic.c:1194
static list propagate_used_arrays(statement s, list ls)
of statements
Definition: dynamic.c:1277
static list propagate_maybeuseful_mappings(statement s, list ls)
of statements
Definition: dynamic.c:1286
static void regenerate_renamings(statement s)
regenerate the renaming structures after the optimizations performed on the remapping graph.
Definition: dynamic.c:1338
static void initialize_reaching_propagation(statement s)
for statement s
Definition: dynamic.c:1142
static void remove_not_remapped_leavings(statement s)
Definition: dynamic.c:1166
static void remove_unused_remappings(statement s)
Definition: dynamic.c:1310
static void reinitialize_reaching_mappings(statement s)
Definition: dynamic.c:1199
void gen_closure(list(*iterate)(), list(*initial)())
void gen_closure(iterate, initial) list [of X] (*iterate)([ X, list of X ]), initial;
Definition: list.c:839
list(* gen_closure_func_t)(gen_chunk *, list)
Definition: newgen_list.h:335

References dump_remapping_graph(), gen_closure(), gen_free_list(), gen_map(), get_current_module_statement(), ifdebug, initialize_maybeuseful_mappings(), initialize_reaching_propagation(), list_of_remapping_statements(), pips_debug, propagate_maybeuseful_mappings(), propagate_used_arrays(), regenerate_renamings(), reinitialize_reaching_mappings(), remove_not_remapped_leavings(), remove_unused_remappings(), and what_stat_debug.

Referenced by handle_hpf_directives().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sprint_lrange()

char* sprint_lrange ( string  str,
list  l 
)
Parameters
strtr

Definition at line 217 of file message-utils.c.

220 {
221  string s = str;
222  bool firstrange = true;
223 
224  MAP(RANGE, r,
225  {
226  if (!firstrange)
227  {
228  sprintf(s, ", ");
229  s += strlen(s);
230  }
231  else
232  firstrange = false;
233 
234  sprint_range(s, r);
235  s += strlen(s);
236  },
237  l);
238 
239  return str;
240 }
char * sprint_range(string str, range r)

References MAP, RANGE, and sprint_range().

Referenced by st_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sprint_range()

char* sprint_range ( string  str,
range  r 
)
Parameters
strtr

Definition at line 242 of file message-utils.c.

243 {
244  int lo, up, in;
245  bool
249 
250  if (blo && bup && bin)
251  {
252  if (in==1)
253  {
254  if (lo==up)
255  sprintf(str, "%d", lo);
256  else
257  sprintf(str, "%d:%d", lo, up);
258  }
259  else
260  sprintf(str, "%d:%d:%d", lo, up, in);
261  }
262  else
263  sprintf(str, "X");
264 
265  return str+strlen(str);
266 }

References hpfc_integer_constant_expression_p(), range_increment, range_lower, and range_upper.

Referenced by sprint_lrange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_call_send_or_receive()

statement st_call_send_or_receive ( entity  f,
reference  r 
)

Sends.

Definition at line 138 of file run-time.c.

141 {
142  return
146  NIL)));
147 }
expression pvm_what_option_expression(entity v)
Definition: run-time.c:74

References CONS, EXPRESSION, f(), hpfc_make_call_statement(), NIL, pvm_what_option_expression(), reference_to_expression(), and reference_variable.

+ Here is the call graph for this function:

◆ st_compute_current_computer()

statement st_compute_current_computer ( reference  ref)

Computes.

Parameters
refef

Definition at line 151 of file run-time.c.

153 {
154  if (get_bool_property("HPFC_EXPAND_COMPUTE_COMPUTER"))
155  {
156  list linds = reference_indices(ref),
157  largs = make_list_of_constant(0, 7-gen_length(linds));
158  int narray = load_hpf_number(reference_variable(ref));
159 
160  largs = gen_nconc(CONS(EXPRESSION, int_to_expression(narray),
161  NIL),
162  gen_nconc(lUpdateExpr(node_module, linds), largs));
163 
165  largs);
166  }
167  else
170  NIL));
171 }
#define CMP_COMPUTER
list make_list_of_constant(int val, int number)
of expression
Definition: expression.c:3369

References CMP_COMPUTER, CONS, EXPRESSION, gen_length(), gen_nconc(), get_bool_property(), hpfc_make_call_statement(), hpfc_name_to_entity(), int_to_expression(), load_hpf_number(), lUpdateExpr(), make_list_of_constant(), NIL, node_module, ref, reference_indices, reference_to_expression(), and reference_variable.

Referenced by generate_c1_alpha(), and generate_parallel_body().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_compute_current_owners()

statement st_compute_current_owners ( reference  ref)

◆ st_compute_ith_local_index()

statement st_compute_ith_local_index ( entity  array,
int  i,
expression  expr,
syntax sp 
)

the returned expression is translated into variables of the node module.

the necessity is not checked, but it could be done, looking that the new declaration of the given array is smaller or not on the given dimension...

Parameters
arrayrray
exprxpr
spp

Definition at line 775 of file generate.c.

780 {
781  /* the necessity is not checked, but it could be done,
782  * looking that the new declaration of the given array
783  * is smaller or not on the given dimension...
784  */
785 
788  statement stat;
790 
792 
797  i,
799  expr))));
800 
801  return(stat);
802 }
instruction make_assign_instruction(expression l, expression r)
Definition: instruction.c:87
expression expr_compute_local_index(entity, int, expression)
new index computation formula, derived from the new declarations made for the given dimension.
Definition: run-time.c:198

References AddEntityToCurrentModule(), array, expr_compute_local_index(), instruction_to_statement(), is_basic_int, is_syntax_reference, make_assign_instruction(), make_new_scalar_variable(), make_reference(), make_syntax(), MakeBasic(), NIL, node_module, reference_to_expression(), and UpdateExpressionForModule().

Referenced by generate_compute_local_indices().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_compute_neighbour()

statement st_compute_neighbour ( int  d)

call to the runtime support function HPFC_CMPNEIGHBOUR(d)

Definition at line 394 of file run-time.c.

395 {
398  NIL));
399 }
#define CMP_NEIGHBOUR

References CMP_NEIGHBOUR, CONS, EXPRESSION, hpfc_make_call_statement(), hpfc_name_to_entity(), int_to_expression(), and NIL.

Referenced by st_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_generate_packing()

statement st_generate_packing ( entity  array,
list  content,
bool  bsend 
)

statement st_generate_packing_and_passing(array, content, bsend)

dimension bounds are refered to as parameters, since we do not know yet what is the lower and upper of each dimension...

larg content:

array, dim [lower, upper]*len, range [lower, upper, increment]*len

Parameters
arrayrray
contentontent
bsendsend

Definition at line 422 of file run-time.c.

426 {
427  int len = gen_length(content);
428  list larg = NIL;
429 
430  pips_assert("valid number of dimensions",
431  len==NumberOfDimension(array) && (len<=4) && (len>=1));
432 
434 
435  MAP(RANGE, r,
436  {
437  larg = gen_nconc(larg,
441  NIL))));
442  },
443  content);
444 
446  larg);
447 
448  /* larg content:
449  *
450  * array, dim [lower, upper]*len, range [lower, upper, increment]*len
451  */
452 
454  (make_packing_function(len, bsend, entity_basic(array), 1+5*len),
455  larg);
456 
457 }
list array_lower_upper_bounds_list(entity array)
of expressions
Definition: run-time.c:539
static entity make_packing_function(int ndim, bool kind, basic base, int nargs)
find or create an entity for the packing function...
Definition: run-time.c:403

References array, array_lower_upper_bounds_list(), CONS, entity_basic(), entity_to_expression(), EXPRESSION, gen_length(), gen_nconc(), hpfc_make_call_statement(), make_packing_function(), MAP, NIL, NumberOfDimension(), pips_assert, RANGE, range_increment, range_lower, and range_upper.

Referenced by st_one_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_get_value_for_all()

statement st_get_value_for_all ( reference  ref,
reference  goal 
)
Parameters
refef
goaloal

Definition at line 842 of file generate.c.

843 {
844  return
848 }
statement st_get_value_locally_and_send(reference ref, reference goal)
Definition: generate.c:760

References condition_ownerp, CONS, NIL, ref, st_get_value_locally_and_send(), st_make_nice_test(), st_receive_from(), and STATEMENT.

Referenced by generate_read_of_ref_for_all().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_get_value_for_computer()

statement st_get_value_for_computer ( reference  ref,
reference  goal 
)
Parameters
refef
goaloal

Definition at line 850 of file generate.c.

852 {
853  list ltrue=NIL, lfalse=NIL;
854  generate_get_value_locally(ref,goal,&ltrue);
856  return st_make_nice_test(condition_ownerp(),ltrue,lfalse);
857 }
void generate_get_value_locally(reference ref, reference goal, list *lstatp)
generate_get_value_locally
Definition: generate.c:446
#define st_receive_from_sender(goal)

References condition_ownerp, CONS, generate_get_value_locally(), NIL, ref, st_make_nice_test(), st_receive_from_sender, and STATEMENT.

Referenced by generate_read_of_ref_for_computer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_get_value_locally_and_send()

statement st_get_value_locally_and_send ( reference  ref,
reference  goal 
)
Parameters
refef
goaloal

Definition at line 760 of file generate.c.

761 {
762  list ls=NIL;
763 
766  NIL));
767 
768  return(make_block_statement(ls));
769 }
statement st_send_to_host_and_nodes(reference ref, reference val)
Definition: generate.c:804

References CONS, gen_nconc(), generate_get_value_locally(), make_block_statement(), NIL, ref, st_send_to_host_and_nodes(), and STATEMENT.

Referenced by st_get_value_for_all().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_receive_from()

statement st_receive_from ( reference  ref,
reference  goal 
)

if ref is replicated: goal = Receive_From_Sender()

if ref is not replicated goal = Receive_Multi_Cast_From_Sender()

Parameters
refef
goaloal

Definition at line 865 of file generate.c.

867 {
869  return st_receive_from_sender(goal);
870  else
871  return st_receive_mcast_from_sender(goal);
872 }
#define st_receive_mcast_from_sender(goal)

References ref, reference_variable, replicated_p(), st_receive_from_sender, and st_receive_mcast_from_sender.

Referenced by generate_read_of_ref_for_all(), and st_get_value_for_all().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_send_to_computer_if_necessary()

statement st_send_to_computer_if_necessary ( reference  ref)
Parameters
refef

Definition at line 817 of file generate.c.

818 {
819  entity
821  newarray = load_new_node(array);
822  expression
823  condition=((replicated_p(array))?
828  (condition_senderp()));
829  list lstat = NIL, lnewinds = NIL;
830 
831  generate_compute_local_indices(ref, &lstat, &lnewinds);
832 
833  return
834  st_make_nice_test(condition,
835  gen_nconc(lstat,
836  CONS(STATEMENT,
837  st_send_to_computer(make_reference(newarray, lnewinds)),
838  NIL)),
839  NIL);
840 }
#define condition_not_computer_in_owners()
#define condition_senderp()
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...

References AND_OPERATOR_NAME, array, condition_not_computer_in_owners, condition_senderp, CONS, entity_intrinsic(), gen_nconc(), generate_compute_local_indices(), load_new_node(), make_reference(), MakeBinaryCall(), NIL, ref, reference_variable, replicated_p(), st_make_nice_test(), st_send_to_computer, and STATEMENT.

Referenced by generate_read_of_ref_for_computer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ st_send_to_host_and_nodes()

statement st_send_to_host_and_nodes ( reference  ref,
reference  val 
)
Parameters
refef
valal

Definition at line 804 of file generate.c.

806 {
809  CONS(STATEMENT,
811  NIL),
812  NIL));
813  else
814  return st_send_to_host_and_all_nodes(val);
815 }
#define st_send_to_host_and_not_owners(val)
#define st_send_to_host_and_all_nodes(val)

References condition_senderp, CONS, NIL, ref, reference_variable, replicated_p(), st_make_nice_test(), st_send_to_host_and_all_nodes, st_send_to_host_and_not_owners, and STATEMENT.

Referenced by st_get_value_locally_and_send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ statement_only_io_undefined_p()

bool statement_only_io_undefined_p ( statement  )

◆ statement_structural_cleaning()

void statement_structural_cleaning ( statement  s)

Definition at line 847 of file hpfc-util.c.

848 {
849  make_current_stmt_stack();
850 
852  statement_domain, current_stmt_filter, current_stmt_rewrite,
855  NULL);
856 
857  free_current_stmt_stack();
858 }
static void loop_rewrite(loop l)
Definition: hpfc-util.c:822
static void test_rewrite(test t)
Definition: hpfc-util.c:790

References gen_multi_recurse(), gen_true(), loop_domain, loop_rewrite(), statement_domain, test_domain, and test_rewrite().

Referenced by compile_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ store_dynamic_hpf()

void store_dynamic_hpf ( entity  ,
entities   
)

Referenced by add_dynamic_synonym(), and set_entity_as_dynamic().

+ Here is the caller graph for this function:

◆ store_entity_update_common()

void store_entity_update_common ( entity  ,
entity   
)

Referenced by NormalizeCommonVariables().

+ Here is the caller graph for this function:

◆ store_hpf_alignment()

void store_hpf_alignment ( entity  ,
align   
)

Referenced by array_as_template(), new_synonym_array(), and one_align_directive().

+ Here is the caller graph for this function:

◆ store_hpf_distribution()

void store_hpf_distribution ( entity  ,
distribute   
)

Referenced by new_synonym_template(), and one_distribute_directive().

+ Here is the caller graph for this function:

◆ store_hpf_number()

void store_hpf_number ( entity  ,
intptr_t   
)

Referenced by GiveToHpfObjectsTheirNumber().

+ Here is the caller graph for this function:

◆ store_hpf_reductions()

void store_hpf_reductions ( statement  ,
entities   
)

Referenced by handle_reduction_directive().

+ Here is the caller graph for this function:

◆ store_maybeuseful_mappings()

void store_maybeuseful_mappings ( statement  ,
entities   
)

Referenced by initialize_maybeuseful_mappings().

+ Here is the caller graph for this function:

◆ store_new_host()

void store_new_host ( entity  ,
entity   
)

Referenced by AddEntityToHostAndNodeModules().

+ Here is the caller graph for this function:

◆ store_new_host_node_variable()

void store_new_host_node_variable ( entity  neh,
entity  nen,
entity  old 
)
Parameters
neheh
nenen
oldld

Definition at line 73 of file host_node_entities.c.

77 {
78  store_new_host_variable(neh, old);
79  store_new_host_variable(neh, nen);
80  store_new_node_variable(nen, old);
81  store_new_node_variable(nen, neh);
82 }

References store_new_host_variable(), and store_new_node_variable().

Referenced by make_host_and_node_modules().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ store_new_host_variable()

void store_new_host_variable ( entity  new,
entity  old 
)
Parameters
newew
oldld

Definition at line 64 of file host_node_entities.c.

65 {
66  pips_assert("defined", !entity_undefined_p(new)&&!entity_undefined_p(old));
67 
68  store_or_update_new_host(old, new);
69  store_or_update_old_host(new, old);
70 }
void store_or_update_new_host(entity, entity)
void store_or_update_old_host(entity, entity)

References entity_undefined_p, pips_assert, store_or_update_new_host(), and store_or_update_old_host().

Referenced by add_declaration_to_host_and_link(), AddCommonToHostAndNodeModules(), AddEntityToHostAndNodeModules(), automatic_translation(), hpfc_compile(), make_host_and_node_modules(), and store_new_host_node_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ store_new_node()

void store_new_node ( entity  ,
entity   
)

Referenced by AddEntityToHostAndNodeModules().

+ Here is the caller graph for this function:

◆ store_new_node_variable()

void store_new_node_variable ( entity  new,
entity  old 
)
Parameters
newew
oldld

Definition at line 55 of file host_node_entities.c.

56 {
57  pips_assert("defined", !entity_undefined_p(new)&&!entity_undefined_p(old));
58 
59  store_or_update_new_node(old, new);
60  store_or_update_old_node(new, old);
61 }
void store_or_update_new_node(entity, entity)
void store_or_update_old_node(entity, entity)

References entity_undefined_p, pips_assert, store_or_update_new_node(), and store_or_update_old_node().

Referenced by AddCommonToHostAndNodeModules(), AddEntityToHostAndNodeModules(), automatic_translation(), hpfc_compile(), make_host_and_node_modules(), set_similar_mappings_for_updates(), and store_new_host_node_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ store_old_host()

void store_old_host ( entity  ,
entity   
)

◆ store_old_node()

void store_old_node ( entity  ,
entity   
)

◆ store_or_update_dynamic_hpf()

void store_or_update_dynamic_hpf ( entity  ,
entities   
)

◆ store_or_update_hpf_alignment()

void store_or_update_hpf_alignment ( entity  ,
align   
)

◆ store_or_update_hpf_distribution()

void store_or_update_hpf_distribution ( entity  ,
distribute   
)

◆ store_or_update_hpf_number()

void store_or_update_hpf_number ( entity  ,
intptr_t   
)

◆ store_or_update_hpf_reductions()

void store_or_update_hpf_reductions ( statement  ,
entities   
)

◆ store_or_update_maybeuseful_mappings()

void store_or_update_maybeuseful_mappings ( statement  ,
entities   
)

◆ store_or_update_new_host()

void store_or_update_new_host ( entity  ,
entity   
)

Referenced by store_new_host_variable().

+ Here is the caller graph for this function:

◆ store_or_update_new_node()

void store_or_update_new_node ( entity  ,
entity   
)

Referenced by store_new_node_variable().

+ Here is the caller graph for this function:

◆ store_or_update_old_host()

void store_or_update_old_host ( entity  ,
entity   
)

Referenced by store_new_host_variable().

+ Here is the caller graph for this function:

◆ store_or_update_old_node()

void store_or_update_old_node ( entity  ,
entity   
)

Referenced by store_new_node_variable().

+ Here is the caller graph for this function:

◆ store_or_update_overlap_status()

void store_or_update_overlap_status ( entity  ,
list   
)

◆ store_or_update_primary_entity()

void store_or_update_primary_entity ( entity  ,
entity   
)

◆ store_or_update_renamings()

void store_or_update_renamings ( statement  ,
list   
)

◆ store_or_update_similar_mapping()

void store_or_update_similar_mapping ( entity  ,
entity   
)

◆ store_overlap_status()

void store_overlap_status ( entity  ,
list   
)

Referenced by create_overlaps().

+ Here is the caller graph for this function:

◆ store_primary_entity()

void store_primary_entity ( entity  ,
entity   
)

Referenced by add_dynamic_synonym(), and set_entity_as_dynamic().

+ Here is the caller graph for this function:

◆ store_renamings()

void store_renamings ( statement  ,
list   
)

◆ store_similar_mapping()

void store_similar_mapping ( entity  ,
entity   
)

Referenced by check_for_similarity(), and set_entity_as_dynamic().

+ Here is the caller graph for this function:

◆ store_statement_only_io()

void store_statement_only_io ( statement  ,
bool   
)

◆ subarray_shift_p()

bool subarray_shift_p ( statement  s,
entity pe,
list plvect 
)
Parameters
pee
plvectlvect

Definition at line 530 of file special_cases.c.

534 {
536  subarray_shift_ok = true;
537  lvect = NIL;
539 
540  DEBUG_STAT(8, "considering statement", s);
541 
547  NULL);
548 
551 
552  if (subarray_shift_ok)
553  *pe = array,
554  *plvect = lvect;
555  else
558 
559  pips_debug(8, "returning %s\n", subarray_shift_ok? "TRUE": "FALSE");
560  return subarray_shift_ok;
561 }
bool rectangular_must_region_p(entity, statement)
static bool loop_filter(loop l)
static bool subarray_shift_ok
some static variables used for the detection...
static list current_regions
static bool cannot_be_a_shift(_UNUSED_ void *x)
static bool call_filter(call c)

References array, call_domain, call_filter(), cannot_be_a_shift(), current_regions, DEBUG_STAT, entity_undefined, entity_undefined_p, expression_domain, free_vector_list(), gen_false(), gen_multi_recurse(), gen_null(), load_statement_local_regions(), loop_domain, loop_filter(), lvect, NIL, pips_debug, rectangular_must_region_p(), subarray_shift_ok, and test_domain.

Referenced by hpf_compile_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ template_cell_local_mapping()

int template_cell_local_mapping ( entity  array,
int  dim,
int  tc 
)

int template_cell_local_mapping(array, dim, tc)

??? should check that it is indeed block distributed ! or should implement all the formulas...

Parameters
arrayrray
dimim
tcc

Definition at line 532 of file hpfc-util.c.

535 {
537  int p, tmin, n = DistributionParameterOfArrayDim(array, dim, &p);
540 
542 
543  return (tc-tmin)%n+1;
544 }
int DistributionParameterOfArrayDim(entity array, int dim, int *pprocdim)
Definition: hpfc-util.c:472

References alignment_templatedim, array, array_to_template, dimension_lower, DistributionParameterOfArrayDim(), FindArrayDimAlignmentOfArray, FindIthDimension(), HpfcExpressionToInt(), and tc.

Referenced by generate_one_message(), global_array_cell_to_local_array_cell(), and update_indices_for_local_computation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ template_dimension_of_array_dimension()

int template_dimension_of_array_dimension ( entity  array,
int  dim 
)
Parameters
arrayrray
dimim

Definition at line 448 of file hpfc-util.c.

451 {
452  align a;
453  alignment al;
454 
456  al = FindAlignmentOfDim(align_alignment(a), dim);
457 
458  return (al==alignment_undefined) ? -1 : alignment_templatedim(al);
459 }

References align_alignment, alignment_templatedim, alignment_undefined, array, FindAlignmentOfDim(), and load_hpf_alignment().

Referenced by aligned_p(), get_alignment(), and message_manageable_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ template_ranges_to_processors_ranges()

list template_ranges_to_processors_ranges ( entity  template,
list  lrt 
)

??? another increment could be computed?

Parameters
templateemplate
lrtrt

Definition at line 498 of file message-utils.c.

501 {
502  distribute d = load_hpf_distribution(template);
503  entity proc = distribute_processors(d);
504  list ld = distribute_distribution(d), lrp = NIL;
505  int i = 1;
506 
507  for (i=1 ; i<=NumberOfDimension(proc) ; i++)
508  {
509  int tdim = 0;
510  distribution di = FindDistributionOfProcessorDim(ld, i, &tdim);
511  style s = distribution_style(di);
512  range rg = RANGE(gen_nth(tdim-1, lrt));
513  int p = 0,
517 
518  switch (style_tag(s))
519  {
520  case is_style_block:
521  {
522  expression
523  pl = int_to_expression(processor_number(template, tdim, tl, &p)),
524  pu = int_to_expression(processor_number(template, tdim, tu, &p));
525 
526  /* ??? another increment could be computed?
527  */
528  lrp = gen_nconc(lrp,
529  CONS(RANGE,
531  NIL));
532  break;
533  }
534  case is_style_cyclic:
535  {
536  dimension dp = FindIthDimension(proc, i);
537  int sz = dimension_size(dp);
538  expression
539  pl = int_to_expression(processor_number(template, tdim, tl, &p)),
540  pu = int_to_expression(processor_number(template, tdim, tu, &p));
541 
542  if (((tu-tl)>n*sz) || (pl>pu) || ((pl==pu) && ((tu-tl)>n)))
543  lrp = gen_nconc(lrp,
544  CONS(RANGE,
546  dimension_upper(dp),
547  int_to_expression(1)),
548  NIL));
549  else
550  lrp = gen_nconc(lrp,
551  CONS(RANGE,
552  make_range(pl, pu,
553  int_to_expression(1)),
554  NIL));
555 
556  break;
557  }
558  case is_style_none:
559  pips_internal_error("unexpected none style distribution");
560  break;
561  default:
562  pips_internal_error("unexpected style tag (%d)",
563  style_tag(s));
564  }
565  }
566  return(lrp);
567 }
int processor_number(entity template, int tdim, int tcell, int *pprocdim)
int processor_number(template, tdim, tcell, pprocdim)
Definition: hpfc-util.c:492
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
Definition: properties.c:783
int dimension_size(dimension)
this function computes the size of a dimension.
Definition: size.c:491

References CONS, dimension_lower, dimension_size(), dimension_upper, distribute_distribution, distribute_processors, distribution_parameter, distribution_style, FindDistributionOfProcessorDim(), FindIthDimension(), gen_nconc(), gen_nth(), HpfcExpressionToInt(), int_to_expression(), is_style_block, is_style_cyclic, is_style_none, load_hpf_distribution(), make_range(), NIL, NumberOfDimension(), pips_internal_error, pl, processor_number(), RANGE, range_lower, range_upper, and style_tag.

Referenced by loop_nest_guard(), and one_message_guards_and_neighbour().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ template_synonym_distributed_as()

entity template_synonym_distributed_as ( entity  temp,
distribute  d 
)

what: finds or creates a new entity distributed as needed.

input: an template (which must be dynamic) and a distribute output: returns a template distributed as specified by d side effects:

  • creates a new entity if necessary.
  • this entity is stored as a synonym of array, and tagged as dynamic.
  • the distribute is freed if not used.

the one found is returned

else no compatible template does exist, so one must be created

Parameters
tempemp

Definition at line 491 of file dynamic.c.

494 {
495  MAP(ENTITY, t,
496  {
498  {
499  free_distribute(d);
500  return t; /* the one found is returned */
501  }
502  },
504 
505  /* else no compatible template does exist, so one must be created
506  */
507  return new_synonym_template(temp, d);
508 }
void free_distribute(distribute p)
Definition: hpf.c:103
static entity new_synonym_template(entity t, distribute di)
builds a new synonym for template t, the distribution of which will be di.
Definition: dynamic.c:319

References entities_list, ENTITY, free_distribute(), load_dynamic_hpf(), load_hpf_distribution(), MAP, new_synonym_template(), and same_distribute_p().

Referenced by one_distribute_directive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ the_dynamics_undefined_p()

bool the_dynamics_undefined_p ( void  )

end of it

cproto-generated files directives.c

◆ the_index_of_vect()

Pvecteur the_index_of_vect ( Pvecteur  v0)

message-utils.c

message-utils.c

Fabien Coelho, August 1993 returns the index of an affine vector

Parameters
v00

Definition at line 37 of file message-utils.c.

39 {
40  Pvecteur v1 = vect_del_var(v0, TCST);
41 
42  vect_erase_var(&v1, DELTAV);
44  vect_erase_var(&v1, TSHIFTV);
45 
46  assert(vect_size(v1)==1);
47 
48  return v1;
49 }
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
Definition: unaires.c:106

References assert, DELTAV, TCST, TEMPLATEV, TSHIFTV, vect_del_var(), vect_erase_var(), and vect_size().

Referenced by generate_one_message(), and update_indices_for_local_computation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ type_variable_dup()

type type_variable_dup ( type  t)

local-ri-util.c

!!! means sharing

Definition at line 30 of file local-ri-util.c.

32 {
33  if(type_variable_p(t))
34  {
35  variable v = type_variable(t);
36 
39  }
40  else
41  return t; /* !!! means sharing */
42 }
list ldimensions_dup(list)
Definition: type.c:1166
type MakeTypeVariable(basic, cons *)
BEGIN_EOLE.
Definition: type.c:116

References ldimensions_dup(), MakeTypeVariable(), type_variable, type_variable_p, variable_basic, and variable_dimensions.

+ Here is the call graph for this function:

◆ update_common_map_undefined_p()

bool update_common_map_undefined_p ( void  )

◆ update_common_references_in_obj()

void update_common_references_in_obj ( void *  obj)
Parameters
objbj

Definition at line 911 of file compile.c.

912 {
913  gen_multi_recurse(obj,
916  NULL);
917 
919 }
void debug_print_referenced_entities(void *obj)
Definition: compile.c:906
static void update_loop_rewrite(loop l)
Definition: compile.c:887
static void update_common_rewrite(reference r)
To manage the common entities, I decided arbitrarilly that all commons will have to be declared exact...
Definition: compile.c:875

References debug_print_referenced_entities(), gen_multi_recurse(), gen_true(), ifdebug, loop_domain, reference_domain, update_common_rewrite(), and update_loop_rewrite().

Referenced by NormalizeCommonVariables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_common_references_in_regions()

void update_common_references_in_regions ( void  )

Definition at line 921 of file compile.c.

922 {
923 
924  STATEMENT_EFFECTS_MAP(stat, effs,
925  {
926  list lef = effects_effects(effs);
927 
928  pips_debug(3, "statement %p (%zu effects)\n",
929  stat, gen_length((list) lef));
930 
931  // FI: Let's hope the rw effects do not have to be
932  // filtered to keep only the store effects...
934  (list) lef);
935  },
936  get_rw_effects());
937 }
statement_effects get_rw_effects(void)
#define STATEMENT_EFFECTS_MAP(k, v, c, f)
Definition: effects.h:1057
#define effects_effects(x)
Definition: effects.h:710

References EFFECT, effect_any_reference, effects_effects, gen_length(), get_rw_effects(), MAP, pips_debug, STATEMENT_EFFECTS_MAP, and update_common_rewrite().

+ Here is the call graph for this function:

◆ update_control_lists()

void update_control_lists ( control  c,
control_mapping  map 
)

compiler-util.c

compiler-util.c

Fabien Coelho, May 1993

Parameters
mapap

Definition at line 36 of file compiler-util.c.

39 {
40  control cprime = (control) GET_CONTROL_MAPPING(map, c);
41 
42  pips_assert("empty lists for cprime",
43  control_predecessors(cprime)==NIL &&
44  control_successors(cprime)==NIL);
45 
46  control_predecessors(cprime) =
48  control_successors(cprime) =
50 }
list updated_control_list(list lc, control_mapping map)
Definition: compiler-util.c:52
struct _newgen_struct_control_ * control
#define GET_CONTROL_MAPPING(map, cont)
Definition: newgen-local.h:88

References control_predecessors, control_successors, GET_CONTROL_MAPPING, NIL, pips_assert, and updated_control_list().

Referenced by hpf_compile_unstructured().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_dynamic_hpf()

void update_dynamic_hpf ( entity  ,
entities   
)

◆ update_entity_update_common()

void update_entity_update_common ( entity  ,
entity   
)

◆ update_hpf_alignment()

void update_hpf_alignment ( entity  ,
align   
)

◆ update_hpf_distribution()

void update_hpf_distribution ( entity  ,
distribute   
)

◆ update_hpf_number()

void update_hpf_number ( entity  ,
intptr_t   
)

◆ update_hpf_reductions()

void update_hpf_reductions ( statement  ,
entities   
)

◆ update_list_for_module()

void update_list_for_module ( list  l,
entity  module 
)
Parameters
moduleodule

Definition at line 215 of file host_node_entities.c.

216 {
218 }
#define CHUNK(x)
Definition: genC.h:90
void update_object_for_module(void *obj, entity module)

References CAR, CHUNK, MAPL, module, and update_object_for_module().

Referenced by lUpdateExpr(), and lUpdateExpr_but_distributed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_maybeuseful_mappings()

void update_maybeuseful_mappings ( statement  ,
entities   
)

◆ update_new_host()

void update_new_host ( entity  ,
entity   
)

◆ update_new_node()

void update_new_node ( entity  ,
entity   
)

◆ update_object_for_module()

void update_object_for_module ( void *  obj,
entity  module 
)

push the current functions

pop the initial functions

Parameters
objbj
moduleodule

Definition at line 180 of file host_node_entities.c.

183 {
184  bool (*saved_bound)(entity);
185  entity (*saved_load)(entity);
186 
187  pips_debug(8, "updating (%s) %p\n", gen_domain_name(gen_type(obj)), obj);
188 
189  saved_bound = bound_p, saved_load = load; /* push the current functions */
190 
191  if (module==host_module)
192  {
193  pips_debug(8, "for host\n");
196  }
197  else
198  {
199  pips_debug(8, "for node\n");
202  }
203 
205  (obj,
210  NULL);
211 
212  bound_p = saved_bound, load = saved_load; /* pop the initial functions */
213 }
string gen_domain_name(int t)
GEN_DOMAIN_NAME returns the domain name, and may be used for debug purposes.
Definition: genClib.c:97
int gen_type(gen_chunk *obj)
GEN_TYPE returns the domain number for the object in argument.
Definition: genClib.c:82
static entity(* load)(entity)
static bool(* bound_p)(entity)
static void update_call_for_module_rewrite(call c)
shift the calls to the right variable, in the module
static void update_loop_for_module_rewrite(loop l)
static void update_code_for_module_rewrite(code c)
static void update_reference_for_module_rewrite(reference ref)
shift the references to the right variable, in the module
int bool
we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to h...
Definition: newgen_types.h:78
#define code_domain
newgen_cast_domain_defined
Definition: ri.h:74

References bound_new_host_p(), bound_new_node_p(), bound_p, call_domain, code_domain, gen_domain_name(), gen_multi_recurse(), gen_true(), gen_type(), host_module, load, load_new_host(), load_new_node(), loop_domain, module, pips_debug, reference_domain, update_call_for_module_rewrite(), update_code_for_module_rewrite(), update_loop_for_module_rewrite(), and update_reference_for_module_rewrite().

Referenced by compile_module(), generate_hpf_remapping_file(), hpf_compile_call(), update_list_for_module(), UpdateExpressionForModule(), and UpdateStatementForModule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_old_host()

void update_old_host ( entity  ,
entity   
)

◆ update_old_node()

void update_old_node ( entity  ,
entity   
)

◆ update_overlap_status()

void update_overlap_status ( entity  ,
list   
)

◆ update_overlaps_in_caller()

void update_overlaps_in_caller ( entity  fun,
list  le 
)

the overlaps of the actual parameters are updated according to the formal requirements.

Parameters
funun
lee

Definition at line 864 of file declarations.c.

867 {
868  int len = gen_length(le), i;
869  for (i=1; i<=len; i++, POP(le))
870  {
871  entity v = find_ith_parameter(fun, i);
872  if (array_distributed_p(v))
873  {
874  expression e = EXPRESSION(CAR(le));
875  entity u = expression_to_entity(e), nu;
876  pips_assert("bounded to a new var", bound_new_node_p(u));
877  nu = load_new_node(u);
878  pips_debug(5, "call to %s, %s (%s) -> %s\n",
879  entity_name(fun), entity_name(u),
880  entity_name(nu), entity_name(v));
881  update_overlaps_of(u, v);
882  }
883 
884  }
885 }
static void update_overlaps_of(entity u, entity v)
Definition: declarations.c:843

References array_distributed_p(), bound_new_node_p(), CAR, entity_name, EXPRESSION, expression_to_entity(), find_ith_parameter(), gen_length(), load_new_node(), pips_assert, pips_debug, POP, and update_overlaps_of().

Referenced by hpf_compile_call().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_primary_entity()

void update_primary_entity ( entity  ,
entity   
)

◆ update_renamings()

void update_renamings ( statement  ,
list   
)

Referenced by initial_alignment(), one_align_directive(), one_distribute_directive(), and regenerate_renamings().

+ Here is the caller graph for this function:

◆ update_similar_mapping()

void update_similar_mapping ( entity  ,
entity   
)

◆ update_statement_only_io()

void update_statement_only_io ( statement  ,
bool   
)

◆ updated_control_list()

list updated_control_list ( list  lc,
control_mapping  map 
)
Parameters
lcc
mapap

Definition at line 52 of file compiler-util.c.

55 {
56  list lc_result = NIL;
57  control new_c = control_undefined;
58 
60  {
61  new_c = (control) GET_CONTROL_MAPPING(map, current);
62 
63  pips_assert("defined",
65  !control_undefined_p(new_c));
66 
67  lc_result = CONS(CONTROL, new_c, lc_result);
68  },
69  lc);
70 
71  return(gen_nreverse(lc_result));
72 }
#define control_undefined
Definition: ri.h:916
#define CONTROL(x)
CONTROL.
Definition: ri.h:910
#define control_undefined_p(x)
Definition: ri.h:917

References CONS, CONTROL, control_undefined, control_undefined_p, current, gen_nreverse(), GET_CONTROL_MAPPING, MAP, NIL, and pips_assert.

Referenced by update_control_lists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateExpressionForModule()

expression UpdateExpressionForModule ( entity  module,
expression  ex 
)

this function creates a new expression using the mapping of old to new variables map.

some of the structures generated may be shared...

Parameters
moduleodule
exx

Definition at line 225 of file host_node_entities.c.

228 {
229  expression new = copy_expression(ex);
231  return(new);
232 }

References copy_expression(), module, and update_object_for_module().

Referenced by generate_c1_alpha(), generate_compute_local_indices(), hpf_compile_parallel_loop(), hpf_compile_sequential_loop(), hpf_compile_test(), and st_compute_ith_local_index().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateStatementForModule()

statement UpdateStatementForModule ( entity  module,
statement  stat 
)
Parameters
moduleodule
stattat

Definition at line 303 of file host_node_entities.c.

306 {
307  statement new_stat = copy_statement(stat);
308  update_object_for_module(new_stat, module);
309  return(new_stat);
310 }

References copy_statement(), module, and update_object_for_module().

Referenced by generate_parallel_body().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ written_effect_p()

bool written_effect_p ( entity  var,
list  le 
)

written_effects_to_dist_arrays_p

Parameters
varar
lee

Definition at line 58 of file hpfc-util.c.

60 {
61  FOREACH(EFFECT, e, le)
62  {
63  if(store_effect_p(e)) {
66  return true;
67  }
68  }
69 
70  return false;
71 }

References action_write_p, EFFECT, effect_action, effect_any_reference, FOREACH, reference_variable, and store_effect_p().

Referenced by locally_constant_vector_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ written_effects_to_dist_arrays_p()

bool written_effects_to_dist_arrays_p ( expression  expr)
Parameters
exprxpr

Definition at line 73 of file hpfc-util.c.

74 {
75  list l, leffects_to_dist_arrays = DistArraysEffects(expr);
76 
77  // FI: looks like a FOREACH to me...
78  for(l=leffects_to_dist_arrays; !ENDP(l); POP(l))
79  if(store_effect_p(EFFECT(CAR(l)))) {
81  {
82  gen_free_list(leffects_to_dist_arrays);
83  return true;
84  }
85  }
86 
87  gen_free_list(leffects_to_dist_arrays);
88  return false;
89 }
list DistArraysEffects(expression expr)
effects' action in an expression are here supposed to be read one's but that may not be correct?
Definition: hpfc-util.c:241

References action_write_p, CAR, DistArraysEffects(), EFFECT, effect_action, ENDP, gen_free_list(), POP, and store_effect_p().

+ Here is the call graph for this function:

Variable Documentation

◆ dynamic_entity_p

bool(* dynamic_entity_p) (entity) ( entity  )
extern

as expected, true if entity e is dynamic.

it is just a function name nicer than bound_...

Definition at line 145 of file dynamic.c.

Referenced by add_declaration_to_host_and_link(), add_dynamic_synonym(), create_init_common_param_for_arrays(), create_parameters_h(), one_align_directive(), one_distribute_directive(), and set_similar_mappings_for_updates().

◆ host_module

entity host_module
extern

compiler.c

compiler.c

Compiler

stat is the current statement to be compiled, and there are pointers to the current statement building of the node and host codes. the module of these are also kept in order to add the needed declarations generated by the compilation.

however, every entities of the compiled program, and of both generated programs will be mixed, due to the tabulated nature of these objects. some objects will be shared. I don't think this is a problem. global variables

Definition at line 47 of file compiler.c.

Referenced by add_declaration_to_host_and_link(), AddCommonToHostAndNodeModules(), AddEntityToHostAndNodeModules(), compile_module(), generate_c1_beta(), generate_read_of_ref_for_all(), hpf_compile_block(), hpf_compile_call(), hpf_compile_sequential_loop(), hpf_compile_test(), hpfc_common_hook(), hpfc_module_suffix(), init_host_and_node_entities(), NewVariableForModule(), old_name(), put_generated_resources_for_common(), put_generated_resources_for_module(), and update_object_for_module().

◆ node_module