PIPS
step.h File Reference
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "step_private.h"
#include "effects.h"
+ Include dependency graph for step.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void get_step_directive_name (step_directive, string *)
 Warning! Do not modify this file that is automatically generated! More...
 
void step_directive_type_print (step_directive)
 
void step_directives_print (void)
 
void step_directives_init (bool)
 
void step_directives_reset (void)
 
void step_directives_save (void)
 
step_directive step_directives_load (statement)
 
bool step_directives_bound_p (statement)
 
void step_directives_store (statement, step_directive)
 
bool step_directive_to_strings (step_directive, bool, string *, string *)
 
statement step_directive_basic_workchunk (step_directive)
 
list step_directive_basic_workchunk_index (step_directive)
 
void step_directive_print (step_directive)
 
bool step_private_p (statement, entity)
 
bool step_interlaced_p (effect)
 analyse.c More...
 
bool step_partial_p (effect)
 
bool step_analysed_module_p (const char *)
 
void load_step_comm (void)
 
void reset_step_comm (void)
 
void store_step_comm (void)
 
void debug_print_effects_list (list, string)
 
bool step_analyse_init (const string)
 
effect rectangularization_region (effect)
 
bool step_analyse (const char *)
 
expression get_expression_addr (expression)
 compile_RT.c More...
 
void generate_call_construct_begin_construct_end (entity, step_directive, statement, statement)
 
void generate_call_flush (statement *)
 
void generate_loop_workchunk (entity, statement *)
 
void generate_call_get_workchunk_loopbounds (entity, loop, statement *)
 
statement generate_call_get_rank_loopbounds (entity, loop)
 
statement generate_call_get_rank (entity)
 
statement generate_call_compute_loopslices (entity, loop)
 
statement generate_call_get_commsize (entity)
 
void generate_call_init_regionArray (list, statement, statement)
 
void set_RT_add_local (entity)
 
void step_RT_clean_local (void)
 
entity step_parameter (string, entity, expression)
 
entity step_symbolic (string, entity)
 
expression step_symbolic_expression (string, entity)
 
expression step_function (string, list)
 
void step_RT_set_local_declarations (entity, statement)
 
entity step_local_regionArray (entity, entity, string, expression)
 
entity step_local_slice_index (entity)
 
entity step_local_loopSlices (entity, entity)
 
entity get_entity_step_rank (entity)
 
entity get_entity_step_commsize (entity)
 Que signifie local? More...
 
entity step_local_loop_index (entity, string)
 
entity step_type (entity data)
 
statement build_call_STEP_init_regionArray (entity)
 
statement build_call_STEP_AllToAll (entity, entity, bool, bool)
 
statement build_call_STEP_WaitAll (list)
 
statement build_call_STEP_set_sendregions (entity, expression, entity, bool, bool)
 
statement build_call_STEP_set_recvregions (entity, expression, entity)
 
statement build_call_STEP_flush (void)
 
statement call_STEP_subroutine3 (string,...)
 
statement call_STEP_subroutine2 (string,...)
 
void check_entity_step_type (entity data)
 
statement call_STEP_subroutine (string, list, entity data)
 
statement compile_mpi (statement, string, step_directive, int)
 compile_mpi.c More...
 
void compile_regions (entity, list, bool, loop, list, set[4], statement, statement)
 compile_regions.c More...
 
statement compile_omp (statement, step_directive)
 compile.c More...
 
void add_omp_guard (statement *)
 
void step_compile_analysed_module (const char *, string)
 
void step_compile_generated_module (const char *, string)
 generated source: no analyse and no compilation necessary. More...
 
bool step_compile (const char *)
 
void set_current_transform (int)
 parser.c More...
 
void insert_optional_pragma (int type)
 
entity entity_from_user_name (string)
 
void remove_old_pragma (void)
 
step_directive begin_omp_construct (int type, string)
 
step_directive end_omp_construct (int type)
 
bool step_parser (const char *)
 
bool step_install (const string)
 install.c More...
 
int comment2pragmalex (void)
 
void comment2pragmarestart (FILE *)
 
void comment2pragmapop_buffer_state (void)
 
int comment2pragmaget_lineno (void)
 
FILE * comment2pragmaget_in (void)
 
FILE * comment2pragmaget_out (void)
 
int comment2pragmaget_leng (void)
 
char * comment2pragmaget_text (void)
 
void comment2pragmaset_lineno (int)
 
void comment2pragmaset_in (FILE *)
 
void comment2pragmaset_out (FILE *)
 
int comment2pragmaget_debug (void)
 
void comment2pragmaset_debug (int)
 
int comment2pragmalex_destroy (void)
 
void * comment2pragmaalloc (yy_size_t)
 
void * comment2pragmarealloc (void *, yy_size_t)
 
void comment2pragmafree (void *)
 
void step_comment2pragma_handle (statement)
 
int step_lexerlex (void)
 
void step_lexerrestart (FILE *)
 
void step_lexerpop_buffer_state (void)
 
int step_lexerget_lineno (void)
 
FILE * step_lexerget_in (void)
 
FILE * step_lexerget_out (void)
 
int step_lexerget_leng (void)
 
char * step_lexerget_text (void)
 
void step_lexerset_lineno (int)
 
void step_lexerset_in (FILE *)
 
void step_lexerset_out (FILE *)
 
int step_lexerget_debug (void)
 
void step_lexerset_debug (int)
 
int step_lexerlex_destroy (void)
 
void * step_lexeralloc (yy_size_t)
 
void * step_lexerrealloc (void *, yy_size_t)
 
void step_lexerfree (void *)
 
void step_lexererror (const char *)
 step_bison_parser.c More...
 
int step_lexerparse (void)
 
void step_bison_parse (pragma, statement)
 

Variables

set step_created_entity
 
set step_created_symbolic
 
int comment2pragmaleng
 comment2pragma.c More...
 
FILE * comment2pragmain
 
FILE * comment2pragmaout
 
int comment2pragmalineno
 
int comment2pragma_flex_debug
 
char * comment2pragmatext
 
int step_lexerleng
 step_lexer.c More...
 
FILE * step_lexerin
 
FILE * step_lexerout
 
int step_lexerlineno
 
int step_lexer_flex_debug
 
char * step_lexertext
 
int step_lexerdebug
 
int step_lexerchar
 
int step_lexernerrs
 

Function Documentation

◆ add_omp_guard()

void add_omp_guard ( statement block)
Parameters
blocklock

Definition at line 62 of file compile.c.

63 {
65  pips_debug(1, "begin\n");
66 
68  {
69  statement barrier_stmt = make_empty_block_statement();
72  compile_omp(barrier_stmt, barrier_guard);
73  compile_omp(*block, master_guard);
74  free_step_directive(barrier_guard);
75  free_step_directive(master_guard);
76 
78  }
79 
80  pips_debug(1, "end\n");
81 }
void free_step_directive(step_directive p)
Definition: step_private.c:372
step_directive make_step_directive(intptr_t a1, statement a2, list a3)
Definition: step_private.c:405
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
#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
bool empty_statement_or_continue_p(statement)
Return true if the statement is an empty instruction block or a continue or a recursive combination o...
Definition: statement.c:474
#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 statement_block_p(stat)
#define statement_undefined_p(x)
Definition: ri.h:2420
#define statement_undefined
Definition: ri.h:2419
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
statement compile_omp(statement stmt, step_directive d)
compile.c
Definition: compile.c:32
#define STEP_MASTER
Definition: step_common.h:46
#define STEP_BARRIER
Definition: step_common.h:48

References compile_omp(), CONS, empty_statement_or_continue_p(), free_step_directive(), make_block_statement(), make_empty_block_statement(), make_step_directive(), NIL, pips_assert, pips_debug, STATEMENT, statement_block_p, statement_undefined, statement_undefined_p, STEP_BARRIER, and STEP_MASTER.

Referenced by compile_body().

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

◆ begin_omp_construct()

step_directive begin_omp_construct ( int  type,
string  s 
)

In C, these OpenMP pragmas are already supported by blocks: no block conversion needed

Definition at line 159 of file parser.c.

160 {
161  statement directive_stmt;
162 
163  pips_debug(1,"begin type = %d, str = %s\n", type, s);
164 
165  directive_stmt = current_statement;
166 
168  {
169  switch(type)
170  {
171  case STEP_DO:
172  case STEP_PARALLEL_DO:
173  pips_assert("loop statement", statement_loop_p(directive_stmt)||statement_forloop_p(directive_stmt));
175  _FALLTHROUGH_; // is that so?
176  case STEP_PARALLEL:
177  case STEP_MASTER:
178  case STEP_SINGLE:
179  case STEP_BARRIER:
180  directive_stmt = make_empty_block_statement();
181  break;
182  case STEP_THREADPRIVATE:
183  directive_stmt = make_empty_block_statement();
184  break;
185  default:
186  pips_user_error("unknown directive type %d\n", type);
187  break;
188  }
189  }
191  {
192  switch(type)
193  {
194  case STEP_DO:
195  case STEP_PARALLEL_DO:
196  {
197  statement new_stmt;
198  pips_assert("loop statement", statement_loop_p(directive_stmt)||statement_forloop_p(directive_stmt));
199  pips_debug(2,"Block conversion (C)\n");
200 
201  new_stmt = instruction_to_statement(statement_instruction(directive_stmt));
202 
203  move_statement_attributes(directive_stmt, new_stmt);
204  statement_label(directive_stmt) = entity_empty_label();
205  statement_comments(directive_stmt) = empty_comments;
206  statement_declarations(directive_stmt) = NIL;
207  statement_decls_text(directive_stmt) = NULL;
208  statement_extensions(directive_stmt) = empty_extensions();
209  statement_instruction(directive_stmt) = make_instruction_block(CONS(STATEMENT, new_stmt, NIL));
210  }
211  case STEP_PARALLEL:
212  case STEP_MASTER:
213  case STEP_SINGLE:
214  /* In C, these OpenMP pragmas are already supported by blocks: no block conversion needed */
215  break;
216  case STEP_BARRIER:
217  directive_stmt = make_empty_block_statement();
218  break;
219  case STEP_THREADPRIVATE:
220  directive_stmt = make_empty_block_statement();
221  break;
222  default:
223  pips_user_error("unknown directive type %d\n", type);
224  break;
225  }
226  }
227  else
228  pips_user_error("language not supported");
229 
230  step_directive drt = new_step_directive(directive_stmt, type, s);
231 
233  {
234  step_blocks_push(statement_sequence(directive_stmt));
235  }
236 
237  pips_debug(1,"end drt = %p\n", drt);
238  return drt;
239 }
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
Definition: statement.c:597
void move_statement_attributes(statement, statement)
Move all the attributes from one statement to another one.
Definition: statement.c:657
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
Definition: instruction.c:106
sequence statement_sequence(statement)
Get the sequence of a statement sequence.
Definition: statement.c:1328
bool statement_forloop_p(statement)
Definition: statement.c:374
bool statement_loop_p(statement)
Definition: statement.c:349
#define _FALLTHROUGH_
Definition: misc-local.h:238
#define pips_user_error
Definition: misc-local.h:147
#define empty_comments
Empty comments (i.e.
bool c_module_p(entity m)
Test if a module "m" is written in C.
Definition: entity.c:2777
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
extensions empty_extensions(void)
extension.c
Definition: extension.c:43
#define statement_label(x)
Definition: ri.h:2450
#define statement_extensions(x)
Definition: ri.h:2464
#define statement_declarations(x)
Definition: ri.h:2460
#define statement_instruction(x)
Definition: ri.h:2458
#define statement_comments(x)
Definition: ri.h:2456
#define statement_decls_text(x)
Definition: ri.h:2462
static step_directive new_step_directive(statement directive_stmt, int type, string s)
Functions used for gen_multi_recurse.
Definition: parser.c:322
static statement current_statement
Definition: parser.c:11
void insert_optional_pragma(int type)
Definition: parser.c:46
#define STEP_THREADPRIVATE
Definition: step_common.h:50
#define STEP_SINGLE
Definition: step_common.h:49
#define STEP_PARALLEL
Handled construction.
Definition: step_common.h:43
#define STEP_PARALLEL_DO
Definition: step_common.h:45
#define STEP_DO
Definition: step_common.h:44

◆ build_call_STEP_AllToAll()

statement build_call_STEP_AllToAll ( entity  module,
entity  array,
bool  is_partial,
bool  is_interlaced 
)

Pourquoi register ?

Full communications

Parameters
moduleodule
arrayrray
is_partials_partial
is_interlaceds_interlaced

Definition at line 640 of file compile_RT.c.

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 }
#define STEP_TAG_DEFAULT_NAME
Definition: STEP_name.h:48
#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 RT_STEP_alltoall_full
Definition: STEP_name.h:56
expression step_symbolic_expression(string name, entity module)
Definition: compile_RT.c:353
statement call_STEP_subroutine2(string name,...)
Definition: compile_RT.c:819
void free(void *)
static char * module
Definition: pips.c:74
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
char * strdup()
static entity array

