PIPS
compile_RT.c File Reference
#include <stdarg.h>
#include "defines-local.h"
#include "syntax.h"
#include "c_syntax.h"
#include "workspace-util.h"
#include "prettyprint.h"
+ Include dependency graph for compile_RT.c:

Go to the source code of this file.

Macros

#define STEP_RT_INTEGER4   DEFAULT_INTEGER_TYPE_SIZE
 
#define STEP_RT_INTEGER8   DEFAULT_LONG_LONG_INTEGER_TYPE_SIZE
 
#define STEP_RT_SYMBOLIC_INTEGER   STEP_RT_INTEGER4
 
#define STEP_RT_ARRAY_INDEX_INTEGER   STEP_RT_INTEGER4
 
#define STEP_RT_LOOP_INDEX_INTEGER   STEP_RT_INTEGER4
 

Functions

expression get_expression_addr (expression expr)
 compile_RT.c More...
 
static expression cast_STEP_ARG (expression expr, bool ptr)
 
void generate_call_construct_begin_construct_end (entity new_module, step_directive drt, statement mpi_begin_stmt, statement mpi_end_stmt)
 
void generate_call_flush (statement *stepalltoall_stmt)
 
void generate_loop_workchunk (entity mpi_module, statement *compute_regions_stmt)
 
void generate_call_get_workchunk_loopbounds (entity mpi_module, loop loop_stmt, statement *compute_regions_stmt)
 
statement generate_call_get_rank_loopbounds (entity new_module, loop loop_stmt)
 
statement generate_call_get_rank (entity new_module)
 
statement generate_call_compute_loopslices (entity new_module, loop loop_stmt)
 
statement generate_call_get_commsize (entity new_module)
 
void generate_call_init_regionArray (list referenced_entities, statement before, statement __attribute__((unused)) after)
 
void set_RT_add_local (entity e)
 
void step_RT_clean_local ()
 
static void step_add_created_symbolic (entity e)
 
entity step_parameter (string name_, entity module, expression expr)
 
entity step_symbolic (string name, entity module)
 
expression step_symbolic_expression (string name, entity module)
 
expression step_function (string name, list args)
 
void step_RT_set_local_declarations (entity module, statement body)
 
static entity step_local_RT_Integer (int size_of_integer, entity mpi_module, string name_, list dims)
 
entity step_local_regionArray (entity module, entity array, string region_array_name, expression expr_nb_region)
 
entity step_local_slice_index (entity module)
 
entity step_local_loopSlices (entity module, entity i)
 
entity get_entity_step_rank (entity module)
 
entity get_entity_step_commsize (entity module)
 Que signifie local? More...
 
entity step_local_loop_index (entity module, string name)
 
entity step_type (entity data)
 
statement build_call_STEP_init_regionArray (entity array)
 
statement build_call_STEP_AllToAll (entity module, entity array, bool is_partial, bool is_interlaced)
 
statement build_call_STEP_WaitAll (list comm_stmt)
 
statement build_call_STEP_set_sendregions (entity user_array, expression expr_nb_workchunk, entity regions_array, bool is_interlaced, bool is_reduction)
 
statement build_call_STEP_set_recvregions (entity user_array, expression expr_nb_workchunk, entity regions_array)
 
statement build_call_STEP_flush ()
 
statement call_STEP_subroutine3 (string name,...)
 
statement call_STEP_subroutine2 (string name,...)
 
void check_entity_step_type (entity data)
 
statement call_STEP_subroutine (string name, list args, entity data)
 

Variables

set step_created_entity = set_undefined
 
set step_created_symbolic = set_undefined
 
static list local_declaration = NIL
 

Macro Definition Documentation

◆ STEP_RT_ARRAY_INDEX_INTEGER

#define STEP_RT_ARRAY_INDEX_INTEGER   STEP_RT_INTEGER4

Definition at line 22 of file compile_RT.c.

◆ STEP_RT_INTEGER4

#define STEP_RT_INTEGER4   DEFAULT_INTEGER_TYPE_SIZE

Definition at line 18 of file compile_RT.c.

◆ STEP_RT_INTEGER8

