PIPS
generate.c
Go to the documentation of this file.
1 /*
2 
3  $Id: generate.c 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 /*
28  * Fabien Coelho, May 1993
29  */
30 
31 #include "defines-local.h"
32 
33 /* ??? this should work (but that is not the case yet),
34  * with every call with no write to distributed arrays.
35  *
36  * these conditions are to be verifyed, by calculating
37  * the proper effects of the statement.
38  *
39  * to be corrected later on.
40  */
41 void generate_c1_beta(stat, lhp, lnp)
42 statement stat;
43 list *lhp, *lnp;
44 {
45  statement staths, statns;
46  expression w;
47  call the_call;
48  list lreftodistarray = NIL;
49 
50  (*lhp) = NIL;
51  (*lnp) = NIL;
52 
53  pips_assert("call", statement_call_p(stat));
54 
55  the_call = instruction_call(statement_instruction(stat));
56 
57  /* this shouldn't be necessary
58  */
59  pips_assert("assignment", ENTITY_ASSIGN_P(call_function(the_call)));
60 
61  w = EXPRESSION(CAR(call_arguments(the_call)));
62 
63  pips_assert("reference",
67 
68  /* references to distributed arrays:
69  * w(A(I)) = B(I)
70  * so the whole list is to be considered.
71  */
72  lreftodistarray = FindRefToDistArrayFromList(call_arguments(the_call));
73 
74  /* generation of the code
75  */
76  MAP(SYNTAX, s,
77  {
78  list lhost;
79  list lnode;
80 
81  pips_debug(8, "considering reference to %s\n",
83 
84  generate_read_of_ref_for_all(s, &lhost, &lnode);
85 
86  (*lhp) = gen_nconc((*lhp), lhost);
87  (*lnp) = gen_nconc((*lnp), lnode);
88  },
89  lreftodistarray);
90 
91  /*
92  * then updated statements are to be added to both host and nodes:
93  */
94 
97  make_call(call_function(the_call),
99  call_arguments(the_call)))));
100 
103  make_call(call_function(the_call),
105  call_arguments(the_call)))));
106 
107  DEBUG_STAT(9, entity_name(host_module), staths);
108  DEBUG_STAT(9, entity_name(node_module), statns);
109 
110  (*lhp) = gen_nconc((*lhp), CONS(STATEMENT, staths, NIL));
111  (*lnp) = gen_nconc((*lnp), CONS(STATEMENT, statns, NIL));
112 
113  gen_free_list(lreftodistarray);
114 }
115 
116 
117 /* generate_c1_alpha
118  *
119  * a distributed array variable is defined
120  */
121 void generate_c1_alpha(stat, lhp, lnp)
122 statement stat;
123 list *lhp, *lnp;
124 {
125  statement statcomputation, statcomputecomputer, statifcomputer;
126  expression writtenexpr, newreadexpr;
127  call the_call;
128  list
129  lupdatecomp = NIL,
130  lupdatenotcomp = NIL,
131  lreadreftodistarray = NIL,
132  lstatcomp = NIL,
133  lstatnotcomp = NIL,
134  lstat = NIL,
135  linds = NIL;
136  reference ref, newref;
137  entity newarray;
138 
139  (*lhp) = NIL;
140  (*lnp) = NIL;
141 
142  pips_assert("call", statement_call_p(stat));
143 
144  the_call = instruction_call(statement_instruction(stat));
145  pips_assert("assignment", ENTITY_ASSIGN_P(call_function(the_call)));
146 
147  writtenexpr = EXPRESSION(CAR(call_arguments(the_call)));
148  pips_assert("reference",
149  syntax_reference_p(expression_syntax(writtenexpr)) &&
152  (syntax_reference(expression_syntax(writtenexpr))))));
153 
154  /* read references to distributed arrays.
155  */
156  lreadreftodistarray =
158 
159  /* generation of the code to get the necessary values...
160  */
161  MAP(SYNTAX, s,
162  {
163  list lnotcomp;
164  list lcomp;
165 
166  pips_debug(8, "considering reference to %s\n",
168 
169  generate_read_of_ref_for_computer(s, &lcomp, &lnotcomp);
170 
171  lstatcomp = gen_nconc(lstatcomp, lcomp);
172  lstatnotcomp = gen_nconc(lstatnotcomp, lnotcomp);
173  },
174  lreadreftodistarray);
175 
176  gen_free_list(lreadreftodistarray);
177 
178  /* then the updated statement is to be added to node:
179  */
180  ref = syntax_reference(expression_syntax(writtenexpr));
181  newarray = load_new_node(reference_variable(ref));
182  generate_compute_local_indices(ref, &lstat, &linds);
183  newref = make_reference(newarray, linds);
184  newreadexpr = UpdateExpressionForModule
185  (node_module, EXPRESSION(CAR(CDR(call_arguments(the_call)))));
186 
187  statcomputation =
189  newreadexpr);
190 
191  lstatcomp = gen_nconc(lstatcomp, lstat);
192  lstatcomp = gen_nconc(lstatcomp, CONS(STATEMENT, statcomputation, NIL));
193 
194  /* Update the values of the defined distributed variable
195  * if necessary...
196  */
197  generate_update_values_on_nodes(ref, newref, &lupdatecomp, &lupdatenotcomp);
198 
199  lstatcomp = gen_nconc(lstatcomp, lupdatecomp);
200  lstatnotcomp = gen_nconc(lstatnotcomp, lupdatenotcomp);
201 
202  /* the overall statements are generated.
203  */
204  statcomputecomputer = st_compute_current_computer(ref);
205  statifcomputer = st_make_nice_test(condition_computerp(),
206  lstatcomp,
207  lstatnotcomp);
208 
209  DEBUG_STAT(8, entity_name(node_module), statifcomputer);
210 
211  (*lnp) = CONS(STATEMENT, statcomputecomputer,
212  CONS(STATEMENT, statifcomputer,
213  NIL));
214  (*lhp) = NIL;
215 
216  return;
217  }
218 
219 /* generate_update_values_on_nodes
220  *
221  * computer is doing the job
222  */
223 void generate_update_values_on_nodes(ref, newref, lscompp, lsnotcompp)
224 reference ref, newref;
225 list *lscompp, *lsnotcompp;
226 {
228 
229  if (replicated_p(array))
230  {
231  statement statif, statco, statco2, statsndtoon, statrcvfromcomp;
232  list lstat, linds;
233 
234  /* remote values have to be updated
235  */
236  statco = st_compute_current_owners(ref);
237 
238  /* the computer has to compute the owners in order to call
239  * the send to other owners function, because the owners
240  * are used to define the owners set, which was quite obvious:-)
241  *
242  * bug fixed by FC, 930629
243  */
244  statco2 = st_compute_current_owners(ref);
245  statsndtoon = st_send_to_other_owners(newref);
246  generate_compute_local_indices(ref, &lstat, &linds);
247  statrcvfromcomp =
249  linds));
251  gen_nconc(lstat,
252  CONS(STATEMENT,
253  statrcvfromcomp,
254  NIL)),
255  NIL);
256 
257  (*lscompp) = CONS(STATEMENT, statco2,
258  CONS(STATEMENT, statsndtoon,
259  NIL));
260  (*lsnotcompp) = CONS(STATEMENT, statco,
261  CONS(STATEMENT, statif,
262  NIL));
263  }
264  else
265  {
266  (*lscompp) = NIL;
267  (*lsnotcompp) = NIL;
268  }
269 }
270 
271 /* generate_read_of_ref_for_computer
272  *
273  * en cours d'adaptation...
274  */
275 void generate_read_of_ref_for_computer(s, lcompp, lnotcompp)
276 syntax s;
277 list *lcompp, *lnotcompp;
278 {
279  statement statcompco, statcompgv, statnotcompco, statnotcompmaysend;
281  entity tempn,
282  var = reference_variable(ref),
284  entity_basic(var));
285 
286  pips_assert("distributed array", array_distributed_p(var));
287 
289  tempn = load_new_node(temp);
290 
291  statcompco = st_compute_current_owners(ref);
292  statcompgv = st_get_value_for_computer(ref, make_reference(tempn, NIL));
293 
294  (*lcompp) = CONS(STATEMENT, statcompco,
295  CONS(STATEMENT, statcompgv, NIL));
296 
297  statnotcompco = st_compute_current_owners(ref);
298  statnotcompmaysend = st_send_to_computer_if_necessary(ref);
299 
300 
301  (*lnotcompp) =
302  CONS(STATEMENT, statnotcompco,
303  CONS(STATEMENT, statnotcompmaysend,
304  NIL));
305 
306  /* the new variable is inserted in the expression...
307  */
308  syntax_reference(s) = make_reference(temp, NIL);
309 }
310 
311 /* generate_read_of_ref_for_all
312  *
313  * this function organise the read of the given reference
314  * for all the nodes, and for host.
315  */
317 syntax s;
318 list *lhp, *lnp;
319 {
320  statement stathco, stathrcv, statnco, statngv;
322  entity temph, tempn,
323  var = reference_variable(ref),
325  entity_basic(var));
326 
327  pips_assert("distributed array", array_distributed_p(var));
328 
330  temph = load_new_host(temp);
331  tempn = load_new_node(temp);
332 
333  /* the receive statement is built for host:
334  *
335  * COMPUTE_CURRENT_OWNERS(ref)
336  * temp = RECEIVEFROMSENDER(...)
337  */
338  stathco = st_compute_current_owners(ref);
339 
340  /* a receive from sender is generated, however replicated the variable is
341  * FC 930623 (before was a call to st_receive_from(ref, ...))
342  */
343  stathrcv = st_receive_from(ref, make_reference(temph, NIL));
344 
345  (*lhp) = CONS(STATEMENT, stathco,
346  CONS(STATEMENT, stathrcv,
347  NIL));
348 
349  DEBUG_STAT(9, entity_name(host_module), stathco);
350  DEBUG_STAT(9, entity_name(host_module), stathrcv);
351 
352  /* the code for node is built, in order that temp has the
353  * wanted value.
354  *
355  * COMPUTE_CURRENT_OWNERS(ref)
356  * IF OWNERP(ME)
357  * THEN
358  * local_ref = COMPUTE_LOCAL(ref)
359  * temp = (local_ref)
360  * IF SENDERP(ME) // this protection in case of replicated arrays.
361  * THEN
362  * SENDTOHOST(temp)
363  * SENDTONODE(ALL-OWNERS,temp)
364  * ENDIF
365  * ELSE
366  * temp = RECEIVEFROM(SENDER(...))
367  * ENDIF
368  */
369  statnco = st_compute_current_owners(ref);
370  statngv = st_get_value_for_all(ref, make_reference(tempn, NIL));
371 
372  (*lnp) = CONS(STATEMENT, statnco, CONS(STATEMENT, statngv, NIL));
373 
374  DEBUG_STAT(9, entity_name(node_module), statnco);
375  DEBUG_STAT(9, entity_name(node_module), statngv);
376 
377  /* the new variable is inserted in the expression...
378  */
379  syntax_reference(s) = make_reference(temp, NIL);
380 }
381 
382 /* generate_compute_local_indices
383  *
384  * this function generate the list of statement necessary to compute
385  * the local indices of the given reference. It gives back the new list
386  * of indices for the reference.
387  */
389 reference ref;
390 list *lsp, *lindsp;
391 {
392  int i;
394  list inds = reference_indices(ref);
395 
396  pips_assert("distributed array", array_distributed_p(array));
397 
398  (*lsp) = NIL, (*lindsp) = NIL;
399 
400  pips_debug(9, "number of dimensions of %s to compute: %d\n",
402 
403  for(i=1; i<=NumberOfDimension(array); i++, inds = CDR(inds))
404  {
406  {
407  syntax s;
409  EXPRESSION(CAR(inds)), &s);
410 
412 
413  (*lsp) = gen_nconc((*lsp), CONS(STATEMENT, stat, NIL));
414  (*lindsp) =
415  gen_nconc((*lindsp), CONS(EXPRESSION,
417  }
418  else
419  {
420  expression expr =
422 
423  (*lindsp) =
424  gen_nconc((*lindsp),
425  CONS(EXPRESSION, expr, NIL));
426  }
427  }
428 
429  pips_debug(8, "result:\n");
430  ifdebug(8)
431  MAP(STATEMENT, s, DEBUG_STAT(8, entity_name(node_module), s), (*lsp));
432 }
433 
434 /* generate_get_value_locally
435  *
436  * put the local value of ref in the variable local.
437  *
438  * for every indexes, if necessary, compute
439  * the local value of the indices, by calling
440  * RTR support function LOCAL_INDEX(array_number, dimension)
441  * then the assignment is performed.
442  *
443  * tempi = LOCAL_INDEX(array_number, dimension, indexi) ...
444  * goal = ref_local(tempi...)
445  */
446 void generate_get_value_locally(ref, goal, lstatp)
447 reference ref, goal;
448 list *lstatp;
449 {
450  statement stat;
451  expression expr;
453  newarray = load_new_node(array);
454  list ls = NIL, newinds = NIL;
455 
456  pips_assert("distributed array", array_distributed_p(array));
457 
458  generate_compute_local_indices(ref, &ls, &newinds);
459  expr = reference_to_expression(make_reference(newarray, newinds));
461 
463 
464  (*lstatp) = gen_nconc(ls, CONS(STATEMENT, stat, NIL));
465 }
466 
467 /* generate_send_to_computer
468  *
469  * sends the local value of ref to the current computer
470  */
472 reference ref;
473 list *lstatp;
474 {
475  statement statsnd;
476  entity
478  newarray = load_new_node(array);
479  list ls = NIL, newinds = NIL;
480 
481  pips_assert("distributed array", array_distributed_p(array));
482 
483  generate_compute_local_indices(ref, &ls, &newinds);
484  statsnd = st_send_to_computer(make_reference(newarray, newinds));
485 
486  DEBUG_STAT(9, entity_name(node_module), statsnd);
487 
488  (*lstatp) = gen_nconc(ls, CONS(STATEMENT, statsnd, NIL));
489 }
490 
492 reference ref;
493 list *lstatp;
494 {
495  statement statrcv;
496  entity
498  newarray = load_new_node(array);
499  list ls = NIL, newinds = NIL;
500 
501  pips_assert("distributed array", array_distributed_p(array));
502 
503  generate_compute_local_indices(ref, &ls, &newinds);
504  statrcv = st_receive_from_computer(make_reference(newarray, newinds));
505 
506  DEBUG_STAT(9, entity_name(node_module), statrcv);
507 
508  (*lstatp) = gen_nconc(ls, CONS(STATEMENT, statrcv, NIL));
509 }
510 
511 void generate_parallel_body(body, lstatp, lw, lr)
512 statement body;
513 list *lstatp, lw, lr;
514 {
515  statement statcc, statbody;
516  list lcomp = NIL, lcompr = NIL, lcompw = NIL,
517  lnotcomp = NIL, lnotcompr = NIL, lnotcompw = NIL;
518  syntax comp;
519 
520  pips_assert("at leat one written or read",
521  (gen_length(lw)+gen_length(lr))>0);
522 
523  /* the first written or read distributed ref is chosen as the computer
524  */
525  comp = lw? SYNTAX(CAR(lw)): SYNTAX(CAR(lr));
527 
528  MAP(SYNTAX, s,
529  {
530  list lco = NIL;
531  list lnotco = NIL;
532 
533  generate_read_of_ref_for_computer(s, &lco, &lnotco);
534 
535  lcompr = gen_nconc(lcompr, lco);
536  lnotcompr = gen_nconc(lnotcompr, lnotco);
537  },
538  lr);
539 
540  MAP(SYNTAX, s,
541  {
542  list lco = NIL;
543  list lnotco = NIL;
545  entity var = reference_variable(r);
547  entity_basic(var));
548  entity tempn ;
549 
551  tempn = load_new_node( temp);
552 
553  if (comp == s)
554  {
555  /* we are sure that computer is one of the owners
556  */
557  list lstat = NIL;
558  list linds = NIL;
559  entity newarray = load_new_node(var);
560 
561  generate_compute_local_indices(r, &lstat, &linds);
562  lstat =
563  gen_nconc
564  (lstat,
565  CONS(STATEMENT,
568  linds)),
569  entity_to_expression(tempn)),
570  NIL));
571 
573  (r, make_reference(tempn, NIL), &lco, &lnotco);
574 
575  lco = gen_nconc(lstat, lco);
576  }
577  else
578  {
580  (r, make_reference(tempn, NIL), &lco, &lnotco);
581  }
582 
583  lcompw = gen_nconc(lcompw, lco);
584  lnotcompw = gen_nconc(lnotcompw, lnotco);
585 
586  syntax_reference(s) = make_reference(temp, NIL);
587  },
588  lw);
589 
590 
591  pips_debug(6, "%zd statements for computer write:\n", gen_length(lcompw));
592 
593  ifdebug(8)
594  {
595  MAP(STATEMENT, s, DEBUG_STAT(8, entity_name(node_module), s), lcompw);
596  }
597 
598  pips_debug(6, "%zd statements for not computer write:\n",
599  gen_length(lnotcompw));
600 
601  ifdebug(8)
602  {
604  lnotcompw);
605  }
606 
607  statbody = UpdateStatementForModule(node_module, body);
608  DEBUG_STAT(7, entity_name(node_module), statbody);
609 
610  lcomp = gen_nconc(lcompr, CONS(STATEMENT, statbody, lcompw));
611  lnotcomp = gen_nconc(lnotcompr, lnotcompw);
612 
613  (*lstatp) = CONS(STATEMENT, statcc,
615  lcomp,
616  lnotcomp),
617  NIL));
618 
619  ifdebug(6)
620  {
621  pips_debug(6, "final statement:\n");
622  MAP(STATEMENT, s, DEBUG_STAT(6, entity_name(node_module),s), (*lstatp));
623  }
624 }
625 
626 
627 /* generate_update_values_on_computer_and_nodes
628  *
629  * inside a loop, a variable is defined, and the values have to be updated
630  * on the computer node itself, and on the other owners of the given variable.
631  *
632  * computer is doing the job
633  */
634 void generate_update_values_on_computer_and_nodes(ref, val, lscompp, lsnotcompp)
635 reference ref, val;
636 list *lscompp, *lsnotcompp;
637 {
638  entity
640  newarray = load_new_node(array);
641  statement
642  statif, statcompif, statco, statcompco, statcompassign,
643  statsndtoO, statsndtoOO, statrcvfromcomp;
644  list lstat, lstatcomp, linds, lindscomp;
645 
646  /* all values have to be updated...
647  */
648  statcompco = st_compute_current_owners(ref);
649  generate_compute_local_indices(ref, &lstatcomp, &lindscomp);
650 
651  statcompassign =
653  (reference_to_expression(make_reference(newarray, lindscomp)),
655 
656  if (replicated_p(array))
657  {
658  statsndtoOO = st_send_to_other_owners(val);
659  statsndtoO = st_send_to_owners(val);
660  }
661  else
662  {
664  statsndtoO = st_send_to_owner(val);
665  }
666  statcompif = st_make_nice_test
667  (condition_ownerp(),
668  gen_nconc(lstatcomp, CONS(STATEMENT, statcompassign,
669  CONS(STATEMENT, statsndtoOO,
670  NIL))),
671  CONS(STATEMENT, statsndtoO,
672  NIL));
673 
674  statco = st_compute_current_owners(ref);
675  generate_compute_local_indices(ref, &lstat, &linds);
676  statrcvfromcomp =
677  st_receive_from_computer(make_reference(newarray,linds));
679  gen_nconc(lstat, CONS(STATEMENT, statrcvfromcomp,
680  NIL)),
681  NIL);
682 
683  (*lscompp) = CONS(STATEMENT, statcompco,
684  CONS(STATEMENT, statcompif, NIL));
685  (*lsnotcompp) = CONS(STATEMENT, statco,
686  CONS(STATEMENT, statif, NIL));
687 }
688 
689 /* generate_update_distributed_value_from_host
690  */
692 syntax s;
693 list *lhstatp, *lnstatp;
694 {
696  entity array, newarray, temp, temph;
697  statement statnco, stathco, stnrcv, stnif, sthsnd;
698  list linds = NIL, lnstat = NIL;
699 
700  pips_assert("distrivuted reference",
702 
704  newarray = load_new_node(array);
705 
708 
710  temph = load_new_host(temp);
711 
712  generate_compute_local_indices(r, &lnstat, &linds);
713  stnrcv = st_receive_from_host(make_reference(newarray, linds));
715  gen_nconc(lnstat,
716  CONS(STATEMENT, stnrcv, NIL)),
717  NIL);
718 
719  /* call the necessary communication function
720  */
721 
722  sthsnd = (replicated_p(array) ?
725 
726  syntax_reference(s) = make_reference(temp, NIL);
727 
728  statnco = st_compute_current_owners(r);
729  stathco = st_compute_current_owners(r);
730 
731  (*lhstatp) = CONS(STATEMENT, stathco, CONS(STATEMENT, sthsnd, NIL));
732  (*lnstatp) = CONS(STATEMENT, statnco, CONS(STATEMENT, stnif, NIL));
733 
734 }
735 
736 /* generate_update_private_value_from_host
737  */
739  (syntax s, list* lhstatp, list* lnstatp)
740 {
741  entity
743  varn = load_new_node(var),
744  varh = load_new_host(var);
745 
746  pips_assert("not distributed reference",
748 
749  (*lhstatp) = CONS(STATEMENT,
751  NIL);
752 
753  (*lnstatp) = CONS(STATEMENT,
755  NIL);
756 }
757 
758 /************************************************************** STATEMENTS */
759 
761 {
762  list ls=NIL;
763 
766  NIL));
767 
768  return(make_block_statement(ls));
769 }
770 
771 
772 /* the returned expression is translated into variables
773  * of the node module.
774  */
776 entity array;
777 int i;
778 expression expr;
779 syntax *sp;
780 {
781  /* the necessity is not checked, but it could be done,
782  * looking that the new declaration of the given array
783  * is smaller or not on the given dimension...
784  */
785 
788  statement stat;
790 
792 
797  i,
799  expr))));
800 
801  return(stat);
802 }
803 
805 reference ref,val;
806 {
809  CONS(STATEMENT,
811  NIL),
812  NIL));
813  else
814  return st_send_to_host_and_all_nodes(val);
815 }
816 
818 {
819  entity
821  newarray = load_new_node(array);
822  expression
823  condition=((replicated_p(array))?
828  (condition_senderp()));
829  list lstat = NIL, lnewinds = NIL;
830 
831  generate_compute_local_indices(ref, &lstat, &lnewinds);
832 
833  return
834  st_make_nice_test(condition,
835  gen_nconc(lstat,
836  CONS(STATEMENT,
837  st_send_to_computer(make_reference(newarray, lnewinds)),
838  NIL)),
839  NIL);
840 }
841 
843 {
844  return
848 }
849 
851 reference ref, goal;
852 {
853  list ltrue=NIL, lfalse=NIL;
854  generate_get_value_locally(ref,goal,&ltrue);
856  return st_make_nice_test(condition_ownerp(),ltrue,lfalse);
857 }
858 
859 /* if ref is replicated:
860  * goal = Receive_From_Sender()
861  *
862  * if ref is not replicated
863  * goal = Receive_Multi_Cast_From_Sender()
864  */
866 reference ref,goal;
867 {
869  return st_receive_from_sender(goal);
870  else
871  return st_receive_mcast_from_sender(goal);
872 }
873 
874 /* That is all
875  */
call make_call(entity a1, list a2)
Definition: ri.c:269
expression make_expression(syntax a1, normalized a2)
Definition: ri.c:886
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
instruction make_instruction(enum instruction_utype tag, void *val)
Definition: ri.c:1166
syntax make_syntax(enum syntax_utype tag, void *val)
Definition: ri.c:2491
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
entity host_module
HPFC - Fabien Coelho, May 1993 and later...
Definition: compiler.c:47
entity node_module
Definition: compiler.c:47
void generate_c1_beta(statement stat, list *lhp, list *lnp)
??? this should work (but that is not the case yet), with every call with no write to distributed arr...
Definition: generate.c:41
void generate_update_values_on_computer_and_nodes(reference ref, reference val, list *lscompp, list *lsnotcompp)
generate_update_values_on_computer_and_nodes
Definition: generate.c:634
void generate_compute_local_indices(reference ref, list *lsp, list *lindsp)
generate_compute_local_indices
Definition: generate.c:388
void generate_get_value_locally(reference ref, reference goal, list *lstatp)
generate_get_value_locally
Definition: generate.c:446
void generate_update_private_value_from_host(syntax s, list *lhstatp, list *lnstatp)
generate_update_private_value_from_host
Definition: generate.c:739
void generate_read_of_ref_for_computer(syntax s, list *lcompp, list *lnotcompp)
generate_read_of_ref_for_computer
Definition: generate.c:275
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.
Definition: generate.c:775
statement st_send_to_host_and_nodes(reference ref, reference val)
Definition: generate.c:804
statement st_get_value_for_all(reference ref, reference goal)
Definition: generate.c:842
void generate_update_values_on_nodes(reference ref, reference newref, list *lscompp, list *lsnotcompp)
generate_update_values_on_nodes
Definition: generate.c:223
statement st_send_to_computer_if_necessary(reference ref)
Definition: generate.c:817
void generate_read_of_ref_for_all(syntax s, list *lhp, list *lnp)
generate_read_of_ref_for_all
Definition: generate.c:316
statement st_get_value_locally_and_send(reference ref, reference goal)
Definition: generate.c:760
void generate_send_to_computer(reference ref, list *lstatp)
generate_send_to_computer
Definition: generate.c:471
void generate_receive_from_computer(reference ref, list *lstatp)
Definition: generate.c:491
void generate_c1_alpha(statement stat, list *lhp, list *lnp)
generate_c1_alpha
Definition: generate.c:121
void generate_update_distributed_value_from_host(syntax s, list *lhstatp, list *lnstatp)
generate_update_distributed_value_from_host
Definition: generate.c:691
statement st_receive_from(reference ref, reference goal)
if ref is replicated: goal = Receive_From_Sender()
Definition: generate.c:865
statement st_get_value_for_computer(reference ref, reference goal)
Definition: generate.c:850
void generate_parallel_body(statement body, list *lstatp, list lw, list lr)
Definition: generate.c:511
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
Definition: statement.c:597
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
instruction make_assign_instruction(expression l, expression r)
Definition: instruction.c:87
#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
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226
bool statement_call_p(statement)
Definition: statement.c:364
statement make_assign_statement(expression, expression)
Definition: statement.c:583
statement make_continue_statement(entity)
Definition: statement.c:953
statement st_make_nice_test(expression, list, list)
Definition: statement.c:1585
list lUpdateExpr(entity module, list l)
expression UpdateExpressionForModule(entity module, expression ex)
this function creates a new expression using the mapping of old to new variables map.
statement UpdateStatementForModule(entity module, statement stat)
void AddEntityToHostAndNodeModules(entity e)
AddEntityToHostAndNodeModules.
Definition: hpfc-util.c:298
list FindRefToDistArrayFromList(list lexpr)
FindRefToDistArrayFromList.
Definition: hpfc-util.c:262
bool replicated_p(entity e)
replicated_p
Definition: hpfc-util.c:96
list FindRefToDistArray(void *obj)
Definition: hpfc-util.c:282
#define st_send_to_host_and_not_owners(val)
#define st_receive_mcast_from_host(goal)
#define st_send_to_host_and_all_nodes(val)
#define st_send_to_computer(val)
SND.
#define condition_computerp()
#define condition_ownerp()
#define st_receive_from_computer(goal)
#define condition_not_computer_in_owners()
#define condition_senderp()
#define local_index_is_different_p(array, dim)
#define st_send_to_other_owners(val)
#define st_receive_from_host(goal)
#define DEBUG_STAT(D, W, S)
#define st_receive_from_sender(goal)
#define st_send_to_owners(val)
#define st_receive_mcast_from_sender(goal)
#define st_host_send_to_all_nodes(val)
#define st_send_to_owner(val)
expression expr_compute_local_index(entity, int, expression)
new index computation formula, derived from the new declarations made for the given dimension.
Definition: run-time.c:198
entity load_new_node(entity)
statement st_compute_current_computer(reference)
Computes.
Definition: run-time.c:151
statement st_compute_current_owners(reference)
Definition: run-time.c:173
entity load_new_host(entity)
bool array_distributed_p(entity)
#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 ENTITY_ASSIGN_P(e)
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
Definition: entity.c:1380
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
expression reference_to_expression(reference r)
Definition: expression.c:196
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
basic MakeBasic(int)
END_EOLE.
Definition: type.c:128
entity make_new_scalar_variable(entity, basic)
Definition: variable.c:741
void AddEntityToCurrentModule(entity)
Add a variable entity to the current module declarations.
Definition: variable.c:260
int NumberOfDimension(entity)
Definition: size.c:588
@ is_basic_int
Definition: ri.h:571
#define normalized_undefined
Definition: ri.h:1745
#define syntax_reference_p(x)
Definition: ri.h:2728
#define syntax_reference(x)
Definition: ri.h:2730
#define call_function(x)
Definition: ri.h:709
#define reference_variable(x)
Definition: ri.h:2326
@ is_syntax_reference
Definition: ri.h:2691
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define entity_undefined
Definition: ri.h:2761
@ is_instruction_call
Definition: ri.h:1474
#define entity_name(x)
Definition: ri.h:2790
#define reference_indices(x)
Definition: ri.h:2328
#define statement_instruction(x)
Definition: ri.h:2458
#define instruction_call(x)
Definition: ri.h:1529
#define call_arguments(x)
Definition: ri.h:711
#define expression_syntax(x)
Definition: ri.h:1247
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
#define SYNTAX(x)
SYNTAX.
Definition: ri.h:2670
#define ifdebug(n)
Definition: sg.c:47
static entity array
The structure used to build lists in NewGen.
Definition: newgen_list.h:41