PIPS
communications.c File Reference
#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"
+ Include dependency graph for communications.c:

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 Documentation

◆ arc_label

Computation of communications needed
for generating distributed code in PUMA.

Corinne Ancourt

Definition at line 48 of file communications.c.

◆ vertex_label

Definition at line 49 of file communications.c.

Function Documentation

◆ array_indices_communication()

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

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.

332 {
333  pips_assert("true",compute_or_memory_module==compute_or_memory_module
334  && load_code==load_code);
335  list gcode =NIL;
336  list icode = NIL;
337  list ind=NIL;
338  list lrs = NIL;
339  statement stat;
340  Pbase bas_var[3];
341  Pvecteur pv1,pv2,pv,pvi;
342  int i,j;
343  Value coef;
344 
345  /* movements for the scalar variables
346  for the compute module or the memory module */
347  bas_var[1] = VECTEUR_NUL;
348  bas_var[2] = VECTEUR_NUL;
349  for (lrs = lrefs; !ENDP(lrs); POP(lrs)) {
350  reference r = REFERENCE(CAR(lrs));
351  Variable vbank,vligne,vofs;
352  expression exp1,exp2,exp3,exp4;
353  list lex2;
354  type t;
355  Value ms=VALUE_ZERO;
356  for(ind= reference_indices(r),i=1 ; !ENDP(ind);POP(ind),i++) {
357  expression e = EXPRESSION(CAR(ind));
360  bas_var[i]=vect_dup((Pvecteur) normalized_linear(norm));
362  bas_var[i]=vect_dup((Pvecteur) normalized_linear(norm));
363  fprintf(stderr,
364  "[array_indices_communication ERROR]--> NON LINEAR funct.\n");
365  }
366  }
367 
369  if (type_variable_p(t)) {
370  variable var = type_variable(t);
371  cons * dims = variable_dimensions(var);
372  dimension dim1 = DIMENSION(CAR(dims));
373  expression lower= dimension_lower(dim1);
374  normalized norm1 = NORMALIZE_EXPRESSION(lower);
375  expression upper= dimension_upper(dim1);
376  normalized norm2 = NORMALIZE_EXPRESSION(upper);
377  Value min_ms = VALUE_ZERO;
378  Value max_ms = VALUE_ZERO;
379  if (normalized_linear_p(norm1) && normalized_linear_p(norm2)) {
380  min_ms=vect_coeff(TCST,(Pvecteur) normalized_linear(norm1));
381  max_ms=vect_coeff(TCST,(Pvecteur) normalized_linear(norm2));
382  }
383  ms = value_minus(max_ms,min_ms);
384  value_increment(ms);
385  }
386 
387  vbank = (Variable) var_id;
388  vligne = vecteur_var(bank_indices->succ);
389  vofs = vecteur_var(bank_indices->succ->succ);
390  if (VECTEUR_NUL_P(bas_var[2]))
391  bas_var[2] = vect_new(TCST,VALUE_ONE);
392  for (i=1;i<=2;i++) {
393  for (pvi = loop_indices,j=1; !VECTEUR_NUL_P(pvi);
394  pvi = pvi->succ,j++) {
395  if (value_notzero_p(coef = vect_coeff(pvi->var,
396  bas_var[i])))
397  {
399  (loop_indices,tile, tile_delay,
400  tile_indices,tile_local_indices,j);
401  vect_add_elem(&bas_var[i],pvi->var,value_uminus(coef));
402 
403  bas_var[i] =vect_add(bas_var[i],vect_multiply(pv,coef));
404  }
405  }
406  }
407 
408  /* building equality L = [(var1 -1) +(var2-1)*ms]/bn*ls] */
409  pv1 = vect_dup(bas_var[2]);
410  pv1 = vect_multiply(pv1,ms);
411  pv2 = vect_dup(bas_var[1]);
412  pv2 = vect_add(pv2,pv1);
414  exp1= make_vecteur_expression(pv2);
415  exp2 = int_to_expression(bn*ls);
416  lex2 =CONS(EXPRESSION,exp2,NIL);
417  exp3 = make_div_expression(exp1,lex2);
419  stat = make_assign_statement(exp4,exp3);
420 
421  icode = CONS(STATEMENT,stat,NIL);
422  gcode = gen_nconc(gcode,icode);
423  /* building equality B = [(var1 -1) +(var2-1)*ms -bn*ls*L ]/ls+1 */
424  pv1 = vect_dup(bas_var[2]);
425  pv1 = vect_multiply(pv1,ms);
426  pv2 = vect_dup(bas_var[1]);
427  pv2 = vect_add(pv2,pv1);
428  vect_add_elem(&pv2,vligne,int_to_value((-bn*ls)));
430  exp1= make_vecteur_expression(pv2);
431  exp2 = int_to_expression(ls);
432  lex2 =CONS(EXPRESSION,exp2,NIL);
433  exp3 = make_div_expression(exp1,lex2);
435  stat = make_assign_statement(exp4,exp3);
436  icode = CONS(STATEMENT,stat,NIL);
437  gcode = gen_nconc(gcode,icode);
438  /* building equality O = [(var1 -1) +(var2-1)*ms -bn*ls*L -ls*B */
439  pv1 = vect_dup(bas_var[2]);
440  pv1 = vect_multiply(pv1,ms);
441  pv2 = vect_dup(bas_var[1]);
442  pv2 = vect_add(pv2,pv1);
443  vect_add_elem(&pv2,vligne,int_to_value((-bn*ls)));
444  vect_add_elem(&pv2,vbank,int_to_value((-ls)));
446  exp1= make_vecteur_expression(pv2);
448  stat = make_assign_statement(exp4,exp1);
449  icode = CONS(STATEMENT,stat,NIL);
450  gcode = gen_nconc(gcode,icode);
451  }
452  return (gcode);
453 }
#define VALUE_ZERO
#define value_increment(ref)
#define int_to_value(i)
end LINEAR_VALUE_IS_INT
#define value_minus(v1, v2)
#define value_notzero_p(val)
#define value_uminus(val)
unary operators on values
#define VALUE_MONE
int Value
#define value_plus(v1, v2)
binary operators on values
#define VALUE_ONE
Pvecteur make_loop_indice_equation(Pbase loop_indices, tiling tile, Pvecteur tile_delay, Pvecteur tile_indices, Pvecteur tile_local_indices, int rank)
PACKAGE MOVEMENTS.
Definition: build_sc_tile.c:51
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59
#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
statement make_assign_statement(expression, expression)
Definition: statement.c:583
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
expression make_div_expression(expression, cons *)
operation.c
Definition: operation.c:42
normalized NormalizeSyntax(syntax s)
Definition: normalize.c:94
static void norm(struct rproblem *RR)
cette procedure normalise la fonction cout, calcule les valeurs des seconds membres resultant d'une n...
Definition: r1.c:271
#define NORMALIZE_EXPRESSION(e)
expression make_vecteur_expression(Pvecteur pv)
make expression for vector (Pvecteur)
Definition: expression.c:1650
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
#define REFERENCE(x)
REFERENCE.
Definition: ri.h:2296
#define normalized_linear_p(x)
Definition: ri.h:1779
#define reference_variable(x)
Definition: ri.h:2326
#define dimension_lower(x)
Definition: ri.h:980
#define type_variable(x)
Definition: ri.h:2949
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define dimension_upper(x)
Definition: ri.h:982
#define reference_indices(x)
Definition: ri.h:2328
#define variable_dimensions(x)
Definition: ri.h:3122
#define entity_type(x)
Definition: ri.h:2792
#define normalized_linear(x)
Definition: ri.h:1781
#define expression_syntax(x)
Definition: ri.h:1247
#define type_variable_p(x)
Definition: ri.h:2947
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
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
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define vecteur_var(v)
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_NUL_P(v)
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_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
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
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Definition: binaires.c:53
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
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 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().

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

◆ array_scalar_access_to_bank_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

Parameters
memory_moduleemory_module
bank_indicesank_indices
bnn
lss
ltt
load_codeoad_code
proc_idroc_id
var_idar_id
fully_sequentialully_sequential

Definition at line 527 of file communications.c.

530 {
531  pips_assert("true", ls==ls);
532 
533  reference ref1 = make_reference((entity) bank_indices->succ->var,NIL);
534  reference ref2 = make_reference((entity) bank_indices->succ->succ->var,NIL);
535  list lst = CONS(REFERENCE,make_reference(var_id,NIL),
536  CONS(REFERENCE,ref1, CONS(REFERENCE,ref2,NIL)));
537  if (!fully_sequential) {
538  /*
539  Generation of the emulated shared memory code corresponding to
540  the transfer of a scalar array element :
541 
542  CALL BANK_RECEIVE_4(PROC_ID, X1, 1)
543  CALL BANK_RECEIVE_4(PROC_ID, L, 1)
544  CALL BANK_RECEIVE_4(PROC_ID, O, 1)
545  IF (BANK_ID = X1) THEN
546  CALL BANK_SEND_4(PROC_ID, ES_B(O,L), 1)
547  ENDIF
548  */
549  list ccode= constant_symbolic_communication(memory_module,
550  lst,!load_code,proc_id);
551  list tcode = constant_symbolic_communication(memory_module,
552  lt,load_code,proc_id);
553  expression exp1 =make_vecteur_expression(vect_new(bank_indices->var,
554  VALUE_ONE));
556  VALUE_ONE));
558  statement testbody = make_block_statement(tcode);
559  statement stat = make_test_statement(test_bound,testbody,
561  return (gen_nconc(ccode,CONS(STATEMENT,stat,NIL)));
562  }
563  else {
564  entity ent1 = make_new_module_variable(memory_module,100);
565  list ccode= constant_symbolic_communication(memory_module,lst,
566  !load_code,(entity) bank_indices->var);
567  list icode= constant_symbolic_communication(memory_module,lt,
568  load_code,ent1);
569  range looprange = make_range(int_to_expression(0),
570  int_to_expression(bn-1),
571  int_to_expression(1));
572  statement loopbody = make_block_statement(icode);
573  entity looplabel = make_loop_label(9000, memory_module);
574 
575  loop newloop = make_loop(ent1,looprange, loopbody, looplabel,
577 
578  statement stat = loop_to_statement(newloop);
579  AddEntityToDeclarations(ent1,memory_module);
580  icode = gen_nconc(ccode,CONS(STATEMENT,stat,NIL));
581  return icode;
582  }
583 }
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
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
range make_range(expression a1, expression a2, expression a3)
Definition: ri.c:2041
static list constant_symbolic_communication(entity compute_or_memory_module, list lrefs, bool load_code, entity var_id)
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
statement make_empty_block_statement(void)
Build an empty statement (block/sequence)
Definition: statement.c:625
statement make_test_statement(expression, statement, statement)
Definition: statement.c:1248
#define UU
Definition: newgen_types.h:98
#define loop_to_statement(l)
#define EQUAL_OPERATOR_NAME
entity make_loop_label(int __attribute__((unused)) desired_number, entity module)
Definition: entity.c:370
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
entity make_new_module_variable(entity, int)
Make a new module integer variable of name X<d>.
Definition: variable.c:830
void AddEntityToDeclarations(entity, entity)
END_EOLE.
Definition: variable.c:108
@ is_execution_parallel
Definition: ri.h:1190

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().

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

◆ array_scalar_access_to_compute_communication()

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 
)
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.

464 {
465 
466  list icode,lst;
467  icode = array_indices_communication(compute_module,bank_indices,
468  bn,ls,lt,
469  load_code,var_id,loop_indices,tile,
470  tile_delay,
471  tile_indices,tile_local_indices);
472  lst = CONS(REFERENCE,make_reference(var_id,NIL),
473  CONS(REFERENCE,
474  make_reference((entity) bank_indices->succ->var,
475  NIL),
476  CONS(REFERENCE,
477  make_reference((entity) bank_indices->succ->succ->var,NIL),
478  NIL)));
479 
480  if (!fully_sequential) {
481  /* Generation of the compute code corresponding to the transfer
482  of a scalar array element :
483  L = (-101+100*L_J+P)/400
484  X3 = (-101+100*L_J+P-400*L)/100
485  O = -101+100*L_J+P-400*L-100*X3
486  DOALL BANK_ID = 0, 3
487  CALL WP65_SEND_4(BANK_ID, X3, 1)
488  CALL WP65_SEND_4(BANK_ID, L, 1)
489  CALL WP65_SEND_4(BANK_ID, O, 1)
490  ENDDO
491  CALL WP65_RECEIVE_4(X3, L_B_0_0(P,L_J), 1)
492  */
493  entity ent1 = make_new_module_variable(compute_module,100);
494 
495  list ccode= constant_symbolic_communication(compute_module,lst,
496  !load_code,ent1);
497  range looprange = make_range(int_to_expression(0),
498  int_to_expression(bn-1),
499  int_to_expression(1));
500  statement loopbody = make_block_statement(ccode);
501  entity looplabel = make_loop_label(9000, compute_module);
502 
503  loop newloop = make_loop(ent1,
504  looprange,
505  loopbody,
506  looplabel,
508  NIL);
509 
510  statement stat = loop_to_statement(newloop);
511  AddEntityToDeclarations(ent1,compute_module);
512  icode = gen_nconc(icode,CONS(STATEMENT,stat,NIL));
513  ccode = constant_symbolic_communication(compute_module,lt,load_code,var_id);
514  icode = gen_nconc(icode,ccode);
515  return icode;
516  }
517  else {
518 
519  list ccode = constant_symbolic_communication(compute_module,lst,!load_code,proc_id);
520  ccode = gen_nconc(icode,ccode);
521  icode = constant_symbolic_communication(compute_module,lt,load_code,proc_id);
522  ccode = gen_nconc(ccode,icode);
523  return ccode;
524  }
525 }
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)

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().

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