References array, call_STEP_subroutine2(), entity_to_expression(), free(), module, RT_STEP_alltoall_full, RT_STEP_alltoall_full_interlaced, RT_STEP_alltoall_partial_interlaced, RT_STEP_register_alltoall_partial, STEP_NBLOCKING_ALG_NAME, step_symbolic_expression(), STEP_TAG_DEFAULT_NAME, and strdup().

Referenced by generate_call_stepalltoall().

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

◆ build_call_STEP_flush()

statement build_call_STEP_flush ( void  )

Definition at line 758 of file compile_RT.c.

759 {
760  return call_STEP_subroutine2(RT_STEP_flush, NULL);
761 }
#define RT_STEP_flush
Definition: STEP_name.h:65

References call_STEP_subroutine2(), and RT_STEP_flush.

Referenced by generate_call_flush().

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

◆ build_call_STEP_init_regionArray()

statement build_call_STEP_init_regionArray ( entity  array)
Parameters
arrayrray

Definition at line 600 of file compile_RT.c.

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 }
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
#define RT_STEP_init_arrayregions
Definition: STEP_name.h:69
entity step_type(entity data)
Definition: compile_RT.c:542
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
size_t gen_length(const list l)
Definition: list.c:150
#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
statement make_call_statement(string, list, entity, string)
This function is limited to intrinsics calls...
Definition: statement.c:1274
#define string_undefined
Definition: newgen_types.h:40
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
bool unbounded_dimension_p(dimension dim)
bool unbounded_dimension_p(dim) input : a dimension of an array entity.
Definition: expression.c:1130
#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 entity_undefined
Definition: ri.h:2761
#define entity_name(x)
Definition: ri.h:2790
#define dimension_upper(x)
Definition: ri.h:982
#define variable_dimensions(x)
Definition: ri.h:3122
#define entity_type(x)
Definition: ri.h:2792
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References array, CONS, copy_expression(), DIMENSION, dimension_lower, dimension_upper, entity_name, entity_to_expression(), entity_type, entity_undefined, EXPRESSION, FOREACH, gen_length(), gen_nreverse(), int_to_expression(), make_call_statement(), NIL, pips_assert, pips_debug, RT_STEP_init_arrayregions, step_type(), string_undefined, type_variable, unbounded_dimension_p(), and variable_dimensions.

Referenced by generate_call_init_regionArray().

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

◆ build_call_STEP_set_recvregions()

statement build_call_STEP_set_recvregions ( entity  user_array,
expression  expr_nb_workchunk,
entity  regions_array 
)
Parameters
user_arrayser_array
expr_nb_workchunkxpr_nb_workchunk
regions_arrayegions_array

Definition at line 736 of file compile_RT.c.

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 }
#define RT_STEP_set_recvregions
Definition: STEP_name.h:76
static expression cast_STEP_ARG(expression expr, bool ptr)
Definition: compile_RT.c:40

References call_STEP_subroutine2(), cast_STEP_ARG(), entity_to_expression(), pips_debug, and RT_STEP_set_recvregions.

Referenced by generate_call_set_regionarray().

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

◆ build_call_STEP_set_sendregions()

statement build_call_STEP_set_sendregions ( entity  user_array,
expression  expr_nb_workchunk,
entity  regions_array,
bool  is_interlaced,
bool  is_reduction 
)
Parameters
user_arrayser_array
expr_nb_workchunkxpr_nb_workchunk
regions_arrayegions_array
is_interlaceds_interlaced
is_reductions_reduction

Definition at line 701 of file compile_RT.c.

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 }
#define RT_STEP_set_sendregions
Definition: STEP_name.h:78
#define RT_STEP_set_interlaced_sendregions
Definition: STEP_name.h:75
#define RT_STEP_set_reduction_sendregions
Definition: STEP_name.h:77

References call_STEP_subroutine2(), cast_STEP_ARG(), entity_to_expression(), free(), pips_debug, RT_STEP_set_interlaced_sendregions, RT_STEP_set_reduction_sendregions, RT_STEP_set_sendregions, and strdup().

Referenced by generate_call_set_regionarray().

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

◆ build_call_STEP_WaitAll()

statement build_call_STEP_WaitAll ( list  comm_stmt)
Parameters
comm_stmtomm_stmt

Definition at line 681 of file compile_RT.c.

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 }
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
Definition: freia_spoc.c:52
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
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_continue_statement(entity)
Definition: statement.c:953
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
struct block block

References call_STEP_subroutine2(), comment(), concatenate(), CONS, ENDP, entity_undefined, gen_nconc(), make_block_statement(), make_continue_statement(), NIL, put_a_comment_on_a_statement(), RT_STEP_flush, STATEMENT, and strdup().

+ Here is the call graph for this function:

◆ call_STEP_subroutine()

statement call_STEP_subroutine ( string  name,
list  args,
entity  data 
)
Parameters
nameame
argsrgs

Definition at line 857 of file compile_RT.c.

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 }
#define entity_undefined_p(x)
Definition: ri.h:2762
#define STEP_DEBUG_STATEMENT(D, W, S)
Definition: defines-local.h:42

References CONS, entity_to_expression(), entity_undefined, entity_undefined_p, EXPRESSION, gen_nconc(), make_call_statement(), NIL, pips_assert, pips_debug, STEP_DEBUG_STATEMENT, step_type(), and string_undefined.

+ Here is the call graph for this function:

◆ call_STEP_subroutine2()

statement call_STEP_subroutine2 ( string  name,
  ... 
)
Parameters
nameame

Definition at line 819 of file compile_RT.c.

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 }

References CONS, entity_undefined, EXPRESSION, gen_nreverse(), make_call_statement(), NIL, pips_debug, STEP_DEBUG_STATEMENT, and string_undefined.

Referenced by build_call_STEP_AllToAll(), build_call_STEP_flush(), build_call_STEP_set_recvregions(), build_call_STEP_set_sendregions(), build_call_STEP_WaitAll(), compile_barrier(), compile_master(), compile_reduction(), generate_call_compute_loopslices(), generate_call_construct_begin_construct_end(), generate_call_get_commsize(), generate_call_get_rank(), generate_call_get_rank_loopbounds(), generate_call_get_workchunk_loopbounds(), and step_compile_analysed_module().

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

◆ call_STEP_subroutine3()

statement call_STEP_subroutine3 ( string  name,
  ... 
)
Parameters
nameame

Definition at line 781 of file compile_RT.c.

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 }
#define ADDRESS_OF_OPERATOR_NAME
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
Definition: expression.c:342
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
Definition: variable.c:1113
#define type_variable_p(x)
Definition: ri.h:2947

References ADDRESS_OF_OPERATOR_NAME, CONS, entity_intrinsic(), entity_scalar_p(), entity_to_expression(), entity_type, entity_undefined, EXPRESSION, fortran_module_p(), gen_nreverse(), get_current_module_entity(), make_call_statement(), MakeUnaryCall(), NIL, pips_debug, STEP_DEBUG_STATEMENT, string_undefined, and type_variable_p.

+ Here is the call graph for this function:

◆ check_entity_step_type()

void check_entity_step_type ( entity  data)

Definition at line 845 of file compile_RT.c.

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 }

References entity_undefined_p, pips_assert, pips_debug, and step_type().

Referenced by compile_reduction().

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

◆ comment2pragmaalloc()

void* comment2pragmaalloc ( yy_size_t  )

◆ comment2pragmafree()

void comment2pragmafree ( void *  )

◆ comment2pragmaget_debug()

int comment2pragmaget_debug ( void  )

◆ comment2pragmaget_in()

FILE* comment2pragmaget_in ( void  )

◆ comment2pragmaget_leng()

int comment2pragmaget_leng ( void  )

◆ comment2pragmaget_lineno()

int comment2pragmaget_lineno ( void  )

◆ comment2pragmaget_out()

FILE* comment2pragmaget_out ( void  )

◆ comment2pragmaget_text()

char* comment2pragmaget_text ( void  )

◆ comment2pragmalex()

int comment2pragmalex ( void  )

◆ comment2pragmalex_destroy()

int comment2pragmalex_destroy ( void  )

◆ comment2pragmapop_buffer_state()

void comment2pragmapop_buffer_state ( void  )

◆ comment2pragmarealloc()

void* comment2pragmarealloc ( void *  ,
yy_size_t   
)

◆ comment2pragmarestart()

void comment2pragmarestart ( FILE *  )

◆ comment2pragmaset_debug()

void comment2pragmaset_debug ( int  )

◆ comment2pragmaset_in()

void comment2pragmaset_in ( FILE *  )

◆ comment2pragmaset_lineno()

void comment2pragmaset_lineno ( int  )

◆ comment2pragmaset_out()

void comment2pragmaset_out ( FILE *  )

◆ compile_mpi()

statement compile_mpi ( statement  directive_stmt,
string  new_module_name,
step_directive  drt,
int  transformation 
)

compile_mpi.c

Parameters
directive_stmtirective_stmt
new_module_nameew_module_name
drtrt
transformationransformation

Definition at line 517 of file compile_mpi.c.

518 {
519  pips_debug(1, "begin current module %p : %s\n", get_current_module_entity(), get_current_module_name());
520 
521  list statements_to_outline = make_statement_list(directive_stmt);
523  pips_assert("new_module", !entity_undefined_p(new_module));
524 
525  // Init hash table
526  hash_table entity_to_effective_parameter = outliner_init(new_module, statements_to_outline);
527 
528  // Find referenced entities in statements_to_outline
530  list referenced_entities = outliner_scan(new_module, statements_to_outline, new_body);
531 
532  // Generate the body of the new module
533  statement work_stmt = make_block_statement(gen_copy_seq(statements_to_outline));
534  statement mpi_begin_stmt = make_empty_block_statement();
535  statement mpi_end_stmt = make_empty_block_statement();
536  compile_body(directive_stmt, new_module, drt, transformation, referenced_entities, new_body, mpi_begin_stmt, work_stmt, mpi_end_stmt);
537 
538  // Some entities may be added by region_to_statement. Ensure they will be passed as parameters
539  update_referenced_entities(new_body, &referenced_entities);
540 
541  // Update hash table and build parameters
542  list effective_parameters = NIL, formal_parameters = NIL;
543  outliner_parameters(new_module, new_body, referenced_entities, entity_to_effective_parameter, &effective_parameters, &formal_parameters);
544 
545  // Patch parameters for side effects
547  outliner_patch_parameters(statements_to_outline, referenced_entities, effective_parameters, formal_parameters, new_body, mpi_begin_stmt, mpi_end_stmt);
548 
549  step_RT_set_local_declarations(new_module, new_body);
550 
551  // Source file generation
553  outliner_file(new_module, formal_parameters, &new_body);
555 
557 
558  statement call_stmt = outliner_call(new_module, statements_to_outline, effective_parameters);
559 
560  pips_debug(1, "end\n");
561  return call_stmt;
562 }
list outliner_scan(entity, list, statement)
Definition: outlining.c:555
void outliner_file(entity, list, statement *)
Definition: outlining.c:1138
hash_table outliner_init(entity, list)
Definition: outlining.c:546
statement outliner_call(entity, list, list)
Definition: outlining.c:1235
void outliner_patch_parameters(list, list, list, list, statement, statement, statement)
we need to patch parameters , effective parameters and body in C because parameters are passed by cop...
Definition: outlining.c:809
void outliner_parameters(entity, statement, list, hash_table, list *, list *)
Definition: outlining.c:698
void step_RT_set_local_declarations(entity module, statement body)
Definition: compile_RT.c:376
void step_RT_clean_local()
Definition: compile_RT.c:255
static void update_referenced_entities(statement new_body, list *referenced_entities)
Definition: compile_mpi.c:459
static string step_head_hook(entity __attribute__((unused)) e)
Copyright 2007-2012 Alain Muller, Frederique Silber-Chaussumier.
Definition: compile_mpi.c:20
static void compile_body(statement directive_stmt, entity new_module, step_directive drt, int transformation, list referenced_entities, statement new_body, statement mpi_begin_stmt, statement work_stmt, statement mpi_end_stmt)
Definition: compile_mpi.c:331
const char * get_current_module_name(void)
Get the name of the current module.
Definition: static.c:121
list gen_copy_seq(list l)
Copy a list structure.
Definition: list.c:501
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
Definition: naming-local.h:101
#define MODULE_SEP_STRING
Definition: naming-local.h:30
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
void reset_prettyprinter_head_hook()
Definition: misc.c:3964
void set_prettyprinter_head_hook(string(*f)(entity))
Definition: misc.c:3963
#define make_statement_list(stats...)
easy list constructor
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410

◆ compile_omp()

statement compile_omp ( statement  stmt,
step_directive  d 
)

compile.c

Parameters
stmttmt

Definition at line 32 of file compile.c.

33 {
34  pips_debug(1, "begin\n");
35 
36  string begin_txt, end_txt;
37  bool is_fortran = fortran_module_p(get_current_module_entity());
38  bool is_block_construct = step_directive_to_strings(d, is_fortran, &begin_txt, &end_txt);
39 
40  if(!string_undefined_p(begin_txt))
41  {
42  if(!is_block_construct)
43  {
47  }
48  add_pragma_str_to_statement(stmt, begin_txt, false);
49  }
50 
51  if(!string_undefined_p(end_txt))
52  {
55  add_pragma_str_to_statement(stmt, end_txt, false);
56  }
57 
58  pips_debug(1, "end\n");
59  return stmt;
60 }
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
list statement_block(statement)
Get the list of block statements of a statement sequence.
Definition: statement.c:1338
void insert_statement(statement, statement, bool)
This is the normal entry point.
Definition: statement.c:2570
statement make_plain_continue_statement(void)
Make a simple continue statement to be used as a NOP or ";" in C.
Definition: statement.c:964
#define string_undefined_p(s)
Definition: newgen_types.h:41
statement last_statement(statement)
A simplified version of find_last_statement() located in prettyprint.c and designed to be used within...
Definition: statement.c:168
void add_pragma_str_to_statement(statement st, const char *s, bool copy_flag)
Add a string as a pragma to a statement.
Definition: pragma.c:425
bool step_directive_to_strings(step_directive d, bool is_fortran, string *begin_txt, string *end_txt)
Definition: directives.c:147
Definition: statement.c:54

References add_pragma_str_to_statement(), CAR, ENDP, fortran_module_p(), get_current_module_entity(), insert_statement(), last_statement(), make_plain_continue_statement(), pips_debug, STATEMENT, statement_block(), step_directive_to_strings(), and string_undefined_p.

Referenced by add_omp_guard(), compile_body(), and compile_rewrite().

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

◆ compile_regions()

void compile_regions ( entity  ,
list  ,
bool  ,
loop  ,
list  ,
set  [4],
statement  ,
statement   
)

◆ debug_print_effects_list()

void debug_print_effects_list ( list  l,
string  txt 
)
Parameters
txtxt

Definition at line 334 of file analyse.c.

335 {
336  if(ENDP(l))
337  pips_debug(1, "%s empty\n", txt);
338  else
339  {
340  bool property_prettyprint_scalar_regions = get_bool_property("PRETTYPRINT_SCALAR_REGIONS");
341  set_bool_property("PRETTYPRINT_SCALAR_REGIONS", true);
342 
343  FOREACH(EFFECT, eff, l)
344  {
345  string str_reg = text_to_string(text_rw_array_regions(CONS(EFFECT, eff, NIL)));
346  pips_debug(1, "%s %p : %s\n", txt, eff, str_reg); free(str_reg);
347  }
348  set_bool_property("PRETTYPRINT_SCALAR_REGIONS", property_prettyprint_scalar_regions);
349  }
350 }
text text_rw_array_regions(list)
#define EFFECT(x)
EFFECT.
Definition: effects.h:608
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
void set_bool_property(const char *, bool)
string text_to_string(text t)
SG: moved here from ricedg.
Definition: print.c:239

References CONS, EFFECT, ENDP, FOREACH, free(), get_bool_property(), NIL, pips_debug, set_bool_property(), text_rw_array_regions(), and text_to_string().

Referenced by compute_recv_regions(), compute_send_regions(), step_analyse_CHAINS_DG(), step_print_directives_regions(), step_print_effect_path(), step_translate_and_map_step_regions(), step_update_comm(), and step_update_SUMMARY_SENDRECV_regions().

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

◆ end_omp_construct()

step_directive end_omp_construct ( int  type)

suppression du CONTINUE portant le pragma optionnel dans le futur block

Definition at line 248 of file parser.c.

249 {
250  step_directive drt;
251 
252  pips_debug(1,"begin type = %d\n", type);
253 
256  {
257  switch(type)
258  {
259  case STEP_DO:
260  case STEP_PARALLEL_DO:
261  {
262  sequence current_block;
263  statement last_stmt;
264 
265 
266  current_block = step_blocks_head();
267  last_stmt = STATEMENT(CAR(sequence_statements(current_block)));
268  /* suppression du CONTINUE portant le pragma optionnel dans le futur block */
269  while (empty_statement_or_labelless_continue_p(last_stmt))
270  {
271  pips_debug(2,"POP current_block");
272  POP(sequence_statements(current_block));
273  last_stmt = STATEMENT(CAR(sequence_statements(current_block)));
274  }
275  if(step_directives_bound_p(last_stmt))
276  {
277  drt = step_directives_load(last_stmt);
278  if (step_directive_type(drt) != type)
279  pips_user_error("\nDirective end-loop not well formed\n");
280  else
281  pips_debug(2,"loop directive already closed\n");
282  }
283  else if (!statement_loop_p(last_stmt))
284  pips_user_error("\nDirective end-loop after a no-loop statement\n");
285  }
286  default:
287  break;
288  }
289 
291  {
292  drt = get_current_step_directive(true);
293 
295  pips_user_error("\nDirective not well formed\n");
296 
297  int size = step_blocks_size();
298  sequence new_seq = step_blocks_pop();
299  pips_debug(2,"pop block directive\n");
300  pips_debug(2, "block_stack size :%d\t new_seq_length=%d\n", size, (int)gen_length(sequence_statements(new_seq)));
301 
302  statement directive_stmt = step_directive_block(drt);
303  sequence_statements(statement_sequence(directive_stmt)) = gen_nreverse(statement_block(directive_stmt));
304  }
305  }
306 
307  pips_debug(1, "end drt = %p\n", drt);
308  return drt;
309 }
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59
bool empty_statement_or_labelless_continue_p(statement)
Return true if the statement is an empty instruction block without label or a continue without label ...
Definition: statement.c:446
#define sequence_statements(x)
Definition: ri.h:2360
bool step_directives_bound_p(statement stmt)
Definition: directives.c:121
step_directive step_directives_load(statement stmt)
Definition: directives.c:116
static step_directive get_current_step_directive(bool open)
Definition: parser.c:382
#define step_directive_undefined
Definition: step_private.h:404
#define step_directive_type(x)
Definition: step_private.h:429
#define step_directive_block(x)
Definition: step_private.h:431
#define step_directive_undefined_p(x)
Definition: step_private.h:405

◆ entity_from_user_name()

entity entity_from_user_name ( string  name)

passage de name a NAME

determiner le nom avec le bon scope...

Parameters
nameame

Definition at line 67 of file parser.c.

68 {
70 
71  pips_debug(1, "begin\n");
72 
74  {
75  /* passage de name a NAME */
76  size_t i;
77  for (i=0; i<strlen(name); i++)
78  name[i]=toupper(name[i]);
79 
82  if (entity_undefined_p(e))
83  pips_user_error("\nFortran entity \"%s\" not found\n", full_name);
84  free(full_name);
85  }
87  {
88  /* determiner le nom avec le bon scope... */
89  statement stmt_declaration = current_statement;
90  pips_debug(4,"##### ENTITY DECL #####\n");
91  while (entity_undefined_p(e) && stmt_declaration)
92  {
93  FOREACH(entity, ee, statement_declarations(stmt_declaration))
94  {
95  pips_debug(4, "entity decl : \"%s\"\n", entity_name(ee));
96  if (strcmp(name, entity_user_name(ee)) == 0)
97  {
98  e = ee;
99  break;
100  }
101  }
102  stmt_declaration = (statement)gen_get_ancestor(statement_domain, stmt_declaration);
103  }
104 
105  if (entity_undefined_p(e))
106  {
108  {
109  pips_debug(4, "entity decl : \"%s\"\n", entity_name(ee));
110  if (strcmp(name, entity_user_name(ee)) == 0)
111  {
112  e = ee;
113  break;
114  }
115  }
116  }
117  if (entity_undefined_p(e))
118  {
120  string full_name = strdup(concatenate(cu, MODULE_SEP_STRING, name, NULL));
122  free(full_name);
123  }
124  if (entity_undefined_p(e))
125  {
128  free(full_name);
129  }
130 
131  if (entity_undefined_p(e))
132  pips_user_error("\nC Entity \"%s\" not found\n", name);
133  }
134 
135  pips_debug(1, "end\n");;
136  return e;
137 }
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
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
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
Definition: genClib.c:3560
#define full_name(dir, name)
Definition: compile.c:414
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
Definition: entity.c:487
code entity_code(entity e)
Definition: entity.c:1098
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
#define code_declarations(x)
Definition: ri.h:784

◆ generate_call_compute_loopslices()

statement generate_call_compute_loopslices ( entity  new_module,
loop  loop_stmt 
)
Parameters
new_moduleew_module
loop_stmtoop_stmt

Definition at line 176 of file compile_RT.c.

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 }
#define RT_STEP_compute_loopslices
Definition: STEP_name.h:61
entity get_entity_step_commsize(entity module)
Que signifie local?
Definition: compile_RT.c:519
#define range_upper(x)
Definition: ri.h:2290
#define range_increment(x)
Definition: ri.h:2292
#define range_lower(x)
Definition: ri.h:2288
#define loop_range(x)
Definition: ri.h:1642

References call_STEP_subroutine2(), entity_to_expression(), get_entity_step_commsize(), loop_range, pips_debug, range_increment, range_lower, range_upper, and RT_STEP_compute_loopslices.

Referenced by compile_loopslices().

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

◆ generate_call_construct_begin_construct_end()

void generate_call_construct_begin_construct_end ( entity  new_module,
step_directive  drt,
statement  mpi_begin_stmt,
statement  mpi_end_stmt 
)
Parameters
new_moduleew_module
drtrt
mpi_begin_stmtpi_begin_stmt
mpi_end_stmtpi_end_stmt

Definition at line 60 of file compile_RT.c.

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 }
#define RT_STEP_construct_end
Definition: STEP_name.h:63
#define RT_STEP_construct_begin
Definition: STEP_name.h:62
static char * directive_txt
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

References call_STEP_subroutine2(), directive_txt, free(), get_step_directive_name(), insert_statement(), RT_STEP_construct_begin, RT_STEP_construct_end, step_symbolic_expression(), and string_undefined_p.

Referenced by compile_body().

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

◆ generate_call_flush()

void generate_call_flush ( statement stepalltoall_stmt)
Parameters
stepalltoall_stmttepalltoall_stmt

Definition at line 85 of file compile_RT.c.

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 }
statement build_call_STEP_flush()
Definition: compile_RT.c:758

References build_call_STEP_flush(), ENDP, insert_statement(), pips_debug, and statement_block().

Referenced by compile_regions().

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

◆ generate_call_get_commsize()

statement generate_call_get_commsize ( entity  new_module)
Parameters
new_moduleew_module

Definition at line 193 of file compile_RT.c.

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 }
#define RT_STEP_get_commsize
Definition: STEP_name.h:66
expression get_expression_addr(expression expr)
compile_RT.c
Definition: compile_RT.c:27

References call_STEP_subroutine2(), entity_to_expression(), get_entity_step_commsize(), get_expression_addr(), pips_debug, and RT_STEP_get_commsize.

Referenced by compile_loopslices().

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

◆ generate_call_get_rank()

statement generate_call_get_rank ( entity  new_module)
Parameters
new_moduleew_module

Definition at line 161 of file compile_RT.c.

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 }
#define RT_STEP_get_rank
Definition: STEP_name.h:68
entity get_entity_step_rank(entity module)
Definition: compile_RT.c:513
static entity rank

References call_STEP_subroutine2(), entity_to_expression(), get_entity_step_rank(), get_expression_addr(), rank, and RT_STEP_get_rank.

Referenced by compile_loopbounds().

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

◆ generate_call_get_rank_loopbounds()

statement generate_call_get_rank_loopbounds ( entity  new_module,
loop  loop_stmt 
)
Parameters
new_moduleew_module
loop_stmtoop_stmt

Definition at line 138 of file compile_RT.c.

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 }
#define RT_STEP_get_loopbounds
Definition: STEP_name.h:67
#define STEP_BOUNDS_UP(index)
Definition: STEP_name.h:9
#define STEP_BOUNDS_LOW(index)
Definition: STEP_name.h:8
entity step_local_loop_index(entity module, string name)
Definition: compile_RT.c:534
#define loop_index(x)
Definition: ri.h:1640

References call_STEP_subroutine2(), entity_to_expression(), get_entity_step_rank(), get_expression_addr(), loop_index, pips_debug, RT_STEP_get_loopbounds, STEP_BOUNDS_LOW, STEP_BOUNDS_UP, and step_local_loop_index().

Referenced by compile_loopbounds().

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

◆ generate_call_get_workchunk_loopbounds()

void generate_call_get_workchunk_loopbounds ( entity  mpi_module,
loop  loop_stmt,
statement compute_regions_stmt 
)
Parameters
mpi_modulepi_module
loop_stmtoop_stmt
compute_regions_stmtompute_regions_stmt

Definition at line 119 of file compile_RT.c.

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 }
entity step_local_slice_index(entity module)
Definition: compile_RT.c:486
#define PLUS_OPERATOR_NAME
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
Definition: expression.c:2012

References call_STEP_subroutine2(), entity_to_expression(), get_expression_addr(), insert_statement(), int_to_expression(), loop_index, make_op_exp(), pips_debug, PLUS_OPERATOR_NAME, RT_STEP_get_loopbounds, STEP_BOUNDS_LOW, STEP_BOUNDS_UP, step_local_loop_index(), and step_local_slice_index().