#define STEP_RT_INTEGER8   DEFAULT_LONG_LONG_INTEGER_TYPE_SIZE

Definition at line 19 of file compile_RT.c.

◆ STEP_RT_LOOP_INDEX_INTEGER

#define STEP_RT_LOOP_INDEX_INTEGER   STEP_RT_INTEGER4

Definition at line 23 of file compile_RT.c.

◆ STEP_RT_SYMBOLIC_INTEGER

#define STEP_RT_SYMBOLIC_INTEGER   STEP_RT_INTEGER4

Definition at line 21 of file compile_RT.c.

Function Documentation

◆ 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
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#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 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 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
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
#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
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
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 }
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
#define ADDRESS_OF_OPERATOR_NAME
bool fortran_module_p(entity m)
Test if a module is in Fortran.
Definition: entity.c:2799
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:

◆ cast_STEP_ARG()

static expression cast_STEP_ARG ( expression  expr,
bool  ptr 
)
static

Definition at line 40 of file compile_RT.c.

41 {
43  return expr;
44 
46  entity step_arg_e = FindOrCreateEntity(cu, TYPEDEF_PREFIX "STEP_ARG");
47 
48  if(storage_undefined_p(entity_storage(step_arg_e)))
49  {
50  entity_storage(step_arg_e) = make_storage_rom();
51  put_new_typedef("STEP_ARG");
52  }
53 
54  type step_arg_t = MakeTypeVariable(make_basic_typedef(step_arg_e), NIL);
55  if(ptr)
56  step_arg_t = MakeTypeVariable(make_basic_pointer(step_arg_t), NIL);
57  return MakeCastExpression(step_arg_t, expr);
58 }
basic make_basic_typedef(entity _field_)
Definition: ri.c:185
storage make_storage_rom(void)
Definition: ri.c:2285
basic make_basic_pointer(type _field_)
Definition: ri.c:179
void put_new_typedef(const char *)
This function is used by libraries "step"* and "task_parallelization".
Definition: util.c:1078
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
const char * get_current_module_name(void)
Get the name of the current module.
Definition: static.c:121
#define TYPEDEF_PREFIX
Definition: naming-local.h:62
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
expression MakeCastExpression(type t, expression e)
Definition: expression.c:3911
type MakeTypeVariable(basic, cons *)
BEGIN_EOLE.
Definition: type.c:116
#define entity_storage(x)
Definition: ri.h:2794
#define storage_undefined_p(x)
Definition: ri.h:2477

References compilation_unit_of_module(), entity_storage, FindOrCreateEntity(), fortran_module_p(), get_current_module_entity(), get_current_module_name(), make_basic_pointer(), make_basic_typedef(), make_storage_rom(), MakeCastExpression(), MakeTypeVariable(), NIL, put_new_typedef(), storage_undefined_p, and TYPEDEF_PREFIX.

Referenced by build_call_STEP_set_recvregions(), and build_call_STEP_set_sendregions().

+ Here is the call graph for this function:
+ Here is the caller 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:

◆ 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
Definition: statement.c:54

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 insert_statement(statement, statement, bool)
This is the normal entry point.
Definition: statement.c:2570
#define string_undefined_p(s)
Definition: newgen_types.h:41
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
list statement_block(statement)
Get the list of block statements of a statement sequence.
Definition: statement.c:1338

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  referenced_entities,
statement  before,
statement __attribute__((unused))  after 
)

Definition at line 210 of file compile_RT.c.

211 {
212  list init_block = NIL;
213 
214  /*
215  Generation of
216 
217  STEP_INIT_ARRAYREGIONS(a, STEP_INTEGER4, 1, 0, 100000-1);
218  */
219 
220  pips_debug(1, "begin\n");
221 
222  FOREACH(ENTITY, e, referenced_entities)
223  {
225  {
226  pips_debug(2,"build_call_STEP_init_regionArray entity %s\n", entity_name(e));
227  init_block = CONS(STATEMENT, build_call_STEP_init_regionArray(e), init_block);
228  }
229  }
230  insert_statement(before, make_block_statement(gen_nreverse(init_block)), false);
231 
232  pips_debug(1, "end\n");
233 }
statement build_call_STEP_init_regionArray(entity array)
Definition: compile_RT.c:600
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755