◆ build_esv_list()

static list build_esv_list ( list  lt,
hash_table  v_to_esv,
Pbase  bank_indices 
)
static

Definition at line 586 of file communications.c.

587 {
588  list newlt=NIL;
589  MAPL(ref, {
591  entity esv = (entity) hash_get(v_to_esv, (char *) var1);
593  (vect_new((char *) bank_indices->succ->var, VALUE_ONE));
595  (vect_new((char *) bank_indices->succ->succ->var, VALUE_ONE));
596  list args = CONS(EXPRESSION,expr2, CONS(EXPRESSION,expr1,NIL));
597  reference ref1 = make_reference((Variable) esv,args);
598  newlt=CONS(REFERENCE,ref1,newlt);
599  },lt);
600  return gen_nreverse(newlt);
601 
602 }
struct _newgen_struct_entity_ * entity
Definition: abc_private.h:14
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
#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
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449

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().

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

◆ call_instruction_to_communications()

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)

communications.c

first reference in statement s

Parameters
st_level1t_level1
st_level2t_level2
lwrwr
lwr_localwr_local
fetch_mapetch_map
store_maptore_map
r_to_ud_to_ud
lpvpv

Definition at line 67 of file communications.c.

77 {
78  pips_assert("true", r_to_ud==r_to_ud);
79 
80  if(assignment_statement_p(s)) {
81  reference r;
82  entity rv;
83  list lexpr =
85  /* first reference in statement s */
86  bool first_reference = true;
87 
88  for(; !ENDP(lexpr); POP(lexpr)) {
89  expression e = EXPRESSION(CAR(lexpr));
91  if (lr != NIL) {
92  list consr = lr;
93  ifdebug(2) {
94  (void) fprintf(stderr, "reference list:");
96  (void) fprintf(stderr, "first_reference=%s\n",
97  bool_to_string(first_reference));
98  }
99  for(consr = lr; !ENDP(consr) ; POP(consr)) {
100  r = REFERENCE(CAR(consr));
101  rv = reference_variable(r);
102  if (first_reference) {
103  ifdebug(2) {
104  (void) fprintf(stderr,"list lwr_local:");
105  reference_list_print(*lwr_local);}
106  reference_list_update(lwr_local,r);
107  update_map(*store_map,st_level2,r);
108  first_reference = false;
109  }
110  else {
111  if(!entity_is_argument_p(rv, *lpv)) {
112  debug(8,"loop_nest_to_local_variables",
113  "Variable %s is not private\n",
114  entity_local_name(rv));
115  ifdebug(2) {
116  (void) fprintf(stderr,"list lwr_local:");
117  reference_list_print(*lwr_local);
118  (void) fprintf(stderr,"list lwr : ");
119  reference_list_print(*lwr);}
120 
121  if (reference_scalar_p(r)) {
122  if (!reference_in_list_p(r,*lwr_local))
123  update_map(*fetch_map,st_level1,r);
124  }
125  else {
126  if (array_indice_in_list_p(r,*lwr_local))
127  update_map(*fetch_map,s,r);
128  else if (array_indice_in_list_p(r,*lwr))
129  update_map(*fetch_map,st_level2,r);
130  else update_map(*fetch_map,st_level1,r);
131  }
132  }
133  }
134  }
135  }
136  }
137  }
138  else {
139  ifdebug(9)
140  (void) fprintf(stderr,
141  "call-communications - not assignment\n");
142  }
143 }
bool entity_is_argument_p(entity e, cons *args)
Definition: arguments.c:150
bool assignment_statement_p(statement)
Test if a statement is an assignment.
Definition: statement.c:135
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
string bool_to_string(bool)
Definition: string.c:243
void print_reference_list(list lr)
Definition: expression.c:147
list expression_to_operand_list(expression e, list lr)
This function gives the list of operands belonging to Expression e.
Definition: references.c:96
void reference_list_print(list l)
This function prints the references belonging to l.
Definition: references.c:186
void reference_list_update(list *l, reference r)
This function add Reference r to List l, if r doesn't belong to l.
Definition: references.c:161
bool array_indice_in_list_p(reference r, list lwr)
Definition: references.c:140
bool reference_in_list_p(reference r, list lwr)
This function tests whether at least one array indice of Reference r belongs to List lwr or not.
Definition: references.c:130
void update_map(statement_mapping m, statement st, reference r)
Definition: references.c:68
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
bool reference_scalar_p(reference r)
This function returns true if Reference r is scalar.
Definition: expression.c:3530
#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 ifdebug(n)
Definition: sg.c:47

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().

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

◆ compute_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

Parameters
fetch_mapetch_map
store_maptore_map

Definition at line 267 of file communications.c.

268 {
269  list lwr=NIL; /* list of written variables */
270  list lwr_local= NIL; /* list of variables written in a local
271  instruction block */
272  list lpv = NIL; /* list of privates variables */
274  statement first_stmt = STATEMENT(CAR(l));
275  MAPL(pm,{
276  statement s1 = STATEMENT(CAR(pm));
277  statement_to_communications(s1,first_stmt,s1,&lwr, &lwr_local,
278  fetch_map,store_map, r_to_ud1,&lpv);
279  },l);
280 
281 }
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.
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
@ hash_pointer
Definition: newgen_hash.h:32
s1
Definition: set.c:247

References CAR, hash_pointer, hash_table_make(), MAPL, NIL, s1, STATEMENT, and statement_to_communications().

Referenced by module_to_wp65_modules().

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

◆ constant_symbolic_communication()

static list constant_symbolic_communication ( entity  compute_or_memory_module,
list  lrefs,
bool  load_code,
entity  var_id 
)
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.

287 {
288  /* bool load_code is true if the generated computational code
289  must be a RECEIVE, false if it must be a SEND*/
290 
291  list lrs;
292  list ccode = NIL; /* movements for the scalar variables
293  for the compute module or the memory module */
294  for (lrs =lrefs ; !ENDP(lrs) ; POP(lrs)) {
295  reference r = REFERENCE(CAR(lrs));
296  statement sblock=
297  make_movement_scalar_wp65(compute_or_memory_module,load_code,
298  r,var_id);
299  ccode = gen_nconc(ccode,CONS(STATEMENT, sblock, NIL));
300  }
301  return ccode;
302 }
statement make_movement_scalar_wp65(entity module, bool receive_code, reference r, entity var_id)
statement make_movement_scalar_wp65(receive_code,r)

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().

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

◆ 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

Parameters
compute_or_memory_moduleompute_or_memory_module
lrefsrefs
load_codeoad_code
computational_or_emulatoromputational_or_emulator
var_idar_id

Definition at line 305 of file communications.c.

309 {
310  instruction i;
311  list ccode = constant_symbolic_communication(compute_or_memory_module,lrefs,
312  load_code,var_id);
313  /* Add data movements to the appropriated module */
314  i = statement_instruction(computational_or_emulator);
316 }
#define instruction_block(i)

References constant_symbolic_communication(), gen_nconc(), instruction_block, and statement_instruction.

Referenced by call_to_wp65_code(), and loop_nest_to_wp65_code().

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

◆ insert_array_scalar_access_movement()

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 
)
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.

610 {
611  list ccode ;
612  ifdebug(8) {
613  fprintf(stderr,
614  " communication to be inserted at run time stat no %"PRIdPTR": ",
615  statement_number(stat));
617 
618  }
619 
620  /* creation d'une nouvelle entite pour servir de temporaire au
621  numero de banc memoire contenant la variable scalaire */
622  ccode =array_scalar_access_to_compute_communication(compute_module,
623  bank_indices,bn,
624  ls,lt,load,proc_id,
625  ent1,fully_sequential,
626  loop_indices,tile, tile_delay,tile_indices,
627  tile_local_indices);
628 
629  *new_slst = gen_nconc(*new_slst,ccode);
630  lt = build_esv_list(lt,v_to_esv,bank_indices);
631  ccode =array_scalar_access_to_bank_communication(memory_module, bank_indices,bn,
632  ls,lt,!load, proc_id,
633  ent1,fully_sequential);
634 
635  *new_blist = gen_nconc(*new_blist,ccode);
636 }
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 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)
static entity(* load)(entity)
#define statement_number(x)
Definition: ri.h:2452

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().

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

◆ 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 
)
Parameters
compute_moduleompute_module
memory_moduleemory_module
bank_indicesank_indices
bnn
lss
proc_idroc_id
list_statement_blockist_statement_block
fetch_mapetch_map
store_maptore_map
new_slstew_slst
new_blistew_blist
v_to_esv_to_esv
fully_sequentialully_sequential
loop_indicesoop_indices
tileile
tile_delayile_delay
tile_indicesile_indices
tile_local_indicesile_local_indices

Definition at line 639 of file communications.c.

647 {
648  int nbcall=0;
649  entity ent1=entity_undefined;
650 
651  MAPL(st1,
653  switch(instruction_tag(inst)) {
654  case is_instruction_block: {
655 
656  list new_slst1 = NIL;
657  nbcall = 0;
658  MAPL(st2, {
659  insert_run_time_communications(compute_module,memory_module,
660  bank_indices,bn,ls,proc_id,
661  CONS(STATEMENT,
662  STATEMENT(CAR(st2)),NIL),
663  fetch_map,store_map,
664  &new_slst1,new_blist,
665  v_to_esv,fully_sequential,
666  loop_indices,tile, tile_delay,
667  tile_indices,tile_local_indices);
668 
669 
670 },
671  instruction_block(inst));
672  instruction_block(inst)= new_slst1;
673  break; }
674  case is_instruction_loop: {
675  statement lbody = loop_body(instruction_loop(inst));
677  lbody,NIL));
678  cons *nbody=(instruction_call_p(statement_instruction(lbody))) ?
679  CONS(STATEMENT,sbody,NIL) :
680  CONS(STATEMENT,lbody,NIL);
681  insert_run_time_communications(compute_module,memory_module,
682  bank_indices,bn,ls,proc_id,
683  nbody,fetch_map,store_map,new_slst,
684  new_blist,
685  v_to_esv,fully_sequential,
686  loop_indices,tile, tile_delay,
687  tile_indices,tile_local_indices);
688  *new_slst = gen_nconc(*new_slst,
689  CONS(STATEMENT,STATEMENT(CAR(st1)),NIL));
690  break;
691  }
692  case is_instruction_call: {
693  list lt;
694 
695  if ((lt= (list)
696  GET_STATEMENT_MAPPING(fetch_map,STATEMENT(CAR(st1))))
697  != (list) HASH_UNDEFINED_VALUE && nbcall ) {
698 
699  ent1 = make_new_module_variable(compute_module,100);
700  AddEntityToDeclarations(ent1,compute_module);
701 
702  insert_array_scalar_access_movement(compute_module,memory_module,bank_indices,
703  bn,ls,proc_id,ent1,lt,STATEMENT(CAR(st1)),true,
704  v_to_esv,new_slst,new_blist,fully_sequential,
705  loop_indices,tile, tile_delay,tile_indices,
706  tile_local_indices
707  );
708  }
709  if ((lt=(list) GET_STATEMENT_MAPPING(store_map,
710  STATEMENT(CAR(st1))))
711  != (list) HASH_UNDEFINED_VALUE && nbcall )
712  {
713  ent1 = make_new_module_variable(compute_module,100);
714  AddEntityToDeclarations(ent1,compute_module);
715 
716  insert_array_scalar_access_movement(compute_module,memory_module,bank_indices,
717  bn,ls,proc_id,ent1,lt,STATEMENT(CAR(st1)),false,
718  v_to_esv,new_slst,new_blist,fully_sequential,
719  loop_indices,tile, tile_delay,tile_indices,
720  tile_local_indices);
721  }
722  *new_slst = gen_nconc(*new_slst,CONS(STATEMENT,STATEMENT(CAR(st1)),NIL));
723  nbcall ++;
724  break;
725  }
726  default:
727  break;
728  }
729  }, list_statement_block);
730 }
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)
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)
#define GET_STATEMENT_MAPPING(map, stat)
Definition: newgen-local.h:49
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
Definition: newgen_hash.h:56
#define is_instruction_block
soft block->sequence transition
#define loop_body(x)
Definition: ri.h:1644
#define instruction_loop(x)
Definition: ri.h:1520
#define entity_undefined
Definition: ri.h:2761
@ is_instruction_call
Definition: ri.h:1474
@ is_instruction_loop
Definition: ri.h:1471
#define instruction_tag(x)
Definition: ri.h:1511
#define instruction_call_p(x)
Definition: ri.h:1527

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().

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

◆ loop_instruction_to_communications()

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).

Parameters
stmttmt
st_level1t_level1
st_level2t_level2
lwrwr
lwr_localwr_local
fetch_mapetch_map
store_maptore_map
r_to_ud_to_ud
lpvpv

Definition at line 150 of file communications.c.

154 {
158  reference_list_add(lwr, lwr_local);
161  NIL));
162  *lwr_local = NIL;
163  *lpv=loop_locals(instruction_loop(inst));
164 
165  switch(instruction_tag(inst2)) {
166  case is_instruction_block:
167  st_level2 = STATEMENT(CAR(instruction_block(inst)));
168  break;
169  case is_instruction_call:
170  st_level2 =b;
171  break;
172  default:
173  (void) fprintf(stderr,
174  "loop_instruction_to_communications: non implemented case \n");
175  break;
176  }
177  statement_to_communications(b,st_level1, st_level2,
178  lwr,lwr_local,
179  fetch_map,store_map,r_to_ud,lpv);
180 
181 }
void reference_list_add(list *l1, list *l2)
This function adds all the references of l2 to l1 if they don't appear in l1.
Definition: references.c:175
struct _newgen_struct_instruction_ * instruction
Definition: ri.h:207
#define loop_locals(x)
Definition: ri.h:1650
#define loop_index(x)
Definition: ri.h:1640
Definition: statement.c:54

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().

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

◆ 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.