Referenced by add_workchunk_loop().

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

◆ generate_call_init_regionArray()

void generate_call_init_regionArray ( list  ,
statement  ,
statement   
)

◆ generate_loop_workchunk()

void generate_loop_workchunk ( entity  mpi_module,
statement compute_regions_stmt 
)

ATTENTION recrée alors qu'avant réutilisé

Parameters
mpi_modulepi_module
compute_regions_stmtompute_regions_stmt

Definition at line 101 of file compile_RT.c.

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 }
instruction make_instruction_loop(loop _field_)
Definition: ri.c:1175
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
Definition: ri.c:1301
execution make_execution_sequential(void)
Definition: ri.c:841
range make_range(expression a1, expression a2, expression a3)
Definition: ri.c:2041

References entity_empty_label(), entity_to_expression(), get_entity_step_commsize(), insert_statement(), instruction_to_statement(), int_to_expression(), make_empty_block_statement(), make_execution_sequential(), make_instruction_loop(), make_loop(), make_range(), NIL, and step_local_slice_index().

Referenced by add_workchunk_loop().

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

◆ get_entity_step_commsize()

entity get_entity_step_commsize ( entity  module)

Que signifie local?

Parameters
moduleodule

Definition at line 519 of file compile_RT.c.

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 }
#define STEP_COMM_SIZE_NAME
In Runtime/step/STEP.h.
Definition: STEP_name.h:15
#define STEP_RT_ARRAY_INDEX_INTEGER
Definition: compile_RT.c:22
static entity step_local_RT_Integer(int size_of_integer, entity mpi_module, string name_, list dims)
Definition: compile_RT.c:386

References entity_name, entity_scalar_p(), entity_type, module, NIL, pips_assert, pips_debug, STEP_COMM_SIZE_NAME, step_local_RT_Integer(), STEP_RT_ARRAY_INDEX_INTEGER, and type_variable_p.

Referenced by generate_call_compute_loopslices(), generate_call_get_commsize(), generate_call_set_regionarray(), and generate_loop_workchunk().

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

◆ get_entity_step_rank()

entity get_entity_step_rank ( entity  module)
Parameters
moduleodule

Definition at line 513 of file compile_RT.c.

514 {
516 }
#define STEP_COMM_RANK_NAME
Definition: STEP_name.h:16

References module, NIL, STEP_COMM_RANK_NAME, step_local_RT_Integer(), and STEP_RT_ARRAY_INDEX_INTEGER.

Referenced by compile_master(), generate_call_get_rank(), and generate_call_get_rank_loopbounds().

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

◆ get_expression_addr()

expression get_expression_addr ( expression  expr)

compile_RT.c

Used to add & in front of variable name for C modules: var —> &var

Parameters
exprxpr

Definition at line 27 of file compile_RT.c.

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 }

References ADDRESS_OF_OPERATOR_NAME, entity_intrinsic(), fortran_module_p(), get_current_module_entity(), and MakeUnaryCall().

Referenced by compile_master(), compile_reduction(), generate_call_get_commsize(), generate_call_get_rank(), generate_call_get_rank_loopbounds(), and generate_call_get_workchunk_loopbounds().

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

◆ get_step_directive_name()

void get_step_directive_name ( step_directive  drt,
string directive_txt 
)

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

Modify src/Libs/step/step-local.h instead, to add your own modifications. header file built by cproto step-local.h cproto-generated files directives.c

Parameters
drtrt
directive_txtirective_txt

Definition at line 18 of file directives.c.

19 {
20  pips_debug(2, "begin\n");
21 
22  switch(step_directive_type(drt))
23  {
24  case STEP_PARALLEL:
26  break;
27  case STEP_DO:
29  break;
30  case STEP_PARALLEL_DO:
32  break;
33  case STEP_MASTER:
35  break;
36  case STEP_SINGLE:
38  break;
39  case STEP_BARRIER:
41  break;
42  case STEP_THREADPRIVATE:
44  break;
45  default: assert(0);
46  }
47 
48  pips_debug(2, "end\n");
49 }
#define STEP_MASTER_NAME
Definition: STEP_name.h:33
#define STEP_PARALLEL_DO_NAME
Definition: STEP_name.h:39
#define STEP_DO_NAME
Definition: STEP_name.h:23
#define STEP_SINGLE_NAME
Definition: STEP_name.h:46
#define STEP_PARALLEL_NAME
Definition: STEP_name.h:40
#define assert(ex)
Definition: newgen_assert.h:41

References assert, directive_txt, pips_debug, STEP_BARRIER, step_directive_type, STEP_DO, STEP_DO_NAME, STEP_MASTER, STEP_MASTER_NAME, STEP_PARALLEL, STEP_PARALLEL_DO, STEP_PARALLEL_DO_NAME, STEP_PARALLEL_NAME, STEP_SINGLE, STEP_SINGLE_NAME, STEP_THREADPRIVATE, strdup(), and string_undefined.

Referenced by generate_call_construct_begin_construct_end().

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

◆ insert_optional_pragma()

void insert_optional_pragma ( int  type)

Definition at line 46 of file parser.c.

47 {
49 
50  switch (type)
51  {
52  case STEP_DO:
53  add_pragma_str_to_statement(new_stmt, "ompenddo\n", true);
54  break;
55  case STEP_PARALLEL_DO:
56  add_pragma_str_to_statement(new_stmt, "ompendparalleldo\n", true);
57  break;
58  default:
59  pips_user_error("Unexpected pragma type %d\n", type);
60  }
62  pips_assert("parent", parent_stmt != NULL);
63  pips_assert("block", statement_block_p(parent_stmt));
64  gen_insert_after(new_stmt, current_statement, statement_block(parent_stmt));
65 }
void gen_insert_after(const void *no, const void *o, list l)
Definition: list.c:223

References add_pragma_str_to_statement(), current_statement, gen_get_ancestor(), gen_insert_after(), make_plain_continue_statement(), pips_assert, pips_user_error, statement_block(), statement_block_p, statement_domain, STEP_DO, and STEP_PARALLEL_DO.

Referenced by begin_omp_construct().

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

◆ load_step_comm()

void load_step_comm ( void  )

Definition at line 190 of file analyse.c.

191 {
192  step_comm comms = (step_comm)db_get_memory_resource(DBR_STEP_COMM, "", true);
193 
194  set_step_effect_path(step_comm_path(comms));
195  set_step_interlaced(step_comm_interlaced(comms));
196  set_step_partial(step_comm_partial(comms));
197 }
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define step_comm_partial(x)
Definition: step_private.h:353
#define step_comm_path(x)
Definition: step_private.h:349
struct _newgen_struct_step_comm_ * step_comm
Definition: step_private.h:75
#define step_comm_interlaced(x)
Definition: step_private.h:351

References db_get_memory_resource(), step_comm_interlaced, step_comm_partial, and step_comm_path.

Referenced by step_analyse(), and step_compile_analysed_module().

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

◆ rectangularization_region()

effect rectangularization_region ( effect  )

◆ remove_old_pragma()

void remove_old_pragma ( void  )

Definition at line 139 of file parser.c.

140 {
141  pips_assert("statement defined", !statement_undefined_p(current_statement));
142  pips_assert("pragma defined", !pragma_undefined_p(current_pragma));
143 
145 
146  list el = extensions_extension(es);
147 
149  FOREACH(EXTENSION, e, el)
150  {
152  if (p != current_pragma)
154  }
155 
157 }
list gen_extension_cons(extension p, list l)
Definition: ri.c:908
#define extension_pragma(x)
Definition: ri.h:1295
#define EXTENSION(x)
EXTENSION.
Definition: ri.h:1253
#define extensions_extension(x)
Definition: ri.h:1330
#define pragma_undefined_p(x)
Definition: ri.h:1998
static pragma current_pragma
Definition: parser.c:12

◆ reset_step_comm()

void reset_step_comm ( void  )

Definition at line 199 of file analyse.c.

200 {
201  reset_step_effect_path();
202  reset_step_interlaced();
203  reset_step_partial();
204 }

Referenced by step_compile_analysed_module().

+ Here is the caller graph for this function:

◆ set_current_transform()

void set_current_transform ( int  transform)

parser.c

parser.c

Parameters
transformransform

Definition at line 41 of file parser.c.

42 {
43  current_transform = transform;
44 }
static int current_transform
Definition: parser.c:13

◆ set_RT_add_local()

void set_RT_add_local ( entity  e)

Definition at line 247 of file compile_RT.c.

248 {
251 
253 }
set step_created_entity
Definition: compile_RT.c:245
@ 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

References set_add_element(), set_make(), set_pointer, set_undefined_p, and step_created_entity.

Referenced by step_local_RT_Integer(), and step_parameter().

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

◆ step_analyse()

bool step_analyse ( const char *  module_name)

remove_from_summary_send et remove_from_summary_recv contain only directive regions and translated regions. They do not contain summary regions.

Parameters
module_nameodule_name

Definition at line 1429 of file analyse.c.

1430 {
1431  debug_on("STEP_ANALYSE_DEBUG_LEVEL");
1432  bool exist_regions_p;
1433  pips_debug(2, "begin %d module_name = %s\n", __LINE__, module_name);
1434 
1437 
1441 
1442  statement body = (statement) db_get_memory_resource(DBR_CODE, module_name, true);
1445 
1448 
1450 
1451  load_step_comm();
1452 
1454 
1455  init_step_send_regions();
1456  init_step_recv_regions();
1457 
1458  exist_regions_p = step_compute_SENDRECV_regions(module, body);
1459 
1460  pips_debug(2, "exist_regions_p = %d\n", exist_regions_p);
1461 
1462  if(exist_regions_p)
1463  {
1464  set remove_from_summary_send, remove_from_summary_recv;
1465  list full_send_l, partial_send_l;
1466 
1467  step_analyse_CHAINS_DG(module_name, &remove_from_summary_send, &remove_from_summary_recv);
1468 
1469  /* remove_from_summary_send et remove_from_summary_recv contain
1470  only directive regions and translated regions. They do not
1471  contain summary regions. */
1472 
1473  step_update_SUMMARY_SENDRECV_regions(remove_from_summary_send, remove_from_summary_recv, &full_send_l, &partial_send_l);
1474 
1475  /*
1476  full_send_l are TRANSLATED or DIRECTIVE regions.
1477  partial_send_l are SUMMARY regions.
1478  */
1479  step_update_comm(full_send_l, partial_send_l);
1480  }
1481 
1482  DB_PUT_MEMORY_RESOURCE(DBR_STEP_SEND_REGIONS, module_name, get_step_send_regions());
1483  DB_PUT_MEMORY_RESOURCE(DBR_STEP_RECV_REGIONS, module_name, get_step_recv_regions());
1484 
1485  reset_step_send_regions();
1486  reset_step_recv_regions();
1487 
1489 
1490  store_step_comm();
1491 
1493 
1496 
1499 
1500  reset_in_effects();
1502  reset_rw_effects();
1503 
1505 
1506  pips_debug(2, "End step_analyse\n");
1507  debug_off();
1508  return true;
1509 }
static void step_analyse_CHAINS_DG(const char *module_name, set *remove_from_summary_send, set *remove_from_summary_recv)
Definition: analyse.c:1248
static void step_update_SUMMARY_SENDRECV_regions(set remove_from_summary_send, set remove_from_summary_recv, list *full_send_l, list *partial_send_l)
Definition: analyse.c:1340
static void step_statement_path_init(statement body)
Definition: analyse.c:71
void load_step_comm()
Definition: analyse.c:190
static bool step_compute_SENDRECV_regions(entity module, statement body)
Definition: analyse.c:1413
void store_step_comm()
Definition: analyse.c:206
static void step_statement_path_finalize(void)
Definition: analyse.c:80
static void step_update_comm(list full_send_l, list partial_send_l)
Definition: analyse.c:1383
void init_convex_rw_regions(const char *)
Definition: methods.c:495
void set_methods_for_convex_effects(void)
methods.c
Definition: methods.c:235
void reset_convex_rw_regions(const char *)
Definition: methods.c:560
void set_rw_effects(statement_effects)
void reset_out_effects(void)
void set_out_effects(statement_effects)
void set_in_effects(statement_effects)
void reset_in_effects(void)
void generic_effects_reset_all_methods(void)
void reset_rw_effects(void)
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
#define debug_on(env)
Definition: misc-local.h:157
#define debug_off()
Definition: misc-local.h:160
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
Definition: ordering.c:172
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
Definition: ordering.c:185
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450
void step_directives_reset()
Definition: directives.c:103
void step_directives_init(bool first_p)
Definition: directives.c:88
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59

References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, generic_effects_reset_all_methods(), init_convex_rw_regions(), load_step_comm(), local_name_to_top_level_entity(), module, module_name(), pips_debug, reset_convex_rw_regions(), reset_current_module_entity(), reset_current_module_statement(), reset_in_effects(), reset_ordering_to_statement(), reset_out_effects(), reset_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_in_effects(), set_methods_for_convex_effects(), set_ordering_to_statement(), set_out_effects(), set_rw_effects(), step_analyse_CHAINS_DG(), step_compute_SENDRECV_regions(), step_directives_init(), step_directives_reset(), step_statement_path_finalize(), step_statement_path_init(), step_update_comm(), step_update_SUMMARY_SENDRECV_regions(), and store_step_comm().

