PIPS
compile_RT.c
Go to the documentation of this file.
1 /*
2  Taille des entiers utilises en parametre pour l'API de la runtime
3 
4 !!!!! Leur coherence avec STEP.h, steprt_f.h et la runtime doit etre assuree manuellement !!!!!
5 
6 */
7 #include <stdarg.h>
8 #ifdef HAVE_CONFIG_H
9  #include "pips_config.h"
10 #endif
11 #include "defines-local.h"
12 #include "syntax.h" // for MakeParameter
13 //#include "pipsmake.h" // for compilation_unit_of_module
14 #include "c_syntax.h" // for put_new_typedef
15 #include "workspace-util.h" // for AddEntityToModuleCompilationUnit
16 #include "prettyprint.h" // for print_statement()
17 
18 #define STEP_RT_INTEGER4 DEFAULT_INTEGER_TYPE_SIZE
19 #define STEP_RT_INTEGER8 DEFAULT_LONG_LONG_INTEGER_TYPE_SIZE
20 
21 #define STEP_RT_SYMBOLIC_INTEGER STEP_RT_INTEGER4
22 #define STEP_RT_ARRAY_INDEX_INTEGER STEP_RT_INTEGER4
23 #define STEP_RT_LOOP_INDEX_INTEGER STEP_RT_INTEGER4
24 
25 //######################################################
26 
28 {
29  expression expr2;
30 
31  /* Used to add & in front of variable name for C modules: var ---> &var */
32 
33  expr2 = expr;
36 
37  return expr2;
38 }
39 
40 static expression cast_STEP_ARG(expression expr, bool ptr)
41 {
43  return expr;
44 
46  entity step_arg_e = FindOrCreateEntity(cu, TYPEDEF_PREFIX "STEP_ARG");
47 
48  if(storage_undefined_p(entity_storage(step_arg_e)))
49  {
50  entity_storage(step_arg_e) = make_storage_rom();
51  put_new_typedef("STEP_ARG");
52  }
53 
54  type step_arg_t = MakeTypeVariable(make_basic_typedef(step_arg_e), NIL);
55  if(ptr)
56  step_arg_t = MakeTypeVariable(make_basic_pointer(step_arg_t), NIL);
57  return MakeCastExpression(step_arg_t, expr);
58 }
59 
60 void generate_call_construct_begin_construct_end(entity new_module, step_directive drt, statement mpi_begin_stmt, statement mpi_end_stmt)
61 {
62 /*
63  Generation of:
64  STEP_CONSTRUCT_BEGIN(STEP_DO);
65  ...
66  STEP_CONSTRUCT_END(STEP_DO);
67  */
68 
69  string directive_txt;
72  {
73  statement construct_begin_stmt;
74  statement construct_end_stmt;
75 
76  construct_begin_stmt = call_STEP_subroutine2(RT_STEP_construct_begin, step_symbolic_expression(directive_txt, new_module), NULL);
77  insert_statement(mpi_begin_stmt, construct_begin_stmt, true);
78 
80  insert_statement(mpi_end_stmt, construct_end_stmt, false);
82  }
83 }
84 
85 void generate_call_flush(statement *stepalltoall_stmt)
86 {
87  pips_debug(1, "begin\n");
88  /*
89  Generation of
90  STEP_FLUSH();
91  */
92  if(!ENDP(statement_block(*stepalltoall_stmt)))
93  {
94  statement flush_stmt = build_call_STEP_flush();
95  insert_statement(*stepalltoall_stmt, flush_stmt, false);
96  }
97  pips_debug(1, "end\n");
98 }
99 
100 
101 void generate_loop_workchunk(entity mpi_module, statement *compute_regions_stmt)
102 {
103  statement loop_stmt;
104  /* ATTENTION recrée alors qu'avant réutilisé */
105  entity workchunk_id = step_local_slice_index(mpi_module);
106  /*
107  Generation of
108  for(IDX = 1; IDX <= STEP_COMM_SIZE; IDX += 1) {}
109  */
111 
112  loop_stmt = instruction_to_statement(make_instruction_loop(make_loop(workchunk_id, rng, *compute_regions_stmt, entity_empty_label(), make_execution_sequential(), NIL)));
113 
114  *compute_regions_stmt = make_empty_block_statement();
115  insert_statement(*compute_regions_stmt, loop_stmt, true);
116 
117 }
118 
119 void generate_call_get_workchunk_loopbounds(entity mpi_module, loop loop_stmt, statement *compute_regions_stmt)
120 {
121  pips_debug(1, "begin\n");
122  /*
123  Generation of:
124  STEP_GET_LOOPBOUNDS(IDX-1, &STEP_i_LOW, &STEP_i_UP);
125  */
126  entity index = loop_index(loop_stmt);
127  entity workchunk_id = step_local_slice_index(mpi_module);
128  expression expr_id_workchunk = make_op_exp(PLUS_OPERATOR_NAME, int_to_expression(-1), entity_to_expression(workchunk_id));
129  expression expr_index_low = entity_to_expression(step_local_loop_index(mpi_module, STEP_BOUNDS_LOW(index)));
130  expression expr_index_up = entity_to_expression(step_local_loop_index(mpi_module, STEP_BOUNDS_UP(index)));
131 
132  statement get_bounds_stmt = call_STEP_subroutine2(RT_STEP_get_loopbounds, expr_id_workchunk, get_expression_addr(expr_index_low), get_expression_addr(expr_index_up), NULL);
133  insert_statement(*compute_regions_stmt, get_bounds_stmt, true);
134 
135  pips_debug(1, "end\n");
136 }
137 
139 {
140  pips_debug(1, "begin\n");
141 
142  /*
143  Generation of:
144  CALL STEP_GETLOOPBOUNDS(STEP_Rank, &I_SLICE_LOW, &I_SLICE_UP)
145  */
146  entity index = loop_index(loop_stmt);
147  entity index_low = step_local_loop_index(new_module, STEP_BOUNDS_LOW(index));
148  expression expr_index_low = entity_to_expression(index_low);
149  entity index_up = step_local_loop_index(new_module, STEP_BOUNDS_UP(index));
150  expression expr_index_up = entity_to_expression(index_up);
151  entity id_workchunk = get_entity_step_rank(new_module);
152  expression expr_id_workchunk = entity_to_expression(id_workchunk);
153 
154  statement get_bounds_stmt = call_STEP_subroutine2(RT_STEP_get_loopbounds, expr_id_workchunk, get_expression_addr(expr_index_low), get_expression_addr(expr_index_up), NULL);
155 
156  pips_debug(1, "end\n");
157 
158  return get_bounds_stmt;
159 }
160 
162 {
163  statement stmt;
164  /*
165  Generation of:
166  CALL STEP_GET_RANK(&STEP_COMM_RANK)
167  */
168  entity rank = get_entity_step_rank(new_module);
169  expression expr_rank = entity_to_expression(rank);
170 
171 
173  return stmt;
174 }
175 
177 {
178  pips_debug(1, "begin new_module = %p, loop_stmt = %p\n", new_module, loop_stmt);
179  statement stmt;
180  /*
181  Generation of:
182  STEP_COMPUTE_LOOPSLICES(0, 99999, 1, STEP_COMM_SIZE);
183  */
184  entity commsize = get_entity_step_commsize(new_module);
185  expression commsize_expr = entity_to_expression(commsize);
186  range r = loop_range(loop_stmt);
187 
189  pips_debug(1, "end\n");
190  return stmt;
191 }
192 
194 {
195  pips_debug(1, "begin\n");
196  statement stmt;
197  /*
198  Generation of:
199  STEP_GET_COMMSIZE(&STEP_COMM_SIZE);
200  */
201 
202  entity commsize = get_entity_step_commsize(new_module);
203  expression commsize_expr = entity_to_expression(commsize);
204 
206  pips_debug(1, "end\n");
207  return stmt;
208 }
209 
210 void generate_call_init_regionArray(list referenced_entities, statement before, statement __attribute__ ((unused)) after)
211 {
212  list init_block = NIL;
213 
214  /*
215  Generation of
216 
217  STEP_INIT_ARRAYREGIONS(a, STEP_INTEGER4, 1, 0, 100000-1);
218  */
219 
220  pips_debug(1, "begin\n");
221 
222  FOREACH(ENTITY, e, referenced_entities)
223  {
225  {
226  pips_debug(2,"build_call_STEP_init_regionArray entity %s\n", entity_name(e));
227  init_block = CONS(STATEMENT, build_call_STEP_init_regionArray(e), init_block);
228  }
229  }
230  insert_statement(before, make_block_statement(gen_nreverse(init_block)), false);
231 
232  pips_debug(1, "end\n");
233 }
234 
235 /*
236  Parameters declaration.
237 */
238 
239 /*
240  Macros for constants specific to STEP runtime API are defined in step_common.h.
241  step_common.h is included in generated files.
242  Macros must not be locally declared.
243 */
244 
246 
248 {
251 
253 }
254 
256 {
258  return;
259 
260  /* reinitialisation du type sinon, la recompilation echoue */
262  {
264  {
271  }
272  }
274 }
275 
278 {
281 
283 }
284 
286 {
287  entity e;
288  string name = strdup(name_);
289 
291  {
292  /* Fortran
293  PARAMETER (TEST = expr)
294  */
296  pips_assert("not null", e != NULL);
297  pips_assert("entity defined", !entity_undefined_p(e));
298 
300  {
302  if(expression_undefined_p(expr))
303  e = MakeParameter(e, int_to_expression(0)); // a default value
304  else
305  e = MakeParameter(e, expr);
306  }
307  pips_assert("symbolic", entity_symbolic_p(e));
308  set_RT_add_local(e);
309  }
310  else
311  {
312  /* C
313  const int TEST=1
314 
315  DT74 "TOP-LEVEL:TEST"T77 2 T80 T31 0 4 )()(T63 0 U))))T70 1 T64 R74 "TOP-LEVEL:TOP-LEVEL" R74 "TOP-LEVEL:*STATIC*" 0 ()))T79 5 T44 T73 2 T33 R74 "TOP-LEVEL:1"
316 
317  T77: type T80: variable
318  T31: basic 0: int
319  T63: qualifier 0: const
320  T70: storage 1: ram T64: ram
321  T79: value 5: expression T44:Expression T73: syntax 2: call T33:call R74: entity"TOP-LEVEL:1"
322  */
323 
325  e = FindOrCreateEntity(cu, name);
326  pips_assert("not null", e != NULL);
327  pips_assert("entity defined", !entity_undefined_p(e));
328 
330  {
335  if(expression_undefined_p(expr))
336  entity_initial(e) = make_value_expression(int_to_expression(0)); // a default value
337  else
341  }
343  }
344  free(name);
345  return e;
346 }
347 
349 {
351 }
352 
354 {
356 }
357 
358 //######################################################
359 expression step_function(string name, list args)
360 {
362  pips_assert("boostrap defined", !entity_undefined_p(e));
363  pips_assert("functional", type_functional_p(entity_type(e)));
364  return make_call_expression(e, args);
365 }
366 
367 //######################################################
368 /*
369  Pour declarations de tableaux/variables d'entier
370 */
371 /*
372  liste contenant l'ensemble des tableaux/variables nécessaires à l'utilisation de l'API de STEP et devant être déclarer en temps que variables locales
373 */
375 
377 {
379  {
381  }
382 
384 }
385 
386 static entity step_local_RT_Integer(int size_of_integer, entity mpi_module, string name_, list dims)
387 {
388  pips_debug(1, "begin mpi_module = %s, name_ = %s\n", entity_name(mpi_module), name_);
389  string name = strdup(name_);
390  entity e = FindOrCreateEntity(entity_user_name(mpi_module), name);
391  pips_assert("not null", e != NULL);
392  pips_assert("entity defined", !entity_undefined_p(e));
393 
395  {
396  pips_debug(2, "create entity VERIFIER CE MESSAGE\n");
397 
399  entity_type(e) = MakeTypeVariable(make_basic_int(size_of_integer), dims);
402  if(mpi_module != get_current_module_entity())
404  }
405  else
406  pips_debug(2, "entity already exists\n");
407 
408  pips_assert("variable", entity_variable_p(e));
409  free(name);
410 
411  set_RT_add_local(e);
412 
413  pips_debug(1, "end\n");
414  return e;
415 }
416 
417 /*
418  For each module and array, creation of an array entity for SEND (and RECV) regions
419 
420  STEP_SR|RR_Array[STEP_MAX_NB_LOOPSLICES][NBDIMS][2]
421 
422  STEP_SR_d[1][STEP_INDEX_SLICE_UP]
423  STEP_RR_a[STEP_MAX_NB_LOOPSLICES][1][STEP_INDEX_SLICE_UP]
424  STEP_SR_d[STEP_MAX_NB_LOOPSLICES][1][STEP_INDEX_SLICE_UP]
425  STEP_SR_c[STEP_MAX_NB_LOOPSLICES][2][STEP_INDEX_SLICE_UP]
426 
427 */
428 entity step_local_regionArray(entity module, entity array, string region_array_name, expression expr_nb_region)
429 {
430  pips_debug(1, "begin module = %s, array = %s, region_array_name = %s, expr_nb_region = %p\n", entity_name(module), entity_name(array), region_array_name, expr_nb_region);
431 
432  bool is_fortran = fortran_module_p(get_current_module_entity());
433  string name = strdup(region_array_name);
434  list dims = NIL;
435  if(is_fortran)
436  {
438  if(!expression_undefined_p(expr_nb_region))
439  dims = CONS(DIMENSION,
441  expr_nb_region, NIL),
442  dims);
443  dimension bounds =
446  NIL);
447  dims = CONS(DIMENSION, bounds, CONS(DIMENSION, dim_array, dims));
448  }
449  else
450  {
451  dimension bounds =
455  int_to_expression(1)),
456  NIL);
457  dims = CONS(DIMENSION, bounds, dims);
458 
459  dimension dim_array =
463  int_to_expression(1)),
464  NIL);
465  dims = CONS(DIMENSION, dim_array, dims);
466 
467  if(!expression_undefined_p(expr_nb_region))
468  dims = CONS(DIMENSION,
471  expr_nb_region,
472  int_to_expression(1)),
473  NIL),
474  dims);
475  }
476 
478  free(name);
479  pips_assert("variable", entity_variable_p(e));
480 
481  pips_debug(1, "end e = %p\n", e);
482  return e;
483 }
484 
485 
487 {
489 }
490 
491 /*
492  Ajout dans la nouvelle fonction MPI de la declaration du tableau
493  contenant les tranches d'indices a traiter par chaque noeud
494 
495  Ce tableau prend comme nom le nom de l'indice de la boucle prefixe par STEP_, suffixe par LOOPSLICES:
496 
497  ex: STEP_I_LOOPSLICES
498 */
500 {
501  list dims =
502  CONS(DIMENSION,
505  NIL),
508  NIL),
509  NIL));
511 }
512 
514 {
516 }
517 
518 /* Que signifie local? */
520 {
521  entity e;
522 
523  pips_debug(3, "begin\n");
524 
526 
527  pips_assert("type_variable_p", type_variable_p(entity_type(e)));
528  pips_assert("entity_scalar_p", entity_scalar_p(e));
529 
530  pips_debug(3, "end entity name = %s (%p)\n", entity_name(e), e);
531  return e;
532 }
533 
535 {
537 }
538 
539 /*
540  Generation de statement
541 */
543 {
544  type t;
545  basic b;
546 
548  t = entity_type(data);
549  pips_assert("check step_type", type_variable_p(t));
551 
552  switch (basic_tag(b))
553  {
554  case is_basic_int:
555  switch (basic_int(b))
556  {
561  default:
562  pips_debug(0, "unexpected basic int for entity %s\n", entity_name(data));
563  pips_user_error("unexpected basic int : %i\n", basic_int(b));
564  }
565  break;
566  case is_basic_float:
567  switch (basic_float(b))
568  {
571  default:
572  pips_debug(0, "unexpected basic float for entity %s\n", entity_name(data));
573  pips_user_error("unexpected basic float : %i\n", basic_float(b));
574  }
575  break;
576  case is_basic_complex:
577  switch (basic_complex(b))
578  {
581  default:
582  pips_debug(0, "unexpected basic complex for entity %s\n", entity_name(data));
583  pips_user_error("unexpected basic complex : %i\n", basic_complex(b));
584  }
585  break;
586  default:
587  pips_debug(0, "unexpected type for entity %s\n", entity_name(data));
588  pips_user_error("unexpected basic type : %i\n", basic_tag(b));
589  break;
590  }
591  return entity_undefined;
592 }
593 
594 /*
595  void step_init_regionArray(void *array, int *type, int *dims, index_t L1, index_t U1,...)
596 
597  Generation of:
598  STEP_INIT_ARRAYREGIONS(a, STEP_INTEGER4, 1, 0, 100000-1);
599 */
601 {
602  pips_debug(1, "begin\n");
603 
604  type t = entity_type(array);
606 
607  expression expr_array = entity_to_expression(array);
609 
610  expression expr_dims = int_to_expression(gen_length(dims));
611 
612  list args = CONS(EXPRESSION, expr_dims,
613  CONS(EXPRESSION, expr_type,
614  CONS(EXPRESSION, expr_array, NIL)));
615 
616  FOREACH(DIMENSION, bounds_d, dims)
617  {
618  if(unbounded_dimension_p(bounds_d))
619  {
620  pips_debug(0, "Unbounded dimension for array : %s\n", entity_name(array));
621  pips_assert("bounded dimension", 0);
622  }
623  expression bounds_lower = copy_expression(dimension_lower(bounds_d));
624  expression bounds_upper = copy_expression(dimension_upper(bounds_d));
625  args = CONS(EXPRESSION, bounds_upper,
626  CONS(EXPRESSION, bounds_lower, args));
627  }
628 
630  pips_debug(1, "end\n");
631  return statmt;
632 }
633 
634 /*
635  Generation of
636  STEP_ALLTOALL_FULL(A, STEP_NBLOCKING_ALG, STEP_TAG_DEFAULT);
637  STEP_REGISTER_ALLTOALL_PARTIAL(A, STEP_NBLOCKING_ALG, STEP_TAG_DEFAULT);
638 
639 */
640 statement build_call_STEP_AllToAll(entity module, entity array, bool is_partial, bool is_interlaced)
641 {
642  statement statmt;
643  string subroutine;
644 
645  if (is_partial)
646  {
647  /* Pourquoi register ? */
648 
649  if(is_interlaced)
651  else
653  }
654  else
655  {
656  /* Full communications */
657  if(is_interlaced)
659  else
660  subroutine=strdup(RT_STEP_alltoall_full);
661  }
662 
663  expression expr_array = entity_to_expression(array);
666 
667 
668  /*
669  list args = CONS(EXPRESSION, expr_array,
670  CONS(EXPRESSION, expr_algorithm,
671  CONS(EXPRESSION, expr_tag, NIL)));
672  statmt = make_call_statement(subroutine, args, entity_undefined, string_undefined);
673  */
674  statmt = call_STEP_subroutine2(subroutine, expr_array, expr_algorithm, expr_tag, NULL);
675 
676  free(subroutine);
677 
678  return statmt;
679 }
680 
682 {
683  if(ENDP(comm_stmt))
685  else
686  {
689  string comment = strdup(concatenate("\nC Communicating data to other nodes",
690  "\nC 3 communication shemes for all-to-all personalized broadcast :",
691  "\nC STEP_NONBLOCKING, STEP_BLOCKING1 and STEP_BLOCKING2.\n",NULL));
693  return block;
694  }
695 }
696 
697 /*
698  Generation of
699  STEP_SET_SENDREGIONS(a, 1, (STEP_ARG *) STEP_SR_a);
700 */
701 statement build_call_STEP_set_sendregions(entity user_array, expression expr_nb_workchunk, entity regions_array, bool is_interlaced, bool is_reduction)
702 {
703  statement statmt;
704  string subroutine;
705 
706  pips_debug(1, "begin\n");
707  expression expr_user_array = entity_to_expression(user_array);
708  expression expr_regions_array = cast_STEP_ARG(entity_to_expression(regions_array), true);
709 
710  if (is_reduction)
712  else if(is_interlaced)
714  else
715  subroutine = strdup(RT_STEP_set_sendregions);
716 
717  /*
718  list args = CONS(EXPRESSION, expr_user_array,
719  CONS(EXPRESSION, expr_nb_workchunk,
720  CONS(EXPRESSION, expr_regions,NIL)));
721 
722  statmt = make_call_statement(subroutine, args, entity_undefined, string_undefined);
723  */
724 
725  statmt = call_STEP_subroutine2(subroutine, expr_user_array, expr_nb_workchunk, expr_regions_array, NULL);
726 
727  free(subroutine);
728  pips_debug(1, "end\n");
729  return statmt;
730 }
731 
732 /*
733  Generation of
734  STEP_SET_RECVREGIONS(a, STEP_COMM_SIZE, (STEP_ARG *) STEP_RR_a);
735 */
736 statement build_call_STEP_set_recvregions(entity user_array, expression expr_nb_workchunk, entity regions_array)
737 {
738  statement statmt;
739 
740  pips_debug(1, "begin\n");
741 
742  expression expr_user_array = entity_to_expression(user_array);
743  expression expr_regions_array = cast_STEP_ARG(entity_to_expression(regions_array), true);
744 
745  statmt = call_STEP_subroutine2(RT_STEP_set_recvregions, expr_user_array, expr_nb_workchunk, expr_regions_array, NULL);
746 
747  /*
748  list args = CONS(EXPRESSION, expr_user_array,
749  CONS(EXPRESSION, expr_nb_workchunk,
750  CONS(EXPRESSION, expr_regions_array, NIL)));
751  statmt = make_call_statement(RT_STEP_set_recvregions, args, entity_undefined, string_undefined);
752  */
753 
754  pips_debug(1, "end\n");
755  return statmt;
756 }
757 
759 {
760  return call_STEP_subroutine2(RT_STEP_flush, NULL);
761 }
762 
763 
764 /*
765 
766  Tentative de fonction se basant sur une liste variable d'arguments
767  exprimés sous forme d'entity.
768 
769  Ne fonctionne pas à cause de range_lower et range_upper disponibles
770  uniquement sous forme d'expressions.
771 
772  Tentative de passage par adresse automatique
773 
774  Ne fonctionne pas parce qu'il n'y a pas de rÚgle automatique
775 
776  Notamment ce n'est pas parce qu'une variable est de type scalaire
777  qu'elle doit être passée par adresse.
778 
779  */
780 
782 {
783  statement statmt;
784  va_list va_args;
785  list args_l = NIL;
786  entity e;
787 
788  pips_debug(1, "name = %s\n", name);
789 
790 
791  va_start (va_args, name);
792  e = va_arg(va_args, entity);
793  while (e != NULL) {
794  expression expr;
795 
796  expr = entity_to_expression(e);
797 
801 
802  args_l = CONS (EXPRESSION, expr, args_l);
803  e = va_arg(va_args, entity);
804  }
805  va_end (va_args);
806 
808 
809  STEP_DEBUG_STATEMENT(3, "call_STEP_subroutine2", statmt);
810 
811  pips_debug(1, "statmt = %p\n", statmt);
812  return statmt;
813 }
814 
815 
816 /*
817  call_STEP_subroutine2(string name, list of expressions representing arguments of the call )
818  */
820 {
821  statement statmt;
822  va_list va_args;
823  list args_l = NIL;
824  expression expr;
825 
826  pips_debug(1, "name = %s\n", name);
827 
828 
829  va_start (va_args, name);
830  expr = va_arg(va_args, expression);
831  while (expr != NULL) {
832  args_l = CONS (EXPRESSION, expr, args_l);
833  expr = va_arg(va_args, expression);
834  }
835  va_end (va_args);
836 
838 
839  STEP_DEBUG_STATEMENT(3, "call_STEP_subroutine2", statmt);
840 
841  pips_debug(1, "statmt = %p\n", statmt);
842  return statmt;
843 }
844 
846 {
847  entity step_symbolic_type;
848  pips_debug(1, "begin\n");
849 
850  pips_assert("undefined entity", !entity_undefined_p(data));
851  step_symbolic_type = step_type(data);
852  pips_assert("defined symbolic type", !entity_undefined_p(step_symbolic_type));
853 
854  pips_debug(1, "end\n");
855 }
856 
858 {
859  statement statmt;
860 
861  pips_debug(1, "name = %s, arg = %p\n", name, args);
863  {
864  entity step_symbolic_type = step_type(data);
865  pips_assert("defined symbolic type", !entity_undefined_p(step_symbolic_type));
866  args = gen_nconc(args, CONS(EXPRESSION,entity_to_expression(step_symbolic_type), NIL));
867  }
868 
870 
871 
872  STEP_DEBUG_STATEMENT(3, "call STEP_subroutine", statmt);
873 
874  pips_debug(1, "statmt = %p\n", statmt);
875  return statmt;
876 }
877 
878 
879 
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
Definition: 3dnow.h:3
instruction make_instruction_loop(loop _field_)
Definition: ri.c:1175
basic make_basic_typedef(entity _field_)
Definition: ri.c:185
value make_value_expression(expression _field_)
Definition: ri.c:2850
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
Definition: ri.c:1301
storage make_storage_rom(void)
Definition: ri.c:2285
basic make_basic_int(intptr_t _field_)
Definition: ri.c:158
ram make_ram(entity a1, entity a2, intptr_t a3, list a4)
Definition: ri.c:1999
basic make_basic_pointer(type _field_)
Definition: ri.c:179
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
dimension make_dimension(expression a1, expression a2, list a3)
Definition: ri.c:565
execution make_execution_sequential(void)
Definition: ri.c:841
variable make_variable(basic a1, list a2, list a3)
Definition: ri.c:2895
void free_storage(storage p)
Definition: ri.c:2231
void free_type(type p)
Definition: ri.c:2658
storage make_storage_ram(ram _field_)
Definition: ri.c:2279
qualifier make_qualifier_const(void)
Definition: ri.c:1924
type make_type(enum type_utype tag, void *val)
Definition: ri.c:2706
range make_range(expression a1, expression a2, expression a3)
Definition: ri.c:2041
void free_value(value p)
Definition: ri.c:2787
#define STEP_INTEGER2_NAME
Definition: STEP_name.h:29
#define RT_STEP_get_rank
Definition: STEP_name.h:68
#define RT_STEP_get_loopbounds
Definition: STEP_name.h:67
#define STEP_REAL4_NAME
Definition: STEP_name.h:43
#define STEP_LOOPSLICES_NAME(index)
Definition: STEP_name.h:10
#define STEP_COMPLEX16_NAME
Definition: STEP_name.h:20
#define STEP_COMPLEX8_NAME
Definition: STEP_name.h:21
#define STEP_TAG_DEFAULT_NAME
Definition: STEP_name.h:48
#define STEP_MAX_NB_LOOPSLICES_NAME
Definition: STEP_name.h:34
#define STEP_INTEGER1_NAME
Definition: STEP_name.h:28
#define STEP_BOUNDS_UP(index)
Definition: STEP_name.h:9
#define STEP_SLICE_INDEX_NAME
Definition: STEP_name.h:5
#define RT_STEP_set_sendregions
Definition: STEP_name.h:78
#define STEP_COMM_RANK_NAME
Definition: STEP_name.h:16
#define RT_STEP_set_recvregions
Definition: STEP_name.h:76
#define RT_STEP_compute_loopslices
Definition: STEP_name.h:61
#define RT_STEP_set_interlaced_sendregions
Definition: STEP_name.h:75
#define STEP_REAL8_NAME
Definition: STEP_name.h:44
#define RT_STEP_set_reduction_sendregions
Definition: STEP_name.h:77
#define RT_STEP_register_alltoall_partial
Definition: STEP_name.h:74
#define RT_STEP_alltoall_full_interlaced
Runtime MACRO (end)
Definition: STEP_name.h:55
#define STEP_NBLOCKING_ALG_NAME
Definition: STEP_name.h:37
#define RT_STEP_alltoall_partial_interlaced
Definition: STEP_name.h:57
#define STEP_INDEX_SLICE_LOW_NAME
Definition: STEP_name.h:26
#define RT_STEP_flush
Definition: STEP_name.h:65
#define STEP_INDEX_SLICE_UP_NAME
Definition: STEP_name.h:27
#define STEP_INTEGER8_NAME
Definition: STEP_name.h:31
#define STEP_INTEGER4_NAME
Definition: STEP_name.h:30
#define STEP_BOUNDS_LOW(index)
Definition: STEP_name.h:8
#define STEP_COMM_SIZE_NAME
In Runtime/step/STEP.h.
Definition: STEP_name.h:15
#define RT_STEP_init_arrayregions
Definition: STEP_name.h:69
#define RT_STEP_get_commsize
Definition: STEP_name.h:66
#define RT_STEP_alltoall_full
Definition: STEP_name.h:56
#define RT_STEP_construct_end
Definition: STEP_name.h:63
#define RT_STEP_construct_begin
Definition: STEP_name.h:62
entity get_top_level_entity(void)
Definition: util.c:152
void put_new_typedef(const char *)
This function is used by libraries "step"* and "task_parallelization".
Definition: util.c:1078
static char * directive_txt
statement build_call_STEP_set_recvregions(entity user_array, expression expr_nb_workchunk, entity regions_array)
Definition: compile_RT.c:736
statement generate_call_get_rank(entity new_module)
Definition: compile_RT.c:161
expression step_symbolic_expression(string name, entity module)
Definition: compile_RT.c:353
entity step_parameter(string name_, entity module, expression expr)
Definition: compile_RT.c:285
void generate_call_flush(statement *stepalltoall_stmt)
Definition: compile_RT.c:85
statement build_call_STEP_init_regionArray(entity array)
Definition: compile_RT.c:600
void step_RT_set_local_declarations(entity module, statement body)
Definition: compile_RT.c:376
entity step_local_regionArray(entity module, entity array, string region_array_name, expression expr_nb_region)
Definition: compile_RT.c:428
static void step_add_created_symbolic(entity e)
Definition: compile_RT.c:277
statement call_STEP_subroutine3(string name,...)
Definition: compile_RT.c:781
void check_entity_step_type(entity data)
Definition: compile_RT.c:845
void generate_call_construct_begin_construct_end(entity new_module, step_directive drt, statement mpi_begin_stmt, statement mpi_end_stmt)
Definition: compile_RT.c:60
entity get_entity_step_commsize(entity module)
Que signifie local?
Definition: compile_RT.c:519
static expression cast_STEP_ARG(expression expr, bool ptr)
Definition: compile_RT.c:40
statement build_call_STEP_WaitAll(list comm_stmt)
Definition: compile_RT.c:681
#define STEP_RT_LOOP_INDEX_INTEGER
Definition: compile_RT.c:23
expression get_expression_addr(expression expr)
compile_RT.c
Definition: compile_RT.c:27
statement generate_call_get_commsize(entity new_module)
Definition: compile_RT.c:193
#define STEP_RT_ARRAY_INDEX_INTEGER
Definition: compile_RT.c:22
void generate_call_get_workchunk_loopbounds(entity mpi_module, loop loop_stmt, statement *compute_regions_stmt)
Definition: compile_RT.c:119
static entity step_local_RT_Integer(int size_of_integer, entity mpi_module, string name_, list dims)
Definition: compile_RT.c:386
void set_RT_add_local(entity e)
Definition: compile_RT.c:247
statement build_call_STEP_set_sendregions(entity user_array, expression expr_nb_workchunk, entity regions_array, bool is_interlaced, bool is_reduction)
Definition: compile_RT.c:701
#define STEP_RT_SYMBOLIC_INTEGER
Definition: compile_RT.c:21
set step_created_entity
Definition: compile_RT.c:245
statement call_STEP_subroutine2(string name,...)
Definition: compile_RT.c:819
statement generate_call_get_rank_loopbounds(entity new_module, loop loop_stmt)
Definition: compile_RT.c:138
set step_created_symbolic
Definition: compile_RT.c:276
entity step_symbolic(string name, entity module)
Definition: compile_RT.c:348
statement build_call_STEP_flush()
Definition: compile_RT.c:758
statement call_STEP_subroutine(string name, list args, entity data)
Definition: compile_RT.c:857
void generate_call_init_regionArray(list referenced_entities, statement before, statement __attribute__((unused)) after)
Definition: compile_RT.c:210
entity step_local_slice_index(entity module)
Definition: compile_RT.c:486
entity step_local_loop_index(entity module, string name)
Definition: compile_RT.c:534
void step_RT_clean_local()
Definition: compile_RT.c:255
entity step_local_loopSlices(entity module, entity i)
Definition: compile_RT.c:499
entity get_entity_step_rank(entity module)
Definition: compile_RT.c:513
statement build_call_STEP_AllToAll(entity module, entity array, bool is_partial, bool is_interlaced)
Definition: compile_RT.c:640
void generate_loop_workchunk(entity mpi_module, statement *compute_regions_stmt)
Definition: compile_RT.c:101
expression step_function(string name, list args)
Definition: compile_RT.c:359
entity step_type(entity data)
Definition: compile_RT.c:542
static list local_declaration
Definition: compile_RT.c:374
statement generate_call_compute_loopslices(entity new_module, loop loop_stmt)
Definition: compile_RT.c:176
entity MakeConstant(string name, tag bt)
Make a Fortran constant.
Definition: constant.c:351
string compilation_unit_of_module(const char *)
The output is undefined if the module is referenced but not defined in the workspace,...
Definition: module.c:350
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
Definition: freia_spoc.c:52
void free(void *)
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
Definition: statement.c:597
statement make_empty_block_statement(void)
Build an empty statement (block/sequence)
Definition: statement.c:625
const char * get_current_module_name(void)
Get the name of the current module.
Definition: static.c:121
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#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 FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
list statement_block(statement)
Get the list of block statements of a statement sequence.
Definition: statement.c:1338
void put_a_comment_on_a_statement(statement, string)
Similar to try_to_put_a_comment_on_a_statement() but insert a CONTINUE to put the comment on it if th...
Definition: statement.c:1863
statement make_call_statement(string, list, entity, string)
This function is limited to intrinsics calls...
Definition: statement.c:1274
void insert_statement(statement, statement, bool)
This is the normal entry point.
Definition: statement.c:2570
statement make_continue_statement(entity)
Definition: statement.c:953
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define pips_user_error
Definition: misc-local.h:147
static entity rank
#define DYNAMIC_AREA_LOCAL_NAME
Definition: naming-local.h:69
#define TYPEDEF_PREFIX
Definition: naming-local.h:62
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
Definition: naming-local.h:101
#define STATIC_AREA_LOCAL_NAME
Definition: naming-local.h:70
#define MODULE_SEP_STRING
Definition: naming-local.h:30
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
#define set_undefined
Definition: newgen_set.h:48
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
Definition: newgen_set.h:78
set set_clear(set)
Assign the empty set to s s := {}.
Definition: set.c:326
@ set_pointer
Definition: newgen_set.h:44
#define set_undefined_p(s)
Definition: newgen_set.h:49
set set_make(set_type)
Create an empty set of any type but hash_private.
Definition: set.c:102
set set_add_element(set, const set, const void *)
Definition: set.c:152
#define string_undefined
Definition: newgen_types.h:40
#define string_undefined_p(s)
Definition: newgen_types.h:41
static char * module
Definition: pips.c:74
#define PLUS_OPERATOR_NAME
#define entity_symbolic_p(e)
#define ADDRESS_OF_OPERATOR_NAME
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
#define MINUS_C_OPERATOR_NAME
@ ABSTRACT_LOCATION
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
Definition: entity.c:487
entity FindOrCreateEntity(const char *package, const char *local_name)
Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a functi...
Definition: entity.c:1586
entity entity_empty_label(void)
Definition: entity.c:1105
bool fortran_module_p(entity m)
Test if a module is in Fortran.
Definition: entity.c:2799
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
Definition: entity.c:1311
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
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
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
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 make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
Definition: expression.c:2012
bool unbounded_dimension_p(dimension dim)
bool unbounded_dimension_p(dim) input : a dimension of an array entity.
Definition: expression.c:1130
expression MakeCastExpression(type t, expression e)
Definition: expression.c:3911
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
Definition: expression.c:342
void AddLocalEntityToDeclarations(entity, entity, statement)
Add the variable entity e to the list of variables of the function module.
Definition: variable.c:233
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
Definition: variable.c:1113
int add_C_variable_to_area(entity, entity)
Definition: variable.c:1381
int NumberOfDimension(entity)
Definition: size.c:588
int add_variable_to_area(entity, entity)
Definition: variable.c:1376
type MakeTypeVariable(basic, cons *)
BEGIN_EOLE.
Definition: type.c:116
#define type_functional_p(x)
Definition: ri.h:2950
#define value_undefined
Definition: ri.h:3016
@ is_basic_string
Definition: ri.h:576
@ is_basic_float
Definition: ri.h:572
@ is_basic_int
Definition: ri.h:571
@ is_basic_complex
Definition: ri.h:575
#define QUALIFIER(x)
QUALIFIER.
Definition: ri.h:2106
#define basic_int(x)
Definition: ri.h:616
#define range_upper(x)
Definition: ri.h:2290
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define dimension_lower(x)
Definition: ri.h:980
#define basic_tag(x)
Definition: ri.h:613
#define type_variable(x)
Definition: ri.h:2949
#define entity_storage(x)
Definition: ri.h:2794
#define range_increment(x)
Definition: ri.h:2292
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define type_undefined_p(x)
Definition: ri.h:2884
#define entity_undefined_p(x)
Definition: ri.h:2762
#define entity_undefined
Definition: ri.h:2761
#define expression_undefined
Definition: ri.h:1223
#define entity_name(x)
Definition: ri.h:2790
#define dimension_upper(x)
Definition: ri.h:982
#define basic_float(x)
Definition: ri.h:619
#define expression_undefined_p(x)
Definition: ri.h:1224
#define range_lower(x)
Definition: ri.h:2288
#define variable_dimensions(x)
Definition: ri.h:3122
#define type_undefined
Definition: ri.h:2883
#define loop_range(x)
Definition: ri.h:1642
#define basic_complex(x)
Definition: ri.h:628
#define entity_kind(x)
Definition: ri.h:2798
@ is_type_variable
Definition: ri.h:2900
#define entity_type(x)
Definition: ri.h:2792
#define type_variable_p(x)
Definition: ri.h:2947
#define storage_undefined_p(x)
Definition: ri.h:2477
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
#define loop_index(x)
Definition: ri.h:1640
#define variable_basic(x)
Definition: ri.h:3120
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
#define storage_undefined
Definition: ri.h:2476
#define entity_initial(x)
Definition: ri.h:2796
char * strdup()
static entity array
#define STEP_DEBUG_STATEMENT(D, W, S)
Definition: defines-local.h:42
void get_step_directive_name(step_directive drt, string *directive_txt)
Warning! Do not modify this file that is automatically generated!
Definition: directives.c:18
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Definition: statement.c:54
entity MakeParameter(entity e, expression x)
lint
Definition: expression.c:52
struct block block
void AddEntityToModuleCompilationUnit(entity e, entity module)
Definition: module.c:301