Parameters
stmttmt
st_level1t_level1
st_level2t_level2
lwrwr
lwr_localwr_local
fetch_mapetch_map
store_maptore_map
r_to_ud_to_ud
lpvpv

Definition at line 191 of file communications.c.

196 {
198 
199  debug(8, "statement_to_communications", "begin with tag %d\n",
200  instruction_tag(inst));
201 
202  switch(instruction_tag(inst)) {
203  case is_instruction_block: {
204  ifdebug(7)
205  (void) fprintf(stderr,
206  "statement_to_communications-instruction block- begin\n");
207  st_level2 = STATEMENT(CAR(instruction_block(inst)));
208  MAPL( sts, {
209  statement s = STATEMENT(CAR(sts));
210  statement_to_communications(s,st_level1, st_level2,
211  lwr,lwr_local,
212  fetch_map,store_map,
213  r_to_ud,lpv);
214  }, instruction_block(inst));
215  ifdebug(7)
216  (void) fprintf(stderr,
217  "statement_to_communications-instruction block- end\n");
218  break;
219  }
220  case is_instruction_test:
221  (void) fprintf(stderr,"not implemented\n");
222  break;
223  case is_instruction_loop: {
224  ifdebug(7)
225  (void) fprintf(stderr,
226  "statement_to_communications-instruction loop- begin\n");
228  lwr, lwr_local,
229  fetch_map,store_map,
230  r_to_ud,lpv);
231  reference_list_add(lwr, lwr_local);
232  ifdebug(7)
233  (void) fprintf(stderr,
234  "statement_to_communications-instruction loop- end\n");
235  break;
236  }
237  case is_instruction_call: {
238  ifdebug(7)
239  (void) fprintf(stderr,"statement_to_communications-instruction call- begin\n");
240  call_instruction_to_communications(stmt, st_level1, st_level2,
241  lwr, lwr_local,
242  fetch_map,store_map,r_to_ud,lpv);
243  ifdebug(7)
244  (void) fprintf(stderr,"statement_to_communications-instruction call- end\n");
245  break;
246  }
247  case is_instruction_goto: {
248  pips_internal_error("Unexpected goto");
249  break;}
251  pips_internal_error("Sorry: unstructured not implemented");
252  break;}
253  default:
254  pips_internal_error("Bad instruction tag");
255  }
256 }
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 (...
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 comm...
#define pips_internal_error
Definition: misc-local.h:149
@ is_instruction_goto
Definition: ri.h:1473
@ is_instruction_unstructured
Definition: ri.h:1475
@ is_instruction_test
Definition: ri.h:1470

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().

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

◆ test_run_time_communications()

bool test_run_time_communications ( list  list_statement_block,
statement_mapping  fetch_map,
statement_mapping  store_map 
)

just to avoid warning

Parameters
list_statement_blockist_statement_block
fetch_mapetch_map
store_maptore_map

Definition at line 733 of file communications.c.

735 {
736  bool ok ;
737  int nbcall =0;
738  MAPL(st1,
740  switch(instruction_tag(inst)) {
741  case is_instruction_block: {
742  ok = false;
743  MAPL(st2, {
744  ok = (ok) ? ok :
746  STATEMENT(CAR(st2)),
747  NIL),
748  fetch_map,store_map);
749  },
750  instruction_block(inst));
751  return ok;
752  break; }
753  case is_instruction_loop: {
756  NIL),
757  fetch_map,store_map));
758  break;}
759  case is_instruction_call: {
760  list lt = (list) GET_STATEMENT_MAPPING(fetch_map,STATEMENT(CAR(st1)));
761  if (lt != (list) HASH_UNDEFINED_VALUE) {
762  nbcall ++;
763  return (true);
764  } else
765  return(false);
766  break;
767  }
768  default:
769  break;
770  }
771  },
772  list_statement_block);
773  /* just to avoid warning */
774  return (true);
775 }
bool test_run_time_communications(list list_statement_block, statement_mapping fetch_map, statement_mapping store_map)
struct cons * list
Definition: newgen_types.h:106
static bool ok

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.