+ Here is the call graph for this function:

◆ step_analyse_init()

bool step_analyse_init ( const  string)

init intrinsics

other intrinsics

Parameters
stringodule_name

Definition at line 361 of file analyse.c.

362 {
363  pips_debug(2, "begin for module \"%s\".\n", module_name);
365 
366  string srcpath = strdup(PIPS_RUNTIME_DIR "/" STEP_DEFAULT_RT_H);
367  string old_path = pips_srcpath_append(srcpath);
368  free(old_path);
369  free(srcpath);
370 
371  /* init intrinsics */
372  static struct intrin {
373  char * name;
374  intrinsic_desc_t desc;
375  } step_intrinsics [] = {
376 #include "STEP_RT_intrinsic.h"
377  { NULL , {NULL, 0} }
378  };
379  for(struct intrin *p = step_intrinsics;p->name;++p)
380  register_intrinsic_handler(p->name,&(p->desc));
381 
382  /* other intrinsics */
383  static IntrinsicDescriptor IntrinsicTypeDescriptorTable[] =
384  {
385 #include "STEP_RT_bootstrap.h"
386  {NULL, 0, 0, 0, 0}
387  };
388  for(IntrinsicDescriptor *p=IntrinsicTypeDescriptorTable;p->name;p++)
390 
391  pips_debug(2, "end\n");
392  return true;
393 }
map_effect_bool make_map_effect_bool(void)
Definition: step_private.c:52
step_comm make_step_comm(map_effect_step_point a1, map_effect_bool a2, map_effect_bool a3)
Definition: step_private.c:306
map_effect_step_point make_map_effect_step_point(void)
Definition: step_private.c:109
void register_intrinsic_type_descriptor(IntrinsicDescriptor *p)
This function is called one time (at the very beginning) to create all intrinsic functions.
Definition: bootstrap.c:4411
string pips_srcpath_append(string)
returns an allocated pointer to the old value
Definition: source_file.c:177
void register_intrinsic_handler(const char *name, intrinsic_desc_t *desc)
after this call, name and desc are owned by intrinsic_handlers, but will never be deallocated they mu...
Definition: misc.c:2517
#define STEP_DEFAULT_RT_H
Definition: defines-local.h:45
The following data structure describes an intrinsic function: its name and its arity and its type,...
for intrinsic registration

References DB_PUT_MEMORY_RESOURCE, free(), make_map_effect_bool(), make_map_effect_step_point(), make_step_comm(), module_name(), IntrinsicDescriptor::name, pips_debug, pips_srcpath_append(), register_intrinsic_handler(), register_intrinsic_type_descriptor(), STEP_DEFAULT_RT_H, and strdup().

+ Here is the call graph for this function:

◆ step_analysed_module_p()

bool step_analysed_module_p ( const char *  module_name)
Parameters
module_nameodule_name

Definition at line 179 of file analyse.c.

180 {
181  return db_resource_required_or_available_p(DBR_STEP_SEND_REGIONS, module_name);
182 }
bool db_resource_required_or_available_p(const char *rname, const char *oname)
from now on we must not know about the database internals?
Definition: database.c:505

References db_resource_required_or_available_p(), and module_name().

Referenced by step_compile(), and step_compile_generated_module().

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

◆ step_bison_parse()

void step_bison_parse ( pragma  pgm,
statement  stmt 
)
Parameters
pgmgm
stmttmt

Definition at line 1901 of file step_bison_parser.c.

1902 {
1903  string pragma_str = pragma_string(pgm);
1904 
1905  if(pragma_str[strlen(pragma_str)-1]!= '\n')
1906  pragma_str = strdup(concatenate(pragma_string(pgm),"\n",NULL));
1907  else
1908  pragma_str = strdup(pragma_string(pgm));
1909 
1910  pips_debug(1, "############### PARSER BEGIN ################\nwith :\n%s\non stmt : %p\n", pragma_str, stmt);
1911  ifdebug(4)
1912  yydebug=1;
1913  pragma_str_original = strdup(pragma_str);
1914  step_lexer_scan_string(pragma_str);
1915  step_lexerparse();
1917  pips_debug(1, "############### PARSER END ################\n");
1918 
1919  free(pragma_str);
1920 }
#define pragma_string(x)
Definition: ri.h:2033
#define ifdebug(n)
Definition: sg.c:47
int step_lexerparse(void)
static string pragma_str_original
#define yydebug
void free(void *)

◆ step_comment2pragma_handle()

void step_comment2pragma_handle ( statement  )

◆ step_compile()

bool step_compile ( const char *  module_name)

analysed source : let's do the transformations

generated module: nothing to do but copy the generated source

Parameters
module_nameodule_name

Definition at line 393 of file compile.c.

394 {
395  debug_on("STEP_COMPILE_DEBUG_LEVEL");
396  pips_debug(1, "Begin considering module_name = %s\n", module_name);
397 
399 
400  bool is_fortran = fortran_module_p(module);
401  string init_name, finit_name;
402 
404  assert(asprintf(&finit_name,"%s/%s" , db_get_current_workspace_directory(), init_name)>=0);
405 
407  {
408  /* analysed source : let's do the transformations */
410  }
411  else
412  {
413  /* generated module: nothing to do but copy the generated source */
415  }
416 
417  DB_PUT_FILE_RESOURCE(DBR_STEP_FILE, module_name, finit_name);
418 
419  pips_debug(1, "End\n");
420  debug_off();
421  return true;
422 }
bool step_analysed_module_p(const char *module_name)
Definition: analyse.c:179
#define DB_PUT_FILE_RESOURCE
Put a file resource into the current workspace database.
Definition: pipsdbm-local.h:85
string db_build_file_resource_name(const char *rname, const char *oname, const char *suffix)
returns an allocated file name for a file resource.
Definition: lowlevel.c:169
#define asprintf
Definition: misc-local.h:225
string db_get_current_workspace_directory(void)
Definition: workspace.c:96
void step_compile_generated_module(const char *module_name, string finit_name)
generated source: no analyse and no compilation necessary.
Definition: compile.c:354
#define STEP_GENERATED_SUFFIX_F
Copyright 2007-2012 Alain Muller, Frederique Silber-Chaussumier.
Definition: compile.c:20
#define STEP_GENERATED_SUFFIX_C
Definition: compile.c:21
void step_compile_analysed_module(const char *module_name, string finit_name)
Definition: compile.c:288

References asprintf, assert, db_build_file_resource_name(), db_get_current_workspace_directory(), DB_PUT_FILE_RESOURCE, debug_off, debug_on, fortran_module_p(), local_name_to_top_level_entity(), module, module_name(), pips_debug, step_analysed_module_p(), step_compile_analysed_module(), step_compile_generated_module(), STEP_GENERATED_SUFFIX_C, and STEP_GENERATED_SUFFIX_F.

+ Here is the call graph for this function:

◆ step_compile_analysed_module()

void step_compile_analysed_module ( const char *  module_name,
string  finit_name 
)

Code transformation

File generation

Parameters
module_nameodule_name
finit_nameinit_name

Definition at line 288 of file compile.c.

289 {
290  pips_debug(1, "begin\n");
291 
294 
297 
299  load_step_comm();
300 
301  statement_effects rw_effects = (statement_effects)db_get_memory_resource(DBR_REGIONS, module_name, false);
302  statement_effects cummulated_rw_effects = (statement_effects)db_get_memory_resource(DBR_CUMULATED_EFFECTS, module_name, false);
303  set_rw_effects(rw_effects);
304  set_cumulated_rw_effects(cummulated_rw_effects);
305 
306  /* Code transformation */
307  list last_module_name = CONS(STRING, (string)module_name, NIL);
308 
310 
312  {
313  string init_subroutine_name;
314  init_subroutine_name = fortran_module_p(get_current_module_entity())?
317  statement init_stmt = call_STEP_subroutine2(init_subroutine_name, NULL);
318  statement finalize_stmt = call_STEP_subroutine2(RT_STEP_finalize, NULL);
319 
321  insert_statement(last_statement(stmt), finalize_stmt, true);
322  }
323 
326  free_statement_effects(cummulated_rw_effects);
327  free_statement_effects(rw_effects);
328 
329  reset_step_comm();
333 
334  /* File generation */
335  text code_txt = text_named_module(module, module, stmt);
336  bool saved_b1 = get_bool_property("PRETTYPRINT_ALL_DECLARATIONS");
337  bool saved_b2 = get_bool_property("PRETTYPRINT_STATEMENT_NUMBER");
338  set_bool_property("PRETTYPRINT_ALL_DECLARATIONS", true);
339  set_bool_property("PRETTYPRINT_STATEMENT_NUMBER", false);
340 
341  FILE *f = safe_fopen(finit_name, "w");
342  print_text(f, code_txt);
343  safe_fclose(f, finit_name);
344 
345  set_bool_property("PRETTYPRINT_ALL_DECLARATIONS", saved_b1);
346  set_bool_property("PRETTYPRINT_STATEMENT_NUMBER", saved_b2);
347  free_text(code_txt);
349  pips_debug(1, "end\n");
350 }
void free_statement_effects(statement_effects p)
Definition: effects.c:971
void free_statement(statement p)
Definition: ri.c:2189
void free_text(text p)
Definition: text.c:74
#define RT_STEP_init_fortran_order
Definition: STEP_name.h:71
#define RT_STEP_init_c_order
Definition: STEP_name.h:70
#define RT_STEP_finalize
Definition: STEP_name.h:64
void reset_step_comm()
Definition: analyse.c:199
void set_cumulated_rw_effects(statement_effects)
void reset_cumulated_rw_effects(void)
struct _newgen_struct_statement_effects_ * statement_effects
Definition: effects.h:210
FILE * safe_fopen(const char *filename, const char *what)
Definition: file.c:67
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
Definition: genC.h:285
#define STRING(x)
Definition: genC.h:87
static statement init_stmt
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
text text_named_module(entity, entity, statement)
bool entity_main_module_p(entity e)
Definition: entity.c:700
static bool compile_filter(statement stmt, list *last_module_name)
Definition: compile.c:215
static void compile_rewrite(statement stmt, list *last_module_name)
Definition: compile.c:245
void print_text(FILE *fd, text t)
Definition: print.c:195

