Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » yunzhang
  • » Profile

Posts

Posts

Figured out +d=tearing
if anyone interested in knowing.

Hi,

I am wondering how to enable a specific optimization (turn on its flag) in OpenModelica.  For example, the common commandline for compiling a model is like:
omc +s +d=execstat ChuaCircuit.mo Modelica

How do I add one optimization, say loop tearing?

Thanks,
Yun

Hi,

We are currently considering playing around Modelica parallelization with GPU.  From the Modelica workshop this year, we learnt that there probably is a prototype of OpenModelica backend for GPU.  Is it possible to  get the backend anywhere?  It does not not if the backend is still in experimental stage or does not work on all benchmarks.  We need some preliminary code generation for our purpose.

Thanks a lot,
Yun

Jul-05-10 12:32:52
OpenModelica Compiler Optimizatio related
Category: Developer

Gee,  it works ! Thank you very much !  Now I can write similar codes myself. Thanks!

Jul-05-10 12:17:20
OpenModelica Compiler Optimizatio related
Category: Developer

Thanks, I dont know if I am doing anything else wrong: after I applied the  code above, the program always goes to the "false"branch in the first case.  The reason is that the fist case is taken, then the If in the fist case is evaluated. Given that the condition is false, the function always returns {}.....

In another word, instead of breaking the loop , the code above breaks the loop in its first iteration always because the first If is always evaluated before the second.

I am bit confused at this point...... How do I break the loop when inIntger==counter?

Here is the output  I got:
{10}
in = 10  counter = 1
finished
{8}
in = 8  counter = 1
finished

Jul-05-10 12:02:45
OpenModelica Compiler Optimizatio related
Category: Developer

I see. That explains a lot. Sorry I didn't understand what you meant by "evaluating both expressions".

In this case, if I want to break loops, shall I write program like:
case (_, (dep::lst_1), _)
      equation
         true = inInteger == counter;
        dep_list = Util.if_(true, dep, {});
      then dep_list;
case (_, (dep::lst_1), _)
      equation
         false = inInteger == counter;
         dep_list = Util.if_(false, {}, findDep(inInteger, lst_1, counter+1));
      then dep_list;

Jul-05-10 11:44:07
OpenModelica Compiler Optimizatio related
Category: Developer

Thank you all so much for the quick reply !  I have one more question regarding value comparison.  Thanks in advance.

Here is a function I wrote to traverse the incidence matrix and find the list of variables that a specific equation depends on.  inInteger is the equation number, and lst is the incidence matrix. counter is for checking whether this is the dependence we are interested.  The output should be a list of integer(variable number).
protected function findDep
  input Integer inInteger;
  input list<list<Integer>> lst;
  input Integer counter;
  output list<Integer> dep_list;
algorithm
  dep_list :=
  matchcontinue(inInteger, lst, counter)
    local
      Integer eqn;
      list<list<Integer>> lst_1;
      list<Integer> dep;
    case (_, {}, _) then {};
    case (_, (dep::lst_1), _)
      equation
           print(" in = ");
    print(intString(inInteger));
    print("     counter = ");
    print(intString(counter));
    print("\t");
        dep_list = Util.if_((inInteger ==counter), dep, findDep(inInteger, lst_1, counter+1));
      then dep_list;
  end matchcontinue;
end findDep;

The problem is, I dont know if Util.if_ is working as I expected, because the output is :
in = 10  counter = 1
in = 10  counter = 2
in = 10  counter = 3
in = 10  counter = 4
in = 10  counter = 5
in = 10  counter = 6
in = 10  counter = 7
in = 10  counter = 8
in = 10  counter = 9
in = 10  counter = 10
in = 10  counter = 11
in = 10  counter = 12
....

If the conditional branch really works, shouldn't it stop recursion when counter=10? I may have made some stupid mistake here since I am totally new to this.  Please please let me know if I am doing anything wrong.

Thanks for your time !

Yun

Jul-05-10 10:31:31
OpenModelica Compiler Optimizatio related
Category: Developer

ha, it works like a charm! Thanks.  I am pretty new to MetaModelica. Thanks a lot for helping me out on this. 

Is there any documentation about the grammar of RML? I checked the website but I dont know which one has a list of all statement available to use.

Thanks !

Jul-05-10 10:18:45
OpenModelica Compiler Optimizatio related
Category: Developer

Hi, all

I am currently trying to dump some intermediate information about a modelica model using OpenModelica.  I want to print equations in the order of BLT and which other equations it depends on.  To do that, I need to combine the information from both BLT and incidence .
For example if the BLT is
{2}
{1}
{3}
And incidence is
1: 2
2:
3: 1 2
I want to print out
Block 1: eqn_2 depends on _
Block 2: eqn_1 depends on eqn_2
Block 3: eqn_3 depends on eqn_2, eqn_1

But when I try to look up the incidence matrix to find corresponding dependences for a specific equation, I dont know how to make comparison.  I checked the users guide and it seems to suggest using " if ... then.. else".  But I cannot use if statement because rmlc will tell me every time"
"/usr/bin/rml" -Eplain -ftrace DAELow.mo
Internal error: FOLToCPS.lookupVar: $11935
Error: Bug

Any kind of help is greatly appreciated.  Thanks.

Yun

  • Index
  • » Users
  • » yunzhang
  • » Profile
You are here: