PIPS
|
#include "defines-local.h"
Go to the source code of this file.
generate_c1_alpha
a distributed array variable is defined
read references to distributed arrays.
generation of the code to get the necessary values...
then the updated statement is to be added to node:
Update the values of the defined distributed variable if necessary...
the overall statements are generated.
stat | tat |
lhp | hp |
lnp | np |
Definition at line 121 of file generate.c.
References array_distributed_p(), call_arguments, call_function, CAR, CDR, condition_computerp, CONS, DEBUG_STAT, ENTITY_ASSIGN_P, entity_name, EXPRESSION, expression_syntax, FindRefToDistArray(), gen_free_list(), gen_nconc(), generate_compute_local_indices(), generate_read_of_ref_for_computer(), generate_update_values_on_nodes(), instruction_call, load_new_node(), make_assign_statement(), make_reference(), MAP, NIL, node_module, pips_assert, pips_debug, ref, reference_to_expression(), reference_variable, st_compute_current_computer(), st_make_nice_test(), STATEMENT, statement_call_p(), statement_instruction, SYNTAX, syntax_reference, syntax_reference_p, and UpdateExpressionForModule().
Referenced by hpf_compile_call().
??? this should work (but that is not the case yet), with every call with no write to distributed arrays.
these conditions are to be verifyed, by calculating the proper effects of the statement.
to be corrected later on.
this shouldn't be necessary
references to distributed arrays: w(A(I)) = B(I) so the whole list is to be considered.
generation of the code
stat | tat |
lhp | hp |
lnp | np |
Definition at line 41 of file generate.c.
References array_distributed_p(), call_arguments, call_function, CAR, CONS, DEBUG_STAT, ENTITY_ASSIGN_P, entity_name, EXPRESSION, expression_syntax, FindRefToDistArrayFromList(), gen_free_list(), gen_nconc(), generate_read_of_ref_for_all(), host_module, instruction_call, instruction_to_statement(), is_instruction_call, lUpdateExpr(), make_call(), make_instruction(), MAP, NIL, node_module, pips_assert, pips_debug, reference_variable, STATEMENT, statement_call_p(), statement_instruction, SYNTAX, syntax_reference, and syntax_reference_p.
Referenced by hpf_compile_call().
generate_compute_local_indices
this function generate the list of statement necessary to compute the local indices of the given reference. It gives back the new list of indices for the reference.
ref | ef |
lsp | sp |
lindsp | indsp |
Definition at line 388 of file generate.c.
References array, array_distributed_p(), CAR, CDR, CONS, DEBUG_STAT, entity_name, EXPRESSION, gen_nconc(), ifdebug, local_index_is_different_p, make_expression(), MAP, NIL, node_module, normalized_undefined, NumberOfDimension(), pips_assert, pips_debug, ref, reference_indices, reference_variable, st_compute_ith_local_index(), STATEMENT, and UpdateExpressionForModule().
Referenced by generate_c1_alpha(), generate_get_value_locally(), generate_parallel_body(), generate_receive_from_computer(), generate_send_to_computer(), generate_update_distributed_value_from_host(), generate_update_values_on_computer_and_nodes(), generate_update_values_on_nodes(), and st_send_to_computer_if_necessary().
generate_get_value_locally
put the local value of ref in the variable local.
for every indexes, if necessary, compute the local value of the indices, by calling RTR support function LOCAL_INDEX(array_number, dimension) then the assignment is performed.
tempi = LOCAL_INDEX(array_number, dimension, indexi) ... goal = ref_local(tempi...)
ref | ef |
goal | oal |
lstatp | statp |
Definition at line 446 of file generate.c.
References array, array_distributed_p(), CONS, DEBUG_STAT, entity_name, gen_nconc(), generate_compute_local_indices(), load_new_node(), make_assign_statement(), make_reference(), NIL, node_module, pips_assert, ref, reference_to_expression(), reference_variable, and STATEMENT.
Referenced by st_get_value_for_computer(), and st_get_value_locally_and_send().
the first written or read distributed ref is chosen as the computer
we are sure that computer is one of the owners
body | ody |
lstatp | statp |
lw | w |
lr | r |
Definition at line 511 of file generate.c.
References AddEntityToHostAndNodeModules(), CAR, condition_computerp, CONS, DEBUG_STAT, entity_basic(), entity_name, entity_to_expression(), gen_length(), gen_nconc(), generate_compute_local_indices(), generate_read_of_ref_for_computer(), generate_update_values_on_computer_and_nodes(), generate_update_values_on_nodes(), get_current_module_entity(), ifdebug, load_new_node(), make_assign_statement(), make_new_scalar_variable(), make_reference(), MAP, NIL, node_module, pips_assert, pips_debug, reference_to_expression(), reference_variable, st_compute_current_computer(), st_make_nice_test(), STATEMENT, SYNTAX, syntax_reference, and UpdateStatementForModule().
Referenced by hpf_compile_parallel_body().
generate_read_of_ref_for_all
this function organise the read of the given reference for all the nodes, and for host.
the receive statement is built for host:
COMPUTE_CURRENT_OWNERS(ref) temp = RECEIVEFROMSENDER(...)
a receive from sender is generated, however replicated the variable is FC 930623 (before was a call to st_receive_from(ref, ...))
the code for node is built, in order that temp has the wanted value.
COMPUTE_CURRENT_OWNERS(ref) IF OWNERP(ME) THEN local_ref = COMPUTE_LOCAL(ref) temp = (local_ref) IF SENDERP(ME) // this protection in case of replicated arrays. THEN SENDTOHOST(temp) SENDTONODE(ALL-OWNERS,temp) ENDIF ELSE temp = RECEIVEFROM(SENDER(...)) ENDIF
the new variable is inserted in the expression...
lhp | hp |
lnp | np |
Definition at line 316 of file generate.c.
References AddEntityToHostAndNodeModules(), array_distributed_p(), CONS, DEBUG_STAT, entity_basic(), entity_name, get_current_module_entity(), host_module, load_new_host(), load_new_node(), make_new_scalar_variable(), make_reference(), NIL, node_module, pips_assert, ref, reference_variable, st_compute_current_owners(), st_get_value_for_all(), st_receive_from(), STATEMENT, and syntax_reference.
Referenced by generate_c1_beta().
generate_read_of_ref_for_computer
en cours d'adaptation...
the new variable is inserted in the expression...
lcompp | compp |
lnotcompp | notcompp |
Definition at line 275 of file generate.c.
References AddEntityToHostAndNodeModules(), array_distributed_p(), CONS, entity_basic(), get_current_module_entity(), load_new_node(), make_new_scalar_variable(), make_reference(), NIL, pips_assert, ref, reference_variable, st_compute_current_owners(), st_get_value_for_computer(), st_send_to_computer_if_necessary(), STATEMENT, and syntax_reference.
Referenced by generate_c1_alpha(), and generate_parallel_body().
ref | ef |
lstatp | statp |
Definition at line 491 of file generate.c.
References array, array_distributed_p(), CONS, DEBUG_STAT, entity_name, gen_nconc(), generate_compute_local_indices(), load_new_node(), make_reference(), NIL, node_module, pips_assert, ref, reference_variable, st_receive_from_computer, and STATEMENT.
generate_send_to_computer
sends the local value of ref to the current computer
ref | ef |
lstatp | statp |
Definition at line 471 of file generate.c.
References array, array_distributed_p(), CONS, DEBUG_STAT, entity_name, gen_nconc(), generate_compute_local_indices(), load_new_node(), make_reference(), NIL, node_module, pips_assert, ref, reference_variable, st_send_to_computer, and STATEMENT.
generate_update_distributed_value_from_host
call the necessary communication function
lhstatp | hstatp |
lnstatp | nstatp |
Definition at line 691 of file generate.c.
References AddEntityToHostAndNodeModules(), array, array_distributed_p(), condition_ownerp, CONS, entity_basic(), gen_nconc(), generate_compute_local_indices(), get_current_module_entity(), load_new_host(), load_new_node(), make_new_scalar_variable(), make_reference(), NIL, pips_assert, reference_variable, replicated_p(), st_compute_current_owners(), st_make_nice_test(), st_receive_from_host, st_send_to_owner, st_send_to_owners, STATEMENT, and syntax_reference.
generate_update_private_value_from_host
lhstatp | hstatp |
lnstatp | nstatp |
Definition at line 738 of file generate.c.
References array_distributed_p(), CONS, load_new_host(), load_new_node(), make_reference(), NIL, pips_assert, reference_variable, st_host_send_to_all_nodes, st_receive_mcast_from_host, STATEMENT, and syntax_reference.
void generate_update_values_on_computer_and_nodes | ( | reference | ref, |
reference | val, | ||
list * | lscompp, | ||
list * | lsnotcompp | ||
) |
generate_update_values_on_computer_and_nodes
inside a loop, a variable is defined, and the values have to be updated on the computer node itself, and on the other owners of the given variable.
computer is doing the job
all values have to be updated...
ref | ef |
val | al |
lscompp | scompp |
lsnotcompp | snotcompp |
Definition at line 634 of file generate.c.
References array, condition_ownerp, CONS, entity_undefined, gen_nconc(), generate_compute_local_indices(), load_new_node(), make_assign_statement(), make_continue_statement(), make_reference(), NIL, ref, reference_to_expression(), reference_variable, replicated_p(), st_compute_current_owners(), st_make_nice_test(), st_receive_from_computer, st_send_to_other_owners, st_send_to_owner, st_send_to_owners, and STATEMENT.
Referenced by generate_parallel_body().
void generate_update_values_on_nodes | ( | reference | ref, |
reference | newref, | ||
list * | lscompp, | ||
list * | lsnotcompp | ||
) |
generate_update_values_on_nodes
computer is doing the job
remote values have to be updated
the computer has to compute the owners in order to call the send to other owners function, because the owners are used to define the owners set, which was quite obvious:-)
bug fixed by FC, 930629
ref | ef |
newref | ewref |
lscompp | scompp |
lsnotcompp | snotcompp |
Definition at line 223 of file generate.c.
References array, condition_ownerp, CONS, gen_nconc(), generate_compute_local_indices(), make_reference(), NIL, ref, reference_variable, replicated_p(), st_compute_current_owners(), st_make_nice_test(), st_receive_from_computer, st_send_to_other_owners, and STATEMENT.
Referenced by generate_c1_alpha(), and generate_parallel_body().
statement st_compute_ith_local_index | ( | entity | array, |
int | i, | ||
expression | expr, | ||
syntax * | sp | ||
) |
the returned expression is translated into variables of the node module.
the necessity is not checked, but it could be done, looking that the new declaration of the given array is smaller or not on the given dimension...
array | rray |
expr | xpr |
sp | p |
Definition at line 775 of file generate.c.
References AddEntityToCurrentModule(), array, expr_compute_local_index(), instruction_to_statement(), is_basic_int, is_syntax_reference, make_assign_instruction(), make_new_scalar_variable(), make_reference(), make_syntax(), MakeBasic(), NIL, node_module, reference_to_expression(), and UpdateExpressionForModule().
Referenced by generate_compute_local_indices().
ref | ef |
goal | oal |
Definition at line 842 of file generate.c.
References condition_ownerp, CONS, NIL, ref, st_get_value_locally_and_send(), st_make_nice_test(), st_receive_from(), and STATEMENT.
Referenced by generate_read_of_ref_for_all().
ref | ef |
goal | oal |
Definition at line 850 of file generate.c.
References condition_ownerp, CONS, generate_get_value_locally(), NIL, ref, st_make_nice_test(), st_receive_from_sender, and STATEMENT.
Referenced by generate_read_of_ref_for_computer().
ref | ef |
goal | oal |
Definition at line 760 of file generate.c.
References CONS, gen_nconc(), generate_get_value_locally(), make_block_statement(), NIL, ref, st_send_to_host_and_nodes(), and STATEMENT.
Referenced by st_get_value_for_all().
if ref is replicated: goal = Receive_From_Sender()
if ref is not replicated goal = Receive_Multi_Cast_From_Sender()
ref | ef |
goal | oal |
Definition at line 865 of file generate.c.
References ref, reference_variable, replicated_p(), st_receive_from_sender, and st_receive_mcast_from_sender.
Referenced by generate_read_of_ref_for_all(), and st_get_value_for_all().
ref | ef |
Definition at line 817 of file generate.c.
References AND_OPERATOR_NAME, array, condition_not_computer_in_owners, condition_senderp, CONS, entity_intrinsic(), gen_nconc(), generate_compute_local_indices(), load_new_node(), make_reference(), MakeBinaryCall(), NIL, ref, reference_variable, replicated_p(), st_make_nice_test(), st_send_to_computer, and STATEMENT.
Referenced by generate_read_of_ref_for_computer().
ref | ef |
val | al |
Definition at line 804 of file generate.c.
References condition_senderp, CONS, NIL, ref, reference_variable, replicated_p(), st_make_nice_test(), st_send_to_host_and_all_nodes, st_send_to_host_and_not_owners, and STATEMENT.
Referenced by st_get_value_locally_and_send().