References call_STEP_subroutine2(), compile_filter(), compile_rewrite(), CONS, db_get_memory_resource(), entity_main_module_p(), f(), fortran_module_p(), free_statement(), free_statement_effects(), free_text(), gen_context_recurse, get_bool_property(), get_current_module_entity(), init_stmt, insert_statement(), last_statement(), load_step_comm(), local_name_to_top_level_entity(), module, module_name(), NIL, pips_debug, print_text(), reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_rw_effects(), reset_step_comm(), RT_STEP_finalize, RT_STEP_init_c_order, RT_STEP_init_fortran_order, safe_fclose(), safe_fopen(), set_bool_property(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_rw_effects(), statement_domain, step_directives_init(), step_directives_reset(), STRING, and text_named_module().

Referenced by step_compile().

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

◆ step_compile_generated_module()

void step_compile_generated_module ( const char *  module_name,
string  finit_name 
)

generated source: no analyse and no compilation necessary.

Keep the source as it is.

Parameters
module_nameodule_name
finit_nameinit_name

Definition at line 354 of file compile.c.

355 {
356  pips_debug(1, "begin\n");
357 
358  string source_file, fsource_file;
360  bool is_fortran = fortran_module_p(module);
361 
362  source_file = db_get_memory_resource(is_fortran?DBR_INITIAL_FILE:DBR_C_SOURCE_FILE, module_name, true);
363 
364  assert(asprintf(&fsource_file,"%s/%s" , db_get_current_workspace_directory(), source_file)>=0);
365  pips_debug(1, "Copie from: %s\n", fsource_file);
366  safe_copy(fsource_file, finit_name);
367 
369  {
370  safe_system(concatenate("echo '#include \"step_api.h\"' >>",finit_name, NULL));
371  pips_debug(1, "\tAdd prototype for STEP generated modules\n");
373  int n = gen_array_nitems(modules), i;
374  FILE *out = safe_fopen(finit_name, "a");
375  for (i=0; i<n; i++)
376  {
377  string name = gen_array_item(modules, i);
378  if (same_string_p((const char*)module_name, (const char*)compilation_unit_of_module(name)) &&
379  !same_string_p(module_name, name) &&
380  !step_analysed_module_p(name))
381  {
386  }
387  }
388  safe_fclose(out, finit_name);
389  }
390  pips_debug(1, "end\n");
391 }
gen_array_t db_get_module_list_initial_order(void)
Definition: database.c:1151
static FILE * out
Definition: alias_check.c:128
size_t gen_array_nitems(const gen_array_t a)
Definition: array.c:131
void * gen_array_item(const gen_array_t a, size_t i)
Definition: array.c:143
bool compilation_unit_p(const char *module_name)
The names of PIPS entities carry information about their nature.
Definition: entity_names.c:56
void safe_copy(char *source, char *target)
Definition: file.c:706
void safe_system(string)
system.c
Definition: system.c:38
#define same_string_p(s1, s2)
void fprint_statement(FILE *, statement)
Print statement "s" on file descriptor "fd".
Definition: statement.c:68
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755

References asprintf, assert, compilation_unit_of_module(), compilation_unit_p(), concatenate(), CONS, db_get_current_workspace_directory(), db_get_memory_resource(), db_get_module_list_initial_order(), ENTITY, fortran_module_p(), fprint_statement(), free_statement(), gen_array_item(), gen_array_nitems(), local_name_to_top_level_entity(), make_plain_continue_statement(), module, module_name(), module_name_to_entity(), NIL, out, pips_debug, safe_copy(), safe_fclose(), safe_fopen(), safe_system(), same_string_p, statement_declarations, and step_analysed_module_p().

Referenced by step_compile().

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

◆ step_directive_basic_workchunk()

statement step_directive_basic_workchunk ( step_directive  d)

Definition at line 286 of file directives.c.

287 {
289  pips_debug(3, "begin\n");
290 
291  switch(step_directive_type(d))
292  {
293  case STEP_DO:
294  case STEP_PARALLEL_DO:
295  {
296  // on retourne le corps de boucle
298  pips_assert("1 statement", gen_length(block) == 1);
299 
300  stmt = STATEMENT(CAR(block));
301 
304  else if (statement_forloop_p(stmt))
306  else
307  pips_assert("not a loop", false);
308  break;
309  }
310  default:
311  {
312  // on retourne le block de la directive
313  }
314  }
315 
316  pips_debug(3, "end\n");
317  return stmt;
318 }
loop statement_loop(statement)
Get the loop of a statement.
Definition: statement.c:1374
forloop statement_forloop(statement)
Get the forloop of a statement.
Definition: statement.c:1426
#define loop_body(x)
Definition: ri.h:1644
#define forloop_body(x)
Definition: ri.h:1372

References CAR, forloop_body, gen_length(), loop_body, pips_assert, pips_debug, STATEMENT, statement_block(), statement_forloop(), statement_forloop_p(), statement_loop(), statement_loop_p(), step_directive_block, step_directive_type, STEP_DO, and STEP_PARALLEL_DO.

Referenced by compute_directive_regions(), and step_print_directives_regions().

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

◆ step_directive_basic_workchunk_index()

list step_directive_basic_workchunk_index ( step_directive  d)

Definition at line 320 of file directives.c.

321 {
322  list index_l = NIL;
324 
325  pips_debug(4, "begin\n");
326  switch(step_directive_type(d))
327  {
328  case STEP_DO:
329  case STEP_PARALLEL_DO:
330  {
332  pips_assert("1 statement", gen_length(block) == 1);
333 
334  stmt = STATEMENT(CAR(block));
335 
337  index_l = CONS(ENTITY, loop_index(statement_loop(stmt)), index_l);
338  else if (statement_forloop_p(stmt))
339  {
341  pips_assert("an assignment", assignment_expression_p(init));
343  expression lhs = EXPRESSION(CAR(assign_params));
344  entity e = expression_to_entity(lhs);
345  pips_assert("an entity", !entity_undefined_p(e));
346  index_l = CONS(ENTITY, e, index_l);
347  }
348  else
349  pips_assert("not a loop", false);
350  break;
351  }
352  default:
353  {
354  // on retourne la liste vide
355  }
356  }
357 
358  pips_debug(4, "end\n");
359  return gen_nreverse(index_l);
360 }
static int init
Maximal value set for Fortran 77.
Definition: entity.c:320
bool assignment_expression_p(expression e)
Test if an expression is an assignment operation.
Definition: expression.c:979
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
Definition: expression.c:3140
#define forloop_initialization(x)
Definition: ri.h:1366
#define syntax_call(x)
Definition: ri.h:2736
#define call_arguments(x)
Definition: ri.h:711
#define expression_syntax(x)
Definition: ri.h:1247

References assignment_expression_p(), call_arguments, CAR, CONS, ENTITY, entity_undefined_p, EXPRESSION, expression_syntax, expression_to_entity(), forloop_initialization, gen_length(), gen_nreverse(), init, loop_index, NIL, pips_assert, pips_debug, STATEMENT, statement_block(), statement_forloop(), statement_forloop_p(), statement_loop(), statement_loop_p(), step_directive_block, step_directive_type, STEP_DO, STEP_PARALLEL_DO, and syntax_call.

Referenced by step_compute_step_interlaced().

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

◆ step_directive_print()

void step_directive_print ( step_directive  d)

Definition at line 362 of file directives.c.

363 {
364  int type = step_directive_type(d);
365  list clauses = step_directive_clauses(d);
366  string begin_txt, end_txt;
367  bool is_fortran = fortran_module_p(get_current_module_entity());
368  bool is_block_construct = step_directive_to_strings(d, is_fortran, &begin_txt, &end_txt);
369 
370  pips_debug(1, "begin ====> TYPE %d : \nNB clauses : %d\n\tdirective begin : %s\n",
371  type, (int)gen_length(clauses), begin_txt);
372  if (is_block_construct && !empty_comments_p(end_txt)) pips_debug(1,"\tdirective end : %s\n", end_txt);
373 
374  ifdebug(1)
375  {
378  pips_debug(1, "----> on statement :\n");
380  pips_debug(1, "\n");
381  }
382  /*
383  ifdebug(2)
384  {
385  statement stmt = step_directive_basic_workchunk(d);
386  assert(!statement_undefined_p(stmt));
387 
388  string index_str=strdup("");
389  FOREACH(ENTITY, e , step_directive_basic_workchunk_index(d))
390  {
391  string previous = index_str;
392  index_str = strdup(concatenate(previous, entity_local_name(e), " ", NULL));
393  free(previous);
394  }
395  pips_debug(2, "\n----> basic workchunk (index : [%s] )\n", index_str);
396  print_statement(stmt);
397  pips_debug(2, "\n");
398  }
399  */
400  pips_debug(1, "end\n");
401 }
bool empty_comments_p(const char *)
Definition: statement.c:107
void print_statement(statement)
Print a statement on stderr.
Definition: statement.c:98
#define step_directive_clauses(x)
Definition: step_private.h:433

References assert, empty_comments_p(), fortran_module_p(), gen_length(), get_current_module_entity(), ifdebug, pips_debug, print_statement(), statement_undefined_p, step_directive_block, step_directive_clauses, step_directive_to_strings(), and step_directive_type.

Referenced by compile_rewrite(), compute_directive_regions(), and step_directives_print().

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

◆ step_directive_to_strings()

bool step_directive_to_strings ( step_directive  d,
bool  is_fortran,
string begin_txt,
string end_txt 
)

clause

transformation clause is not printed

Parameters
is_fortrans_fortran
begin_txtegin_txt
end_txtnd_txt

Definition at line 147 of file directives.c.

148 {
149  bool block_directive = true;
150  bool end_directive = is_fortran;
151 
153  switch(step_directive_type(d))
154  {
155  case STEP_PARALLEL:
156  directive_txt = strdup("parallel");
157  break;
158  case STEP_DO:
159  directive_txt = strdup(is_fortran?"do":"for");
160  block_directive = is_fortran;
161  break;
162  case STEP_PARALLEL_DO:
163  directive_txt = strdup(is_fortran?"parallel do":"parallel for");
164  block_directive = is_fortran;
165  break;
166  case STEP_MASTER:
167  directive_txt = strdup("master");
168  break;
169  case STEP_SINGLE:
170  directive_txt = strdup("single");
171  break;
172  case STEP_BARRIER:
173  directive_txt = strdup("barrier");
174  block_directive = false;
175  end_directive = false;
176  break;
177  case STEP_THREADPRIVATE:
178  directive_txt = strdup("threadprivate");
179  block_directive = false;
180  end_directive = false;
181  break;
182  default:
183  pips_internal_error("unpexpected step directive type");
184  }
185 
186  /* clause */
187  set copyin_l = set_make(set_pointer);
188  set private_l = set_make(set_pointer);
189  set shared_l = set_make(set_pointer);
190  set threadprivate_l = set_make(set_pointer);
191  set firstprivate_l = set_make(set_pointer);
192  list schedule_l = list_undefined;
193  bool nowait = false;
194 
195  int op;
196  set reductions_l[STEP_UNDEF_REDUCE];
197  for(op=0; op<STEP_UNDEF_REDUCE; op++)
198  reductions_l[op] = set_make(set_pointer);
199 
201  {
202  switch (step_clause_tag(c))
203  {
205  set_append_list(copyin_l, step_clause_copyin(c));
206  break;
208  set_append_list(private_l, step_clause_private(c));
209  break;
211  set_append_list(shared_l, step_clause_shared(c));
212  break;
214  set_append_list(threadprivate_l, step_clause_threadprivate(c));
215  break;
217  set_append_list(firstprivate_l, step_clause_firstprivate(c));
218  break;
220  nowait = true;
221  break;
224  set_add_element(reductions_l[op], reductions_l[op], variable);
225  }, step_clause_reduction(c));
226  break;
228  schedule_l = step_clause_schedule(c);
229  break;
231  /* transformation clause is not printed */
232  break;
233  default: assert(0);
234  }
235  }
236 
237 
238  if(end_directive)
239  *end_txt = strdup(concatenate("omp end ",directive_txt, nowait?" nowait":"", NULL));
240  else
241  *end_txt = string_undefined;
242 
244  string_buffer_cat(sb, strdup("omp "), strdup(directive_txt), NULL);
245 
246  SB_LIST_VARIABLE(sb, copyin_l, " copyin(");
247  SB_LIST_VARIABLE(sb, private_l, " private(");
248  SB_LIST_VARIABLE(sb, shared_l, " shared(");
249  SB_LIST_VARIABLE(sb, threadprivate_l, "(");
250  SB_LIST_VARIABLE(sb, firstprivate_l, " firstprivate(");
251 
252  if(!list_undefined_p(schedule_l))
253  {
254  string s = string_undefined;
255  FOREACH(STRING, str, schedule_l)
256  {
257  if(s == string_undefined)
258  s=strdup(concatenate(" schedule(", str, NULL));
259  else
260  s=strdup(concatenate(", ", str, NULL));
262  }
264  }
265 
266  string op_txt[STEP_UNDEF_REDUCE]={" reduction(*: "," reduction(max: "," reduction(min: "," reduction(+: "};
267  for(op=0; op<STEP_UNDEF_REDUCE; op++)
268  SB_LIST_VARIABLE(sb, reductions_l[op], op_txt[op]);
269 
270  if(nowait && !end_directive)
271  string_buffer_append(sb, strdup(" nowait"));
272 
273  *begin_txt = string_buffer_to_string(sb);
275 
276  ifdebug(4)
277  {
278  printf("ÞÞÞÞÞÞÞÞÞ directive begin : %s\n", *begin_txt);
279  printf("ÞÞÞÞÞÞÞÞÞ directive end : %s\n", end_directive?*end_txt:"");
280  }
281 
282  return block_directive;
283 }
static void end_directive(void)
#define list_undefined_p(c)
Return if a list is undefined.
Definition: newgen_list.h:75
#define list_undefined
Undefined list definition :-)
Definition: newgen_list.h:69
#define pips_internal_error
Definition: misc-local.h:149
set set_append_list(set, const list)
add list l items to set s, which is returned.
Definition: set.c:460
void string_buffer_free_all(string_buffer *)
free string buffer structure and force string freeing
Definition: string_buffer.c:94
void string_buffer_append(string_buffer, const string)
append string s (if non empty) to string buffer sb, the duplication is done if needed according to th...
string string_buffer_to_string(const string_buffer)
return malloc'ed string from string buffer sb
string_buffer string_buffer_make(bool dup)
allocate a new string buffer
Definition: string_buffer.c:58
void string_buffer_cat(string_buffer, const string,...)
append a NULL terminated list of string to sb.
int printf()
#define SB_LIST_VARIABLE(sb, list_var, txt_begin)
Definition: directives.c:132
#define STEP_UNDEF_REDUCE
Definition: step_common.h:95
#define step_clause_copyin(x)
Definition: step_private.h:308
@ is_step_clause_reduction
Definition: step_private.h:248
@ is_step_clause_private
Definition: step_private.h:249
@ is_step_clause_transformation
Definition: step_private.h:251
@ is_step_clause_nowait
Definition: step_private.h:252
@ is_step_clause_copyin
Definition: step_private.h:254
@ is_step_clause_threadprivate
Definition: step_private.h:253
@ is_step_clause_schedule
Definition: step_private.h:256
@ is_step_clause_firstprivate
Definition: step_private.h:255
@ is_step_clause_shared
Definition: step_private.h:250
#define step_clause_private(x)
Definition: step_private.h:293
#define step_clause_firstprivate(x)
Definition: step_private.h:311
#define step_clause_tag(x)
Definition: step_private.h:287
#define step_clause_schedule(x)
Definition: step_private.h:314
#define step_clause_shared(x)
Definition: step_private.h:296
#define step_clause_threadprivate(x)
Definition: step_private.h:305
#define STEP_CLAUSE(x)
STEP_CLAUSE.
Definition: step_private.h:227
#define step_clause_reduction(x)
Definition: step_private.h:290
#define MAP_ENTITY_INT_MAP(k, v, c, f)
Definition: step_private.h:217
internally defined structure.
Definition: string_buffer.c:47
Definition: statement.c:4047

