10 #include "pips_config.h"
21 bool same_var, same_act;
29 return(same_var && same_act);
34 bool interlaced =
false;
35 pips_debug(1,
"begin send_regions = %p, r = %p\n", send_regions, r);
57 bool is_reduction =
false;
72 bool partial_p =
true;
88 pips_debug(1,
"end partial_p = %d\n", partial_p);
98 pips_debug(1,
"begin array_region = %p\n", array_region);
197 bool found_equality=
false;
207 bool up_bound = (coef_phi > 0);
208 bool low_bound = !up_bound;
217 for (coord = v; coord!=NULL; coord=coord->
succ)
219 coef_phi = -coef_phi;
227 if (equality || low_bound)
229 if (equality || up_bound)
233 found_equality = equality;
237 return found_equality;
265 pips_debug(1,
"begin array_region = %p\n", array_region);
269 if(
ENDP(bounds_array))
283 list phi_free_contraints =
NIL;
286 if (!
ENDP(phi_free_contraints))
335 if (!
ENDP(phi_free_contraints))
349 if (!
ENDP(phi_free_contraints))
358 empty_region_stmt))),
360 string comment_str =
strdup(
" Inverted bounds correspond to empty regions\n Used when work concerns specific data ex: print A[5]\n In this case, only concerned process sends non empty regions\n");
433 pips_debug(2,
"region_array_name = %s\n", region_array_name);
436 pips_debug(2,
"region_array = %p\n", region_array);
441 compute_region(mpi_module, reg, region_array, loop_p, compute_regions_stmt);
463 pips_debug(1,
"begin regions_l = %p, pure_send_l = %p\n", regions_l, send_as_comm_l);
475 region_to_statement(mpi_module, reg, loop_p, is_reduction, is_interlaced, is_partial, compute_regions_stmt, set_regionarray_stmt, stepalltoall_stmt);
500 statement compute_regions_stmt, set_regions_stmt, flush_regions_stmt;
502 pips_debug(1,
"begin regions_l = %p\n", regions_l);
505 &compute_regions_stmt, &set_regions_stmt, &flush_regions_stmt);
call make_call(entity a1, list a2)
expression copy_expression(expression p)
EXPRESSION.
reference make_reference(entity a1, list a2)
test make_test(expression a1, statement a2, statement a3)
void free_expression(expression p)
instruction make_instruction(enum instruction_utype tag, void *val)
void free_statement(statement p)
#define STEP_MAX_NB_LOOPSLICES_NAME
#define STEP_INDEX_SLICE_LOW_NAME
#define STEP_INDEX_SLICE_UP_NAME
#define STEP_SR_NAME(array)
#define STEP_RR_NAME(array)
bool step_interlaced_p(region reg)
bool step_partial_p(region reg)
#define VALUE_TO_INT(val)
statement build_call_STEP_set_recvregions(entity user_array, expression expr_nb_workchunk, entity regions_array)
expression step_symbolic_expression(string name, entity module)
void generate_call_flush(statement *stepalltoall_stmt)
entity step_local_regionArray(entity module, entity array, string region_array_name, expression expr_nb_region)
entity get_entity_step_commsize(entity module)
Que signifie local?
void generate_call_get_workchunk_loopbounds(entity mpi_module, loop loop_stmt, statement *compute_regions_stmt)
statement build_call_STEP_set_sendregions(entity user_array, expression expr_nb_workchunk, entity regions_array, bool is_interlaced, bool is_reduction)
entity step_local_slice_index(entity module)
statement build_call_STEP_AllToAll(entity module, entity array, bool is_partial, bool is_interlaced)
void generate_loop_workchunk(entity mpi_module, statement *compute_regions_stmt)
static void region_to_statement(entity mpi_module, region reg, bool loop_p, bool is_reduction, bool is_interlaced, bool is_partial, statement *compute_regions_stmt, statement *set_regionarray_stmt, statement *stepalltoall_stmt)
static bool combinable_regions_p(region r1, region r2)
Copyright 2007-2012 Alain Muller, Frederique Silber-Chaussumier.
static statement bound_to_statement(entity mpi_module, list expr_bound, entity array_region, string bound_name, int dim, list index)
static bool contraintes_to_expression(bool equality, entity phi, Psysteme sys, list *expr_l, list *expr_u)
void compile_regions(entity new_module, list regions_l, bool loop_p, loop loop_stmt, list send_as_comm_l, set reductions_l[STEP_UNDEF_REDUCE], statement mpi_begin_stmt, statement mpi_end_stmt)
static list phi_free_contraints_to_expressions(bool equality, region reg)
static bool comm_partial_p(list send_regions, region r)
static void generate_call_stepalltoall(entity mpi_module, region reg, bool is_reduction, bool is_interlaced, bool is_partial, statement *stepalltoall_stmt)
pourquoi flush et non pas alltoall ?
static void generate_call_set_regionarray(entity mpi_module, region reg, entity array_region, bool loop_p, bool is_reduction, bool is_interlaced, statement *set_regions_stmt)
static bool reduction_p(set reductions_l[STEP_UNDEF_REDUCE], entity e)
static void transform_regions_to_statement(entity mpi_module, list regions_l, bool loop_p, list send_as_comm_l, set reductions_l[STEP_UNDEF_REDUCE], statement *compute_regions_stmt, statement *set_regionarray_stmt, statement *stepalltoall_stmt)
static bool region_interlaced_p(list send_regions, region r)
static void add_workchunk_loop(entity mpi_module, bool loop_p, loop loop_stmt, statement *compute_regions_stmt)
static bool region_reduction_p(set reductions_l[STEP_UNDEF_REDUCE], region reg)
static void compute_region(entity mpi_module, region reg, entity array_region, bool loop_p, statement *compute_regions_stmt)
#define CONTRAINTE_UNDEFINED_P(c)
#define region_write_p(reg)
#define region_action(reg)
#define region_entity(reg)
#define region_system(reg)
#define region_read_p(reg)
useful region macros
#define region_undefined_p(reg)
#define region
simulation of the type region
text text_rw_array_regions(list)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
bool action_equal_p(action, action)
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
statement make_empty_block_statement(void)
Build an empty statement (block/sequence)
entity get_current_module_entity(void)
Get the entity of the current module.
#define ENDP(l)
Test if a list is empty.
#define list_undefined_p(c)
Return if a list is undefined.
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
list gen_full_copy_list(list l)
Copy a list structure with element copy.
list statement_block(statement)
Get the list of block statements of a statement sequence.
statement make_assign_statement(expression, expression)
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...
void insert_statement(statement, statement, bool)
This is the normal entry point.
statement make_plain_continue_statement(void)
Make a simple continue statement to be used as a NOP or ";" in C.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
bool set_belong_p(const set, const void *)
void print_statement(statement)
Print a statement on stderr.
#define MAX_OPERATOR_NAME
#define C_LESS_OR_EQUAL_OPERATOR_NAME
#define C_AND_OPERATOR_NAME
#define EQUAL_OPERATOR_NAME
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define MINUS_C_OPERATOR_NAME
#define LESS_OR_EQUAL_OPERATOR_NAME
#define C_EQUAL_OPERATOR_NAME
#define MIN_OPERATOR_NAME
bool c_module_p(entity m)
Test if a module "m" is written in C.
bool fortran_module_p(entity m)
Test if a module is in Fortran.
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
expression make_vecteur_expression(Pvecteur pv)
make expression for vector (Pvecteur)
expression reference_to_expression(reference r)
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
expression expression_list_to_binary_operator_call(list l, entity op)
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
expression call_to_expression(call c)
Build an expression that call a function or procedure.
#define syntax_reference(x)
#define reference_variable(x)
#define dimension_lower(x)
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
#define dimension_upper(x)
#define reference_indices(x)
#define variable_dimensions(x)
#define expression_syntax(x)
#define statement_undefined
Psysteme sc_safe_elim_redund(Psysteme ps)
Same as above, but the basis is preserved and sc_empty is returned is the system is not feasible.
Value b1
booleen indiquant quel membre est en cours d'analyse
#define STEP_UNDEF_REDUCE
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
string text_to_string(text t)
SG: moved here from ricedg.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Pvecteur vect_del_var(Pvecteur v_in, Variable var)
Pvecteur vect_del_var(Pvecteur v_in, Variable var): allocation d'un nouveau vecteur egal a la project...
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...