PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "matrice.h"
#include "tiling.h"
#include "database.h"
#include "text.h"
#include "dg.h"
#include "graph.h"
#include "misc.h"
#include "text-util.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "resources.h"
#include "movements.h"
#include "constants.h"
#include "wp65.h"
Go to the source code of this file.
Typedefs | |
typedef dg_arc_label | arc_label |
Computation of communications needed for generating distributed code in PUMA. More... | |
typedef dg_vertex_label | vertex_label |
Functions | |
void | call_instruction_to_communications (statement s, statement st_level1, statement st_level2, list *lwr, list *lwr_local, statement_mapping *fetch_map, statement_mapping *store_map, hash_table r_to_ud, list *lpv) |
This function associates to each variable in the call statement the statement where it should be communicated (this statement is often external to the call) More... | |
void | loop_instruction_to_communications (statement stmt, statement st_level1, statement st_level2, list *lwr, list *lwr_local, statement_mapping *fetch_map, statement_mapping *store_map, hash_table r_to_ud, list *lpv) |
This function associates to each variable in the loop the statement where it should be communicated (this statement may be external to the loop). More... | |
void | statement_to_communications (statement stmt, statement st_level1, statement st_level2, list *lwr, list *lwr_local, statement_mapping *fetch_map, statement_mapping *store_map, hash_table r_to_ud, list *lpv) |
This function associates to each variable in stmt the statement where it should be communicated. More... | |
void | compute_communications (list l, statement_mapping *fetch_map, statement_mapping *store_map) |
This function associates to each variable the statement in l where it should be communicated Fecth_map contains for each statement the list of variables having to be communicated before its execution. More... | |
static list | constant_symbolic_communication (entity compute_or_memory_module, list lrefs, bool load_code, entity var_id) |
void | include_constant_symbolic_communication (entity compute_or_memory_module, list lrefs, bool load_code, statement computational_or_emulator, entity var_id) |
static list | array_indices_communication (entity compute_or_memory_module, Pbase bank_indices, int bn, int ls, list lrefs, bool load_code, entity var_id, Pbase loop_indices, tiling tile, Pvecteur tile_delay, Pvecteur tile_indices, Pvecteur tile_local_indices) |
static list | array_scalar_access_to_compute_communication (entity compute_module, Pbase bank_indices, int bn, int ls, list lt, bool load_code, entity proc_id, entity var_id, bool fully_sequential, Pbase loop_indices, tiling tile, Pvecteur tile_delay, Pvecteur tile_indices, Pvecteur tile_local_indices) |
list | array_scalar_access_to_bank_communication (entity memory_module, Pbase bank_indices, int bn, int ls, list lt, bool load_code, entity proc_id, entity var_id, bool fully_sequential) |
static list | build_esv_list (list lt, hash_table v_to_esv, Pbase bank_indices) |
static void | insert_array_scalar_access_movement (entity compute_module, entity memory_module, Pbase bank_indices, int bn, int ls, entity proc_id, entity ent1, list lt, statement stat, bool load, hash_table v_to_esv, list *new_slst, list *new_blist, bool fully_sequential, Pbase loop_indices, tiling tile, Pvecteur tile_delay, Pvecteur tile_indices, Pvecteur tile_local_indices) |
void | insert_run_time_communications (entity compute_module, entity memory_module, Pbase bank_indices, int bn, int ls, entity proc_id, list list_statement_block, statement_mapping fetch_map, statement_mapping store_map, list *new_slst, list *new_blist, hash_table v_to_esv, bool fully_sequential, Pbase loop_indices, tiling tile, Pvecteur tile_delay, Pvecteur tile_indices, Pvecteur tile_local_indices) |
bool | test_run_time_communications (list list_statement_block, statement_mapping fetch_map, statement_mapping store_map) |
typedef dg_arc_label arc_label |
Computation of communications needed
for generating distributed code in PUMA.
Corinne Ancourt
Definition at line 48 of file communications.c.
typedef dg_vertex_label vertex_label |
Definition at line 49 of file communications.c.
|
static |
movements for the scalar variables for the compute module or the memory module
building equality L = [(var1 -1) +(var2-1)*ms]/bn*ls]
building equality B = [(var1 -1) +(var2-1)*ms -bn*ls*L ]/ls+1
building equality O = [(var1 -1) +(var2-1)*ms -bn*ls*L -ls*B
Definition at line 319 of file communications.c.
References CAR, CONS, DIMENSION, dimension_lower, dimension_upper, ENDP, entity_type, EXPRESSION, expression_syntax, fprintf(), gen_nconc(), int_to_expression(), int_to_value, make_assign_statement(), make_div_expression(), make_loop_indice_equation(), make_vecteur_expression(), NIL, norm(), NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, NormalizeSyntax(), pips_assert, POP, REFERENCE, reference_indices, reference_variable, STATEMENT, Svecteur::succ, TCST, type_variable, type_variable_p, value_increment, value_minus, VALUE_MONE, value_notzero_p, VALUE_ONE, value_plus, value_uminus, VALUE_ZERO, Svecteur::var, variable_dimensions, vect_add(), vect_add_elem(), vect_coeff(), vect_dup(), vect_multiply(), vect_new(), VECTEUR_NUL, VECTEUR_NUL_P, and vecteur_var.
Referenced by array_scalar_access_to_compute_communication().
list array_scalar_access_to_bank_communication | ( | entity | memory_module, |
Pbase | bank_indices, | ||
int | bn, | ||
int | ls, | ||
list | lt, | ||
bool | load_code, | ||
entity | proc_id, | ||
entity | var_id, | ||
bool | fully_sequential | ||
) |
Generation of the emulated shared memory code corresponding to the transfer of a scalar array element :
CALL BANK_RECEIVE_4(PROC_ID, X1, 1) CALL BANK_RECEIVE_4(PROC_ID, L, 1) CALL BANK_RECEIVE_4(PROC_ID, O, 1) IF (BANK_ID = X1) THEN CALL BANK_SEND_4(PROC_ID, ES_B(O,L), 1) ENDIF
memory_module | emory_module |
bank_indices | ank_indices |
bn | n |
ls | s |
lt | t |
load_code | oad_code |
proc_id | roc_id |
var_id | ar_id |
fully_sequential | ully_sequential |
Definition at line 527 of file communications.c.
References AddEntityToDeclarations(), CONS, constant_symbolic_communication(), entity_intrinsic(), EQUAL_OPERATOR_NAME, gen_nconc(), int_to_expression(), is_execution_parallel, loop_to_statement, make_block_statement(), make_empty_block_statement(), make_execution(), make_loop(), make_loop_label(), make_new_module_variable(), make_range(), make_reference(), make_test_statement(), make_vecteur_expression(), MakeBinaryCall(), NIL, pips_assert, REFERENCE, STATEMENT, Svecteur::succ, UU, VALUE_ONE, Svecteur::var, and vect_new().
Referenced by insert_array_scalar_access_movement().
|
static |
Generation of the compute code corresponding to the transfer of a scalar array element : L = (-101+100*L_J+P)/400 X3 = (-101+100*L_J+P-400*L)/100 O = -101+100*L_J+P-400*L-100*X3 DOALL BANK_ID = 0, 3 CALL WP65_SEND_4(BANK_ID, X3, 1) CALL WP65_SEND_4(BANK_ID, L, 1) CALL WP65_SEND_4(BANK_ID, O, 1) ENDDO CALL WP65_RECEIVE_4(X3, L_B_0_0(P,L_J), 1)
Definition at line 457 of file communications.c.
References AddEntityToDeclarations(), array_indices_communication(), CONS, constant_symbolic_communication(), gen_nconc(), int_to_expression(), is_execution_parallel, loop_to_statement, make_block_statement(), make_execution(), make_loop(), make_loop_label(), make_new_module_variable(), make_range(), make_reference(), NIL, REFERENCE, STATEMENT, Svecteur::succ, UU, and Svecteur::var.
Referenced by insert_array_scalar_access_movement().
|
static |
Definition at line 586 of file communications.c.
References CAR, CONS, EXPRESSION, gen_nreverse(), hash_get(), make_reference(), make_vecteur_expression(), MAPL, NIL, ref, REFERENCE, reference_variable, Svecteur::succ, VALUE_ONE, Svecteur::var, and vect_new().
Referenced by insert_array_scalar_access_movement().
void call_instruction_to_communications | ( | statement | s, |
statement | st_level1, | ||
statement | st_level2, | ||
list * | lwr, | ||
list * | lwr_local, | ||
statement_mapping * | fetch_map, | ||
statement_mapping * | store_map, | ||
hash_table | r_to_ud, | ||
list * | lpv | ||
) |
This function associates to each variable in the call statement the statement where it should be communicated (this statement is often external to the call)
first reference in statement s
st_level1 | t_level1 |
st_level2 | t_level2 |
lwr | wr |
lwr_local | wr_local |
fetch_map | etch_map |
store_map | tore_map |
r_to_ud | _to_ud |
lpv | pv |
Definition at line 67 of file communications.c.
References array_indice_in_list_p(), assignment_statement_p(), bool_to_string(), call_arguments, CAR, debug(), ENDP, entity_is_argument_p(), entity_local_name(), EXPRESSION, expression_to_operand_list(), fprintf(), ifdebug, instruction_call, NIL, pips_assert, POP, print_reference_list(), REFERENCE, reference_in_list_p(), reference_list_print(), reference_list_update(), reference_scalar_p(), reference_variable, statement_instruction, and update_map().
Referenced by statement_to_communications().
void compute_communications | ( | list | l, |
statement_mapping * | fetch_map, | ||
statement_mapping * | store_map | ||
) |
This function associates to each variable the statement in l where it should be communicated Fecth_map contains for each statement the list of variables having to be communicated before its execution.
Store_map contains for each statement the list of variables having to be communicated after its execution.
list of written variables
list of variables written in a local instruction block
list of privates variables
fetch_map | etch_map |
store_map | tore_map |
Definition at line 267 of file communications.c.
References CAR, hash_pointer, hash_table_make(), MAPL, NIL, s1, STATEMENT, and statement_to_communications().
Referenced by module_to_wp65_modules().
|
static |
bool load_code is true if the generated computational code must be a RECEIVE, false if it must be a SEND
movements for the scalar variables for the compute module or the memory module
Definition at line 284 of file communications.c.
References CAR, CONS, ENDP, gen_nconc(), make_movement_scalar_wp65(), NIL, POP, REFERENCE, and STATEMENT.
Referenced by array_scalar_access_to_bank_communication(), array_scalar_access_to_compute_communication(), and include_constant_symbolic_communication().
void include_constant_symbolic_communication | ( | entity | compute_or_memory_module, |
list | lrefs, | ||
bool | load_code, | ||
statement | computational_or_emulator, | ||
entity | var_id | ||
) |
Add data movements to the appropriated module
compute_or_memory_module | ompute_or_memory_module |
lrefs | refs |
load_code | oad_code |
computational_or_emulator | omputational_or_emulator |
var_id | ar_id |
Definition at line 305 of file communications.c.
References constant_symbolic_communication(), gen_nconc(), instruction_block, and statement_instruction.
Referenced by call_to_wp65_code(), and loop_nest_to_wp65_code().
|
static |
creation d'une nouvelle entite pour servir de temporaire au numero de banc memoire contenant la variable scalaire
Definition at line 604 of file communications.c.
References array_scalar_access_to_bank_communication(), array_scalar_access_to_compute_communication(), build_esv_list(), fprintf(), gen_nconc(), ifdebug, load, reference_list_print(), and statement_number.
Referenced by insert_run_time_communications().
void insert_run_time_communications | ( | entity | compute_module, |
entity | memory_module, | ||
Pbase | bank_indices, | ||
int | bn, | ||
int | ls, | ||
entity | proc_id, | ||
list | list_statement_block, | ||
statement_mapping | fetch_map, | ||
statement_mapping | store_map, | ||
list * | new_slst, | ||
list * | new_blist, | ||
hash_table | v_to_esv, | ||
bool | fully_sequential, | ||
Pbase | loop_indices, | ||
tiling | tile, | ||
Pvecteur | tile_delay, | ||
Pvecteur | tile_indices, | ||
Pvecteur | tile_local_indices | ||
) |
compute_module | ompute_module |
memory_module | emory_module |
bank_indices | ank_indices |
bn | n |
ls | s |
proc_id | roc_id |
list_statement_block | ist_statement_block |
fetch_map | etch_map |
store_map | tore_map |
new_slst | ew_slst |
new_blist | ew_blist |
v_to_esv | _to_esv |
fully_sequential | ully_sequential |
loop_indices | oop_indices |
tile | ile |
tile_delay | ile_delay |
tile_indices | ile_indices |
tile_local_indices | ile_local_indices |
Definition at line 639 of file communications.c.
References AddEntityToDeclarations(), CAR, CONS, entity_undefined, gen_nconc(), GET_STATEMENT_MAPPING, HASH_UNDEFINED_VALUE, insert_array_scalar_access_movement(), instruction_block, instruction_call_p, instruction_loop, instruction_tag, is_instruction_block, is_instruction_call, is_instruction_loop, loop_body, make_block_statement(), make_new_module_variable(), MAPL, NIL, STATEMENT, and statement_instruction.
Referenced by loop_nest_to_wp65_code().
void loop_instruction_to_communications | ( | statement | stmt, |
statement | st_level1, | ||
statement | st_level2, | ||
list * | lwr, | ||
list * | lwr_local, | ||
statement_mapping * | fetch_map, | ||
statement_mapping * | store_map, | ||
hash_table | r_to_ud, | ||
list * | lpv | ||
) |
This function associates to each variable in the loop the statement where it should be communicated (this statement may be external to the loop).
stmt | tmt |
st_level1 | t_level1 |
st_level2 | t_level2 |
lwr | wr |
lwr_local | wr_local |
fetch_map | etch_map |
store_map | tore_map |
r_to_ud | _to_ud |
lpv | pv |
Definition at line 150 of file communications.c.
References CAR, fprintf(), instruction_block, instruction_loop, instruction_tag, is_instruction_block, is_instruction_call, loop_body, loop_index, loop_locals, make_reference(), NIL, reference_list_add(), reference_list_update(), STATEMENT, statement_instruction, and statement_to_communications().
Referenced by statement_to_communications().
void statement_to_communications | ( | statement | stmt, |
statement | st_level1, | ||
statement | st_level2, | ||
list * | lwr, | ||
list * | lwr_local, | ||
statement_mapping * | fetch_map, | ||
statement_mapping * | store_map, | ||
hash_table | r_to_ud, | ||
list * | lpv | ||
) |
This function associates to each variable in stmt the statement where it should be communicated.
The lwr list corresponds to the list of variables that have been updated before the current statement bloc. The lwr_local list corresponds to the list of variables that are updated in the current statement bloc.
stmt | tmt |
st_level1 | t_level1 |
st_level2 | t_level2 |
lwr | wr |
lwr_local | wr_local |
fetch_map | etch_map |
store_map | tore_map |
r_to_ud | _to_ud |
lpv | pv |
Definition at line 191 of file communications.c.
References call_instruction_to_communications(), CAR, debug(), fprintf(), ifdebug, instruction_block, instruction_tag, is_instruction_block, is_instruction_call, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, loop_instruction_to_communications(), MAPL, pips_internal_error, reference_list_add(), STATEMENT, and statement_instruction.
Referenced by compute_communications(), and loop_instruction_to_communications().
bool test_run_time_communications | ( | list | list_statement_block, |
statement_mapping | fetch_map, | ||
statement_mapping | store_map | ||
) |
just to avoid warning
list_statement_block | ist_statement_block |
fetch_map | etch_map |
store_map | tore_map |
Definition at line 733 of file communications.c.
References CAR, CONS, GET_STATEMENT_MAPPING, HASH_UNDEFINED_VALUE, instruction_block, instruction_loop, instruction_tag, is_instruction_block, is_instruction_call, is_instruction_loop, loop_body, MAPL, NIL, ok, STATEMENT, and statement_instruction.