References assert, concatenate(), directive_txt, end_directive(), FOREACH, ifdebug, is_step_clause_copyin, is_step_clause_firstprivate, is_step_clause_nowait, is_step_clause_private, is_step_clause_reduction, is_step_clause_schedule, is_step_clause_shared, is_step_clause_threadprivate, is_step_clause_transformation, list_undefined, list_undefined_p, MAP_ENTITY_INT_MAP, pips_internal_error, printf(), SB_LIST_VARIABLE, set_add_element(), set_append_list(), set_make(), set_pointer, STEP_BARRIER, STEP_CLAUSE, step_clause_copyin, step_clause_firstprivate, step_clause_private, step_clause_reduction, step_clause_schedule, step_clause_shared, step_clause_tag, step_clause_threadprivate, step_directive_clauses, step_directive_type, STEP_DO, STEP_MASTER, STEP_PARALLEL, STEP_PARALLEL_DO, STEP_SINGLE, STEP_THREADPRIVATE, STEP_UNDEF_REDUCE, strdup(), STRING, string_buffer_append(), string_buffer_cat(), string_buffer_free_all(), string_buffer_make(), string_buffer_to_string(), and string_undefined.

Referenced by compile_omp(), and step_directive_print().

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

◆ step_directive_type_print()

void step_directive_type_print ( step_directive  drt)
Parameters
drtrt

Definition at line 51 of file directives.c.

52 {
53  switch(step_directive_type(drt))
54  {
55  case STEP_PARALLEL:
56  pips_debug(1, "step_directive_type = STEP_PARALLEL\n");
57  break;
58  case STEP_PARALLEL_DO:
59  pips_debug(1, "step_directive_type = STEP_PARALLEL_DO\n");
60  break;
61  case STEP_DO:
62  pips_debug(1, "step_directive_type = STEP_DO\n");
63  break;
64  case STEP_MASTER:
65  pips_debug(1, "step_directive_type = STEP_MASTER\n");
66  break;
67  case STEP_BARRIER:
68  pips_debug(1, "step_directive_type = STEP_BARRIER\n");
69  break;
70  case STEP_THREADPRIVATE:
71  pips_debug(1, "step_directive_type = STEP_THREADPRIVATE\n");
72  break;
73  default:
74  pips_debug(1, "step_directive_type = UNKNOWN\n");
75  break;
76  }
77 }

References pips_debug, STEP_BARRIER, step_directive_type, STEP_DO, STEP_MASTER, STEP_PARALLEL, STEP_PARALLEL_DO, and STEP_THREADPRIVATE.

Referenced by compile_body().

+ Here is the caller graph for this function:

◆ step_directives_bound_p()

bool step_directives_bound_p ( statement  stmt)
Parameters
stmttmt

Definition at line 121 of file directives.c.

122 {
123  return bound_directives_p(stmt);
124 }

Referenced by compile_filter(), compile_rewrite(), compute_SENDRECV_regions(), end_omp_construct(), get_current_step_directive(), sequence_rewrite(), statement_filter(), step_compute_CHAINS_DG_SENDRECV_regions(), and step_statement_path_first_directive_statement().

+ Here is the caller graph for this function:

◆ step_directives_init()

void step_directives_init ( bool  first_p)
Parameters
first_pirst_p

Definition at line 88 of file directives.c.

89 {
90  pips_debug(4, "begin first_p = %d\n", first_p);
91 
92  if (first_p)
93  init_directives();
94  else
95  {
97  set_directives((step_directives)db_get_memory_resource(DBR_STEP_DIRECTIVES, module_name, true));
98  }
99 
100  pips_debug(4, "end\n");
101 }

References db_get_memory_resource(), entity_user_name(), get_current_module_entity(), module_name(), and pips_debug.

Referenced by step_analyse(), step_compile_analysed_module(), and step_parser().

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

◆ step_directives_load()

step_directive step_directives_load ( statement  stmt)
Parameters
stmttmt

Definition at line 116 of file directives.c.

117 {
118  return load_directives(stmt);
119 }

Referenced by compile_filter(), compile_rewrite(), compute_SENDRECV_regions(), end_omp_construct(), get_current_step_directive(), and step_private_p().

+ Here is the caller graph for this function:

◆ step_directives_print()

void step_directives_print ( void  )

Definition at line 79 of file directives.c.

80 {
81  STEP_DIRECTIVES_MAP(block_stmt, d,
82  {
83  assert(!statement_undefined_p(block_stmt));
85  }, get_directives());
86 }
void step_directive_print(step_directive d)
Definition: directives.c:362
#define STEP_DIRECTIVES_MAP(k, v, c, f)
Definition: step_private.h:388

References assert, statement_undefined_p, step_directive_print(), and STEP_DIRECTIVES_MAP.

Referenced by step_parser().

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

◆ step_directives_reset()

void step_directives_reset ( void  )

Definition at line 103 of file directives.c.

104 {
105  reset_directives();
106 }

Referenced by step_analyse(), and step_compile_analysed_module().

+ Here is the caller graph for this function:

◆ step_directives_save()

void step_directives_save ( void  )

Definition at line 108 of file directives.c.

109 {
111  DB_PUT_MEMORY_RESOURCE(DBR_STEP_DIRECTIVES, module_name, get_directives());
112  reset_directives();
113 }

References DB_PUT_MEMORY_RESOURCE, entity_user_name(), get_current_module_entity(), and module_name().

Referenced by step_parser().

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

◆ step_directives_store()

void step_directives_store ( statement  stmt,
step_directive  d 
)
Parameters
stmttmt

Definition at line 126 of file directives.c.

127 {
129  store_directives(stmt, d);
130 }

References assert, and statement_block_p.

Referenced by new_step_directive().

+ Here is the caller graph for this function:

◆ step_function()

expression step_function ( string  name,
list  args 
)
Parameters
nameame
argsrgs

Definition at line 359 of file compile_RT.c.

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 }
expression make_call_expression(entity e, list l)
Build an expression that call an function entity with an argument list.
Definition: expression.c:321
#define type_functional_p(x)
Definition: ri.h:2950

References concatenate(), entity_domain, entity_type, entity_undefined_p, gen_find_tabulated(), make_call_expression(), MODULE_SEP_STRING, pips_assert, TOP_LEVEL_MODULE_NAME, and type_functional_p.

+ Here is the call graph for this function:

◆ step_install()

bool step_install ( const string  program_name)

install.c

install.c

This file is part of STEP.

The program is distributed under the terms of the GNU General Public License.

Generation des fichiers sources dans workspace.database/Src/

Instalation des fichiers generes

Parameters
program_namerogram_name

Definition at line 15 of file install.c.

16 {
17  debug_on("STEP_INSTALL_DEBUG_LEVEL");
18  pips_debug(1, "Starting for program \"%s\".\n", program_name);
19 
20  /* Generation des fichiers sources dans workspace.database/Src/ */
23  int n = gen_array_nitems(modules), i;
25 
26  for (i=0; i<n; i++)
27  {
28  string module_name = gen_array_item(modules, i);
29  string user_file = db_get_memory_resource(DBR_USER_FILE, module_name, true);
30  string new_file = hash_get(user_files, user_file);
31  if (new_file == HASH_UNDEFINED_VALUE)
32  {
33  string base_name = pips_basename(user_file, NULL);
34  new_file = strdup(concatenate(dest_dir, "/", base_name, NULL));
35  hash_put(user_files, user_file, new_file);
36  }
37 
38  string step_file = db_get_memory_resource(DBR_STEP_FILE, module_name, true);
39 
40 
41 
42  pips_debug(1, "Module: \"%s\"\n\tuser_file: \"%s\"\n\tinstall file : \"%s\"\n", module_name, user_file, new_file);
43  FILE *out = safe_fopen(new_file, "a");
44  FILE *in = safe_fopen(step_file, "r");
45 
46  safe_cat(out, in);
47 
48  safe_fclose(out, new_file);
49  safe_fclose(in, step_file);
50  }
51 
53  free(dest_dir);
54 
55  /* Instalation des fichiers generes */
56  dest_dir = strdup(get_string_property("STEP_INSTALL_PATH"));
58  if (empty_string_p(dest_dir))
59  {
60  free(dest_dir);
62  }
63 
64  safe_system(concatenate("step_install ", dest_dir, " ", src_dir, NULL));
65 
66  free(src_dir);
67  free(dest_dir);
68 
69  debug_off();
70  return true;
71 }
bool empty_string_p(const char *s)
Definition: entity_names.c:239
char * get_string_property(const char *)
char * pips_basename(char *fullpath, char *suffix)
Definition: file.c:822
void safe_cat(FILE *out, FILE *in)
Definition: file.c:669
static FILE * user_file
These functions implements the writing of objects.
Definition: genClib.c:1485
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
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
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
Definition: hash.c:327
string db_get_directory_name_for_module(const char *name)
returns the allocated and mkdir'ed directory for module name
Definition: lowlevel.c:150
@ hash_string
Definition: newgen_hash.h:32
#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 WORKSPACE_SRC_SPACE
Definition: pipsdbm-local.h:32
static hash_table user_files
initial user file -> generated user file
Definition: unsplit.c:48

References concatenate(), db_get_directory_name_for_module(), db_get_memory_resource(), db_get_module_list_initial_order(), debug_off, debug_on, empty_string_p(), free(), gen_array_item(), gen_array_nitems(), get_string_property(), hash_get(), hash_put(), hash_string, hash_table_free(), hash_table_make(), HASH_UNDEFINED_VALUE, module_name(), out, pips_basename(), pips_debug, safe_cat(), safe_fclose(), safe_fopen(), safe_system(), strdup(), user_file, user_files, and WORKSPACE_SRC_SPACE.

+ Here is the call graph for this function:

◆ step_interlaced_p()

bool step_interlaced_p ( effect  )

◆ step_lexeralloc()

void* step_lexeralloc ( yy_size_t  )

◆ step_lexererror()

void step_lexererror ( const char *  s)

step_bison_parser.c

Definition at line 105 of file step_bison_parser.c.

106 {
107  pips_user_error("\nParsing :\n%s\n%s at '%s'\n", pragma_str_original, s, step_lexertext);
108 }
char * step_lexertext

References pips_user_error, pragma_str_original, and step_lexertext.

◆ step_lexerfree()

void step_lexerfree ( void *  )

◆ step_lexerget_debug()

int step_lexerget_debug ( void  )

◆ step_lexerget_in()

FILE* step_lexerget_in ( void  )

◆ step_lexerget_leng()

int step_lexerget_leng ( void  )

◆ step_lexerget_lineno()

int step_lexerget_lineno ( void  )

◆ step_lexerget_out()

FILE* step_lexerget_out ( void  )

◆ step_lexerget_text()

char* step_lexerget_text ( void  )

◆ step_lexerlex()

int step_lexerlex ( void  )

◆ step_lexerlex_destroy()

int step_lexerlex_destroy ( void  )

◆ step_lexerparse()

int step_lexerparse ( void  )

Referenced by step_bison_parse().

+ Here is the caller graph for this function:

◆ step_lexerpop_buffer_state()

void step_lexerpop_buffer_state ( void  )

◆ step_lexerrealloc()

void* step_lexerrealloc ( void *  ,
yy_size_t   
)

◆ step_lexerrestart()

void step_lexerrestart ( FILE *  )

◆ step_lexerset_debug()

void step_lexerset_debug ( int  )

◆ step_lexerset_in()

void step_lexerset_in ( FILE *  )

◆ step_lexerset_lineno()

void step_lexerset_lineno ( int  )

◆ step_lexerset_out()

void step_lexerset_out ( FILE *  )

◆ step_local_loop_index()

entity step_local_loop_index ( entity  module,
string  name 
)
Parameters
moduleodule
nameame

Definition at line 534 of file compile_RT.c.

535 {
537 }
#define STEP_RT_LOOP_INDEX_INTEGER
Definition: compile_RT.c:23

References module, NIL, step_local_RT_Integer(), and STEP_RT_LOOP_INDEX_INTEGER.

Referenced by generate_call_get_rank_loopbounds(), generate_call_get_workchunk_loopbounds(), loop_basic_workchunk_to_workchunk(), and loopbounds_substitution().

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

◆ step_local_loopSlices()

entity step_local_loopSlices ( entity  module,
entity  i 
)
Parameters
moduleodule

Definition at line 499 of file compile_RT.c.

500 {
501  list dims =
502  CONS(DIMENSION,
505  NIL),
508  NIL),
509  NIL));
511 }
dimension make_dimension(expression a1, expression a2, list a3)
Definition: ri.c:565
#define STEP_LOOPSLICES_NAME(index)
Definition: STEP_name.h:10
#define STEP_MAX_NB_LOOPSLICES_NAME
Definition: STEP_name.h:34
#define STEP_INDEX_SLICE_LOW_NAME
Definition: STEP_name.h:26
#define STEP_INDEX_SLICE_UP_NAME
Definition: STEP_name.h:27