References build_call_STEP_init_regionArray(), CONS, ENTITY, entity_name, entity_scalar_p(), entity_type, FOREACH, gen_nreverse(), insert_statement(), make_block_statement(), NIL, pips_debug, STATEMENT, and type_variable_p.

Referenced by compile_body().

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

◆ 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
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
Definition: statement.c:597
statement make_empty_block_statement(void)
Build an empty statement (block/sequence)
Definition: statement.c:625
entity entity_empty_label(void)
Definition: entity.c:1105

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:

◆ 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_add_created_symbolic()

static void step_add_created_symbolic ( entity  e)
static

Definition at line 277 of file compile_RT.c.

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

Referenced by step_parameter().

+ Here is the call graph for this function:
+ 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 }
#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
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
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410

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_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_RT_Integer()

static entity step_local_RT_Integer ( int  size_of_integer,
entity  mpi_module,
string  name_,
list  dims 
)
static

Definition at line 386 of file compile_RT.c.

387 {
388  pips_debug(1, "begin mpi_module = %s, name_ = %s\n", entity_name(mpi_module), name_);
389  string name = strdup(name_);
390  entity e = FindOrCreateEntity(entity_user_name(mpi_module), name);
391  pips_assert("not null", e != NULL);
392  pips_assert("entity defined", !entity_undefined_p(e));
393 
395  {
396  pips_debug(2, "create entity VERIFIER CE MESSAGE\n");
397 
399  entity_type(e) = MakeTypeVariable(make_basic_int(size_of_integer), dims);
402  if(mpi_module != get_current_module_entity())
404  }
405  else
406  pips_debug(2, "entity already exists\n");
407 
408  pips_assert("variable", entity_variable_p(e));
409  free(name);
410 
411  set_RT_add_local(e);
412 
413  pips_debug(1, "end\n");
414  return e;
415 }
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
storage make_storage_ram(ram _field_)
Definition: ri.c:2279
void set_RT_add_local(entity e)
Definition: compile_RT.c:247
static list local_declaration
Definition: compile_RT.c:374
#define DYNAMIC_AREA_LOCAL_NAME
Definition: naming-local.h:69
@ ABSTRACT_LOCATION
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
Definition: entity.c:487
int add_variable_to_area(entity, entity)
Definition: variable.c:1376
#define type_undefined_p(x)
Definition: ri.h:2884
#define entity_kind(x)
Definition: ri.h:2798

References ABSTRACT_LOCATION, add_variable_to_area(), CONS, DYNAMIC_AREA_LOCAL_NAME, ENTITY, entity_kind, entity_name, entity_storage, entity_type, entity_undefined_p, entity_user_name(), entity_variable_p, FindOrCreateEntity(), free(), gen_nconc(), get_current_module_entity(), local_declaration, make_basic_int(), make_ram(), make_storage_ram(), MakeTypeVariable(), NIL, pips_assert, pips_debug, set_RT_add_local(), strdup(), and type_undefined_p.

Referenced by get_entity_step_commsize(), get_entity_step_rank(), step_local_loop_index(), step_local_loopSlices(), step_local_regionArray(), and step_local_slice_index().

+ 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
variable make_variable(basic a1, list a2, list a3)
Definition: ri.c:2895
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
#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)
int add_C_variable_to_area(entity, entity)
Definition: variable.c:1381
#define QUALIFIER(x)
QUALIFIER.
Definition: ri.h:2106
@ 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_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 }
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
#define pips_user_error
Definition: misc-local.h:147
@ 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:

Variable Documentation

◆ local_declaration

list local_declaration = NIL
static

Definition at line 374 of file compile_RT.c.

Referenced by step_local_RT_Integer(), and step_RT_set_local_declarations().

◆ step_created_entity

◆ step_created_symbolic

set step_created_symbolic = set_undefined

Definition at line 276 of file compile_RT.c.

Referenced by step_add_created_symbolic(), and update_referenced_entities().