PIPS
|
#include "defines-local.h"
Go to the source code of this file.
Functions | |
static expression | pvm_encoding_option (int n) |
HPFC module by Fabien COELHO. More... | |
statement | define_node_processor_id (entity proc, entity(*creation)(int)) |
builds a statement VAR_i = MYPOS(i, proc_number) // i=1 to proc dimension More... | |
statement | generate_deducables (list le) |
statement generate_deducables(list le) More... | |
list | hpfc_gen_n_vars_expr (entity(*creation)(), int number) |
of expression More... | |
expression | make_reference_expression (entity e, entity(*creation)()) |
statement | hpfc_add_n (entity var, int n) |
returns statement VAR = VAR + N More... | |
statement | hpfc_add_2 (expression exp) |
expr = expr + 2 More... | |
statement | hpfc_message (expression tid, expression channel, bool send) |
statement | hpfc_lazy_guard (bool snd, statement then) |
returns if (LAZY_{SEND,RECV}) then More... | |
static statement | hpfc_lazy_message (expression tid, expression channel, bool snd) |
IF (LAZY_snd) THEN PVMFsnd() LAZY_snd = false // if receive ENDIF. More... | |
statement | hpfc_generate_message (entity ld, bool send, bool lazy) |
statement | hpfc_initsend (bool lazy) |
static entity | hpfc_buffer_entity (entity array, string suffix) |
returns the buffer entity for array More... | |
expression | hpfc_buffer_reference (entity array, entity index) |
returns a reference to the typed common hpfc_buffer buffer, that suits array basic type and with index as an index. More... | |
static expression | buffer_full_condition (entity array, bool is_send, bool is_full) |
generates the condition for testing the buffer state: returns (BUFFER_INDEX. More... | |
statement | hpfc_buffer_packing (entity array, entity(*creation)(), bool pack) |
array(creation) = buffer(current++) or reverse assignment... More... | |
static entity | hpfc_ith_broadcast_function (int dim, bool special) |
whether to use the special version More... | |
static statement | hpfc_broadcast_buffers (entity src, entity trg, entity lid, entity proc) |
send the buffer, possibly a broadcast. More... | |
statement | hpfc_packing_of_current__buffer (entity array, bool pack) |
CALL (pvmtype) HPFC {,UN}PACK. More... | |
statement | hpfc_broadcast_if_necessary (entity array, entity trg, entity lid, entity proc, bool is_lazy) |
lazy or not... More... | |
statement | hpfc_lazy_buffer_packing (entity src, entity trg, entity lid, entity proc, entity(*array_dim)(), bool is_send, bool is_lazy) |
lazy in actually sending or not the packed buffer immediatly... More... | |
statement | hpfc_buffer_initialization (bool is_send, _UNUSED_ bool is_lazy, bool job_was_done) |
statement | hpfc_lazy_packing (entity array, entity lid, entity(*creation)(), bool pack, bool lazy) |
the lazy issues. More... | |
statement | hpfc_compute_lid (entity lid, entity proc, entity(*creation)(), entity array) |
statement st_compute_lid(proc) More... | |
|
static |
generates the condition for testing the buffer state: returns (BUFFER_INDEX.
[eq|ne].BUFFER_[|RCV]SIZE) depending on swtiches. TRUE: is full, FALSE: is not empty
is_send | array for the typed buffer size |
is_full | while sending or receiving |
Definition at line 281 of file generate-util.c.
References array, BUFFER_INDEX, BUFFER_RCV_SIZE, BUFSZ, entity_intrinsic(), entity_to_expression(), EQUAL_OPERATOR_NAME, hpfc_buffer_entity(), hpfc_name_to_entity(), is_basic_int, MakeBinaryCall(), MakeConstant(), and NON_EQUAL_OPERATOR_NAME.
Referenced by hpfc_broadcast_if_necessary(), and hpfc_lazy_buffer_packing().
builds a statement VAR_i = MYPOS(i, proc_number) // i=1 to proc dimension
of expression
of statement
proc | roc |
Definition at line 49 of file generate-util.c.
References CONS, entity_to_expression(), EXPRESSION, hpfc_name_to_entity(), int_to_expression(), load_hpf_number(), make_assign_statement(), make_block_statement(), make_reference(), MYPOS, NIL, NumberOfDimension(), reference_to_expression(), and STATEMENT.
Referenced by GENERATION(), and processor_loop().
statement generate_deducables(list le)
the le list of expression is used to generate the deducables. The fields of interest are the variable which is referenced and the normalized field which is the expression that is going to be used to define the variable.
le | of expression |
Definition at line 83 of file generate-util.c.
References CONS, EXPRESSION, expression_normalized, expression_reference(), gen_copy_seq(), gen_free_list(), gen_nreverse(), make_block_statement(), MAP, NIL, normalized_linear, Pvecteur_to_assign_statement(), reference_variable, and STATEMENT.
Referenced by elements_loop(), generate_io_statements_for_shared_arrays(), and GENERATION().
statement hpfc_add_2 | ( | expression | exp | ) |
expr = expr + 2
exp | xp |
Definition at line 141 of file generate-util.c.
References copy_expression(), entity_intrinsic(), exp, int_to_expression(), make_assign_statement(), MakeBinaryCall(), and PLUS_OPERATOR_NAME.
Referenced by hpfc_message().
returns statement VAR = VAR + N
added value
var | ar |
n | integer scalar variable |
Definition at line 128 of file generate-util.c.
References entity_intrinsic(), entity_to_expression(), int_to_expression(), make_assign_statement(), MakeBinaryCall(), and PLUS_OPERATOR_NAME.
Referenced by hpfc_buffer_packing().
send the buffer, possibly a broadcast.
unconditional ? if non empty ? generates hpfc_broadcast_x as required. ??? hardwired for remappings... processor related to the array... (redundant!?)
of expression
??? possible replication on sections overlooked here
an argument needed by the special function
trg | source array |
lid | should be the target array |
proc | broadcast base, maybe partial?! |
Definition at line 344 of file generate-util.c.
References call_to_statement, CONS, contrainte_vecteur, contraintes_free(), entity_to_expression(), EXPRESSION, full_linearization(), get_bool_property(), get_ith_temporary_dummy(), hpfc_ith_broadcast_function(), int_to_expression(), load_hpf_number(), make_call(), NIL, NumberOfDimension(), processors_dim_replicated_p(), replicated_p(), SizeOfIthDimension(), src, Value_to_expression(), and vect_coeff().
Referenced by hpfc_broadcast_if_necessary(), and hpfc_lazy_buffer_packing().
statement hpfc_broadcast_if_necessary | ( | entity | array, |
entity | trg, | ||
entity | lid, | ||
entity | proc, | ||
bool | is_lazy | ||
) |
lazy or not...
array | rray |
trg | remapped source array |
lid | remapped target array |
proc | lid for target processor(s) |
is_lazy | target processor |
Definition at line 404 of file generate-util.c.
References array, buffer_full_condition(), CONS, entity_to_expression(), entity_undefined, hpfc_broadcast_buffers(), hpfc_name_to_entity(), hpfc_packing_of_current__buffer(), make_block_statement(), make_continue_statement(), make_test(), NIL, not_expression, SND_NOT_INIT, STATEMENT, and test_to_statement.
Referenced by gen().
returns the buffer entity for array
Definition at line 254 of file generate-util.c.
References array, concatenate(), entity_basic(), hpfc_name_to_entity(), and pvm_what_options().
Referenced by buffer_full_condition(), hpfc_buffer_reference(), hpfc_lazy_buffer_packing(), and hpfc_packing_of_current__buffer().
of statement
set_expression(hpfc_name_to_entity(BUFFER_ENCODING), pvm_encoding_option(2))
Definition at line 492 of file generate-util.c.
References BUFFER_INDEX, BUFFER_RCV_SIZE, CONS, entity_undefined, hpfc_name_to_entity(), int_to_expression(), make_block_statement(), make_continue_statement(), NIL, RCV_NOT_PRF, set_expression, set_integer, set_logical, SND_NOT_INIT, and STATEMENT.
Referenced by gen(), generate_io_statements_for_shared_arrays(), hpfc_hmessage(), and hpfc_nrecv().
array(creation) = buffer(current++) or reverse assignment...
Definition at line 305 of file generate-util.c.
References array, BUFFER_INDEX, CONS, hpfc_add_n(), hpfc_buffer_reference(), hpfc_name_to_entity(), make_assign_statement(), make_block_statement(), make_reference_expression(), NIL, and STATEMENT.
Referenced by generate_io_statements_for_shared_arrays(), hpfc_lazy_buffer_packing(), and hpfc_lazy_packing().
expression hpfc_buffer_reference | ( | entity | array, |
entity | index | ||
) |
returns a reference to the typed common hpfc_buffer buffer, that suits array basic type and with index as an index.
index variable
array | rray |
index | array to select the right typed buffer |
Definition at line 267 of file generate-util.c.
References array, BUFFER, CONS, entity_to_expression(), EXPRESSION, hpfc_buffer_entity(), make_reference(), NIL, and reference_to_expression().
Referenced by hpfc_buffer_packing().
statement st_compute_lid(proc)
T_LID=CMP_LID(pn, pi...)
if array is not NULL, partial according to array. the offset is shifted as if proc dimensions were normalized, in order to match the runtime library hpfc_broadcast_* expectations. to be used for partial (broadcasts...)
remove distributed dimensions from the constraint and normalize the partial system so that dims are 0:...
proc | variable to be assigned to |
creation | processor arrangement |
array | individual variables |
Definition at line 553 of file generate-util.c.
References array, CMP_LID, CONS, contrainte_vecteur, contraintes_free(), entity_to_expression(), entity_undefined_p, EXPRESSION, full_linearization(), gen_nconc(), get_bool_property(), get_entity_dimensions(), hpfc_gen_n_vars_expr(), hpfc_name_to_entity(), int_to_expression(), int_to_value, load_hpf_number(), make_assign_statement(), make_call_expression(), make_list_of_constant(), NumberOfDimension(), pips_assert, processors_dim_replicated_p(), Pvecteur_to_assign_statement(), TCST, value_mult, value_uminus, vect_add_elem(), and vect_coeff().
Referenced by broadcast(), hpfc_hmessage(), and processor_loop().
of expression
Definition at line 102 of file generate-util.c.
References CONS, entity_to_expression(), EXPRESSION, NIL, and pips_assert.
Referenced by hpfc_compute_lid(), and make_reference_expression().
ld | d |
send | end |
lazy | azy |
Definition at line 208 of file generate-util.c.
References CONS, copy_expression(), entity_to_expression(), EXPRESSION, hpfc_lazy_message(), hpfc_message(), hpfc_name_to_entity(), make_reference(), NIL, NODETIDS, RECV_CHANNELS, reference_to_expression(), and SEND_CHANNELS.
Referenced by broadcast(), gen(), and hpfc_lazy_packing().
2 args to pvmfinitsend
lazy | azy |
Definition at line 229 of file generate-util.c.
References BUFID, CONS, entity_to_expression(), EXPRESSION, hpfc_make_call_statement(), hpfc_name_to_entity(), init, LAZY_SEND, make_block_statement(), NIL, pvm_encoding_option(), PVM_INITSEND, set_logical, and STATEMENT.
Referenced by gen().
whether to use the special version
??? static buffer size
special | number of dimensions of the broadcast |
Definition at line 327 of file generate-util.c.
References asprintf, BROADCAST, buffer, free(), GUARDED_BRD, and MakeRunTimeSupportSubroutine().
Referenced by hpfc_broadcast_buffers().
statement hpfc_lazy_buffer_packing | ( | entity | src, |
entity | trg, | ||
entity | lid, | ||
entity | proc, | ||
entity(*)() | array_dim, | ||
bool | is_send, | ||
bool | is_lazy | ||
) |
lazy in actually sending or not the packed buffer immediatly...
means you send the buffer directly, without packing...
of statement
array being manipulated
CALL HPFC PACK/UNPACK
BUF INDEX=0
trg | source array |
lid | target array |
proc | local id for base target |
array_dim | the processors, needed for broadcasts |
is_send | variables for array dimensions |
is_lazy | send or receive ? |
Definition at line 437 of file generate-util.c.
References array, buffer_full_condition(), BUFFER_INDEX, BUFPCK, BUFUPK, call_to_statement, CONS, entity_to_expression(), entity_undefined, EXPRESSION, hpfc_broadcast_buffers(), hpfc_buffer_entity(), hpfc_buffer_packing(), hpfc_name_to_entity(), make_block_statement(), make_call(), make_continue_statement(), make_test(), NIL, RCV_NOT_PRF, set_integer, set_logical, SND_NOT_INIT, src, STATEMENT, and test_to_statement.
Referenced by gen().
returns if (LAZY_{SEND,RECV}) then
snd | nd |
then | hen |
Definition at line 176 of file generate-util.c.
References entity_to_expression(), hpfc_name_to_entity(), LAZY_RECV, LAZY_SEND, make_empty_statement, make_test(), and test_to_statement.
Referenced by broadcast(), and hpfc_lazy_message().
|
static |
IF (LAZY_snd) THEN PVMFsnd() LAZY_snd = false // if receive ENDIF.
Definition at line 191 of file generate-util.c.
References CONS, hpfc_lazy_guard(), hpfc_message(), hpfc_name_to_entity(), LAZY_RECV, LAZY_SEND, make_block_statement(), NIL, set_logical, and STATEMENT.
Referenced by hpfc_generate_message().
statement hpfc_lazy_packing | ( | entity | array, |
entity | lid, | ||
entity(*)() | creation, | ||
bool | pack, | ||
bool | lazy | ||
) |
the lazy issues.
note that target processors should be known to generate the appropriate broadcast?
Definition at line 524 of file generate-util.c.
References array, CONS, hpfc_buffer_packing(), hpfc_generate_message(), hpfc_name_to_entity(), LAZY_SEND, make_block_statement(), NIL, set_logical, and STATEMENT.
Referenced by gen().
statement hpfc_message | ( | expression | tid, |
expression | channel, | ||
bool | send | ||
) |
tid | id |
channel | hannel |
send | end |
Definition at line 152 of file generate-util.c.
References BUFID, CONS, copy_expression(), entity_to_expression(), EXPRESSION, hpfc_add_2(), hpfc_make_call_statement(), hpfc_name_to_entity(), INFO, make_block_statement(), NIL, PVM_RECV, PVM_SEND, and STATEMENT.
Referenced by hpfc_generate_message(), and hpfc_lazy_message().
CALL (pvmtype) HPFC {,UN}PACK.
array | rray |
pack | ack |
Definition at line 395 of file generate-util.c.
References array, BUFPCK, BUFUPK, hpfc_buffer_entity(), hpfc_make_call_statement(), and NIL.
Referenced by hpfc_broadcast_if_necessary(), hpfc_hcast(), hpfc_hmessage(), hpfc_nrecv(), and hpfc_nsend().
expression make_reference_expression | ( | entity | e, |
entity(*)() | creation | ||
) |
Definition at line 117 of file generate-util.c.
References hpfc_gen_n_vars_expr(), make_reference(), NumberOfDimension(), and reference_to_expression().
Referenced by gen(), and hpfc_buffer_packing().
|
static |
HPFC module by Fabien COELHO.
Definition at line 33 of file generate-util.c.
References MakeCharacterConstantExpression().
Referenced by hpfc_initsend().