Opened 10 years ago

Last modified 8 years ago

#2874 new enhancement

Implement threaded for-loops in MetaModelica

Reported by: perost Owned by: sjoelund.se
Priority: high Milestone: Future
Component: MetaModelica Version: trunk
Keywords: Cc:

Description (last modified by sjoelund.se)

We currently have threaded reductions, it would be nice to have the equivalent for-loops also (syntax is only a suggestion):

for threaded e1 in list1, e2 in list2 loop
  // Iterates simultaneously over list1 and list2.
end for;

Change History (4)

comment:1 Changed 10 years ago by sjoelund.se

  • Description modified (diff)

The for-loops are currently translated into nested loops, making this require substantial changes to the DAE

model M
  Real r(start=0);
algorithm
  for i in 1:20, j in 1:30 loop
    r := r + i + j;
  end for;
end M;

=>

class M
  Real r(start = 0.0);
algorithm
  for i in 1:20 loop
    for j in 1:30 loop
      r := r + /*Real*/(i) + /*Real*/(j);
    end for;
  end for;
end M;
Last edited 10 years ago by sjoelund.se (previous) (diff)

comment:2 Changed 10 years ago by sjoelund.se

  • Description modified (diff)

comment:3 Changed 9 years ago by sjoelund.se

  • Milestone Bootstrapping deleted

Unsetting milestone since bootstrapping is already finished.

comment:4 Changed 8 years ago by dietmarw

  • Milestone set to Future
Note: See TracTickets for help on using tickets.