References CONS, DIMENSION, int_to_expression(), make_dimension(), module, NIL, STEP_INDEX_SLICE_LOW_NAME, STEP_INDEX_SLICE_UP_NAME, step_local_RT_Integer(), STEP_LOOPSLICES_NAME, STEP_MAX_NB_LOOPSLICES_NAME, STEP_RT_LOOP_INDEX_INTEGER, and step_symbolic_expression().

+ Here is the call graph for this function:

◆ step_local_regionArray()

entity step_local_regionArray ( entity  module,
entity  array,
string  region_array_name,
expression  expr_nb_region 
)
Parameters
moduleodule
arrayrray
region_array_nameegion_array_name
expr_nb_regionxpr_nb_region

Definition at line 428 of file compile_RT.c.

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 }
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
#define MINUS_C_OPERATOR_NAME
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
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
int NumberOfDimension(entity)
Definition: size.c:588
#define expression_undefined_p(x)
Definition: ri.h:1224

References array, CONS, CreateIntrinsic(), DIMENSION, entity_name, entity_variable_p, expression_undefined_p, fortran_module_p(), free(), get_current_module_entity(), int_to_expression(), make_dimension(), MakeBinaryCall(), MINUS_C_OPERATOR_NAME, module, NIL, NumberOfDimension(), pips_assert, pips_debug, STEP_INDEX_SLICE_LOW_NAME, STEP_INDEX_SLICE_UP_NAME, step_local_RT_Integer(), STEP_RT_ARRAY_INDEX_INTEGER, step_symbolic_expression(), and strdup().

Referenced by region_to_statement().

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

◆ step_local_slice_index()

entity step_local_slice_index ( entity  module)
Parameters
moduleodule

Definition at line 486 of file compile_RT.c.

487 {
489 }
#define STEP_SLICE_INDEX_NAME
Definition: STEP_name.h:5

References module, NIL, step_local_RT_Integer(), STEP_RT_ARRAY_INDEX_INTEGER, and STEP_SLICE_INDEX_NAME.

Referenced by compute_region(), generate_call_get_workchunk_loopbounds(), and generate_loop_workchunk().

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

◆ step_parameter()

entity step_parameter ( string  name_,
entity  module,
expression  expr 
)

Fortran PARAMETER (TEST = expr)

C const int TEST=1

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"

T77: type T80: variable T31: basic 0: int T63: qualifier 0: const T70: storage 1: ram T64: ram T79: value 5: expression T44:Expression T73: syntax 2: call T33:call R74: entity"TOP-LEVEL:1"

Parameters
name_ame_
moduleodule
exprxpr

Definition at line 285 of file compile_RT.c.

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 }
value make_value_expression(expression _field_)
Definition: ri.c:2850
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
variable make_variable(basic a1, list a2, list a3)
Definition: ri.c:2895
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
entity get_top_level_entity(void)
Definition: util.c:152
static void step_add_created_symbolic(entity e)
Definition: compile_RT.c:277
void set_RT_add_local(entity e)
Definition: compile_RT.c:247
#define STEP_RT_SYMBOLIC_INTEGER
Definition: compile_RT.c:21
#define STATIC_AREA_LOCAL_NAME
Definition: naming-local.h:70
#define entity_symbolic_p(e)
@ ABSTRACT_LOCATION
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
int add_C_variable_to_area(entity, entity)
Definition: variable.c:1381
type MakeTypeVariable(basic, cons *)
BEGIN_EOLE.
Definition: type.c:116
#define QUALIFIER(x)
QUALIFIER.
Definition: ri.h:2106
#define entity_storage(x)
Definition: ri.h:2794
#define type_undefined_p(x)
Definition: ri.h:2884
#define entity_kind(x)
Definition: ri.h:2798
@ is_type_variable
Definition: ri.h:2900
#define entity_initial(x)
Definition: ri.h:2796
entity MakeParameter(entity e, expression x)
lint
Definition: expression.c:52
void AddEntityToModuleCompilationUnit(entity e, entity module)
Definition: module.c:301

References ABSTRACT_LOCATION, add_C_variable_to_area(), AddEntityToModuleCompilationUnit(), compilation_unit_of_module(), CONS, entity_initial, entity_kind, entity_storage, entity_symbolic_p, entity_type, entity_undefined_p, entity_user_name(), expression_undefined_p, FindOrCreateEntity(), fortran_module_p(), free(), get_current_module_entity(), get_current_module_name(), get_top_level_entity(), int_to_expression(), is_type_variable, make_basic_int(), make_qualifier_const(), make_ram(), make_storage_ram(), make_type(), make_value_expression(), make_variable(), MakeParameter(), MakeTypeVariable(), module, NIL, pips_assert, QUALIFIER, set_RT_add_local(), STATIC_AREA_LOCAL_NAME, step_add_created_symbolic(), STEP_RT_SYMBOLIC_INTEGER, strdup(), TOP_LEVEL_MODULE_NAME, and type_undefined_p.

Referenced by step_symbolic().

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

◆ step_parser()

bool step_parser ( const char *  module_name)
Parameters
module_nameodule_name

Definition at line 594 of file parser.c.

595 {
596  debug_on("STEP_PARSER_DEBUG_LEVEL");
597  pips_debug(1, "%d module_name = %s\n", __LINE__, module_name);
598 
601 
603 
605 
607 
608  ifdebug(1)
609  {
611  }
612 
615 
616 
620 
622 
623  pips_debug(1, "End step_parser\n");
624  debug_off();
625 
626  return true;
627 }
bool ordering_to_statement_initialized_p()
Test if the ordering to statement is initialized.
Definition: ordering.c:63
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
Definition: reorder.c:244
void step_directives_save()
Definition: directives.c:108
void step_directives_print()
Definition: directives.c:79
static void step_directive_parser(statement body)
Definition: parser.c:577

References CONS, db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, ifdebug, local_name_to_top_level_entity(), make_block_statement(), module_name(), module_reorder(), NIL, ordering_to_statement_initialized_p(), pips_debug, reset_current_module_entity(), reset_ordering_to_statement(), set_current_module_entity(), STATEMENT, step_directive_parser(), step_directives_init(), step_directives_print(), and step_directives_save().

+ Here is the call graph for this function:

◆ step_partial_p()

bool step_partial_p ( effect  )

◆ step_private_p()

bool step_private_p ( statement  stmt,
entity  e 
)
Parameters
stmttmt

Definition at line 424 of file directives.c.

425 {
426  pips_debug(4, "begin\n");
428  list private_l;
430  pips_debug(4, "end\n");
431  return gen_in_list_p(e, private_l);
432 }
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
Definition: list.c:734
static list step_directive_omp_get_private_entities(step_directive directive)
Definition: directives.c:404

References gen_in_list_p(), pips_debug, step_directive_omp_get_private_entities(), and step_directives_load().

Referenced by create_step_regions().

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

◆ step_RT_clean_local()

void step_RT_clean_local ( void  )

reinitialisation du type sinon, la recompilation echoue

Definition at line 255 of file compile_RT.c.

256 {
258  return;
259 
260  /* reinitialisation du type sinon, la recompilation echoue */
262  {
264  {
271  }
272  }
274 }
void free_storage(storage p)
Definition: ri.c:2231
void free_type(type p)
Definition: ri.c:2658
void free_value(value p)
Definition: ri.c:2787
#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
#define value_undefined
Definition: ri.h:3016
#define type_undefined
Definition: ri.h:2883
#define storage_undefined
Definition: ri.h:2476

References entity_initial, entity_storage, entity_type, free_storage(), free_type(), free_value(), set_clear(), SET_FOREACH, set_undefined_p, step_created_entity, storage_undefined, type_undefined, type_undefined_p, and value_undefined.

Referenced by compile_mpi().

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

◆ step_RT_set_local_declarations()

void step_RT_set_local_declarations ( entity  module,
statement  body 
)
Parameters
moduleodule
bodyody

Definition at line 376 of file compile_RT.c.

377 {
379  {
381  }
382 
384 }
static list local_declaration
Definition: compile_RT.c:374
void AddLocalEntityToDeclarations(entity, entity, statement)
Add the variable entity e to the list of variables of the function module.
Definition: variable.c:233

References AddLocalEntityToDeclarations(), ENTITY, FOREACH, local_declaration, module, and NIL.

Referenced by compile_mpi().

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

◆ step_symbolic()

entity step_symbolic ( string  name,
entity  module 
)
Parameters
nameame
moduleodule

Definition at line 348 of file compile_RT.c.

349 {
351 }
entity step_parameter(string name_, entity module, expression expr)
Definition: compile_RT.c:285
#define expression_undefined
Definition: ri.h:1223

References expression_undefined, module, and step_parameter().

Referenced by step_symbolic_expression().

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

◆ step_symbolic_expression()

expression step_symbolic_expression ( string  name,
entity  module 
)
Parameters
nameame
moduleodule

Definition at line 353 of file compile_RT.c.

354 {
356 }
entity step_symbolic(string name, entity module)
Definition: compile_RT.c:348

References entity_to_expression(), module, and step_symbolic().

Referenced by bound_to_statement(), build_call_STEP_AllToAll(), generate_call_construct_begin_construct_end(), region_to_statement(), step_local_loopSlices(), and step_local_regionArray().

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

◆ step_type()

entity step_type ( entity  data)

Definition at line 542 of file compile_RT.c.

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 }
#define STEP_INTEGER2_NAME
Definition: STEP_name.h:29
#define STEP_REAL4_NAME
Definition: STEP_name.h:43
#define STEP_COMPLEX16_NAME
Definition: STEP_name.h:20
#define STEP_COMPLEX8_NAME
Definition: STEP_name.h:21
#define STEP_INTEGER1_NAME
Definition: STEP_name.h:28
#define STEP_REAL8_NAME
Definition: STEP_name.h:44
#define STEP_INTEGER8_NAME
Definition: STEP_name.h:31
#define STEP_INTEGER4_NAME
Definition: STEP_name.h:30
entity MakeConstant(string name, tag bt)
Make a Fortran constant.
Definition: constant.c:351
@ 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 basic_int(x)
Definition: ri.h:616
#define basic_tag(x)
Definition: ri.h:613
#define basic_float(x)
Definition: ri.h:619
#define basic_complex(x)
Definition: ri.h:628
#define variable_basic(x)
Definition: ri.h:3120

References basic_complex, basic_float, basic_int, basic_tag, entity_name, entity_type, entity_undefined, entity_undefined_p, is_basic_complex, is_basic_float, is_basic_int, is_basic_string, MakeConstant(), pips_assert, pips_debug, pips_user_error, STEP_COMPLEX16_NAME, STEP_COMPLEX8_NAME, STEP_INTEGER1_NAME, STEP_INTEGER2_NAME, STEP_INTEGER4_NAME, STEP_INTEGER8_NAME, STEP_REAL4_NAME, STEP_REAL8_NAME, type_variable, type_variable_p, and variable_basic.

Referenced by build_call_STEP_init_regionArray(), call_STEP_subroutine(), check_entity_step_type(), and compile_reduction().

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

◆ store_step_comm()

void store_step_comm ( void  )

Definition at line 206 of file analyse.c.

207 {
208  step_comm comms = (step_comm)db_get_memory_resource(DBR_STEP_COMM, "", true);
209 
210  step_comm_path(comms) = get_step_effect_path();
211  step_comm_interlaced(comms) = get_step_interlaced();
212  step_comm_partial(comms) = get_step_partial();
213 
214  DB_PUT_MEMORY_RESOURCE(DBR_STEP_COMM, "", comms);
215 
216  reset_step_effect_path();
217  reset_step_interlaced();
218  reset_step_partial();
219 }

References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, step_comm_interlaced, step_comm_partial, and step_comm_path.

Referenced by step_analyse().

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

Variable Documentation

◆ comment2pragma_flex_debug

int comment2pragma_flex_debug
extern

◆ comment2pragmain

FILE* comment2pragmain
extern

◆ comment2pragmaleng

int comment2pragmaleng
extern

◆ comment2pragmalineno

int comment2pragmalineno
extern

◆ comment2pragmaout

FILE* comment2pragmaout
extern

◆ comment2pragmatext

char* comment2pragmatext
extern

◆ step_created_entity

set step_created_entity
extern

◆ step_created_symbolic

set step_created_symbolic
extern

Definition at line 276 of file compile_RT.c.

Referenced by step_add_created_symbolic(), and update_referenced_entities().

◆ step_lexer_flex_debug

int step_lexer_flex_debug
extern

◆ step_lexerchar

int step_lexerchar
extern

◆ step_lexerdebug

int step_lexerdebug
extern

◆ step_lexerin

FILE* step_lexerin
extern

◆ step_lexerleng

int step_lexerleng
extern

◆ step_lexerlineno

int step_lexerlineno
extern

◆ step_lexernerrs

int step_lexernerrs
extern

◆ step_lexerout

FILE* step_lexerout
extern

◆ step_lexertext

char* step_lexertext
extern

Referenced by step_lexererror().