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
  • » jz95
  • » Profile

Posts

Posts

Hi,

my intention is to change a parameter of a component through the _init.xml:

The model is declared as:

Code:


model ModelA
  ...
  parameter Types.ActivePower PRefConst = 0
  ...
  Types.ActivePower PRef(nominal = SNom) =  PRefConst
   ...
end ModelA;

During the instantiation of ModelA, the PRefConst is assigned to a value:

Code:


  model_a ModelA(..., PRefConst = 14.9e6, ...);

In the compiled C code, it can be noticed that the PRefConst's value is assigned hard-coded:

Code:



/*
equation index: 6068
type: SIMPLE_ASSIGN
model_a .PRefConst = 14900000.0
*/
void modelName_eqFunction_6068(DATA *data, threadData_t *threadData)
{
  TRACE_PUSH
  const int equationIndexes[2] = {1,6068};
  data->simulationInfo->realParameter[1565] /* model_a .PRefConst PARAM */ = 14900000.0;
  TRACE_POP
}

/*
equation index: 6067
type: SIMPLE_ASSIGN
model_a .PRef = model_a .PRefConst
*/
void modelName_eqFunction_6067(DATA *data, threadData_t *threadData)
{
  TRACE_PUSH
  const int equationIndexes[2] = {1,6067};
  data->simulationInfo->realParameter[1564] /* model_a .PRef PARAM */ = data->simulationInfo->realParameter[1565] /* model_a .PRefConst PARAM */;
  TRACE_POP
}



So that in the end even I chang the value of PRefConst in the _init.xml file, the value of PRef is still 14900000.0, because it is already assigned by the original PRefConst's value in the C code. How can I avoid this? Maybe through some options in preOptModules or postOptModules
My current preOptModules is set to

Code:


setPreOptModules("normalInlineFunction,expandDerOperator,clockPartitioning,findStateOrder,inlineArrayEqn,encapsulateWhenConditions")

Please close this Post, it somehow worked now

Update: I added the installation path to the environment varialble before the build, and now it works. I guess it's because I have an omc of version v1.16 already built and added to the environment varialble.

As described in the title, I wish to build the OM compiler on a linux server for simulation. But it failed to build the omc

The distribution of the server is:

Distributor ID: CentOS
Description:    CentOS Linux release 7.7.1908 (Core)
Release:        7.7.1908

commands I used before building:

Code:


: 1589205069:86;git clone https://github.com/OpenModelica/OpenModelica OpenModelica_v1_14
: 1589205191:0;cd OpenModelica_v1_14
: 1589205199:13;git checkout v1.14.1
: 1589205238:106;git submodule update --init --recursive
: 1589205470:1;autoconf
: 1589205489:24;./configure --prefix=$HOME/usr/openmodelica_v1_14 CC=clang CXX=clang++
: 1589205518:191;make -j 32 omc

I recorded the log after running make -j 32 omc, in the following I picked out all the error messages (omitted extra directory and replaced them with "$HOME"),

Code:


2 errors out of 2 messages:
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/DynamicOptimization.mo:758:3-758:25:writable] Error: Duplicate elements:
DAE.FunctionTree funcs.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/DynamicOptimization.mo:32:2-979:24:writable] Error: Failed to compile all functions in package DynamicOptimization.
$HOME/usr/openmodelica/bin/omc -g=MetaModelica -n=1  build/TplParser.stamp.mos

Code:


2 errors out of 2 messages:
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmMemory.mo:2716:5-2716:83:writable] Error: Duplicate elements:
Integer nodeIdx.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmMemory.mo:31:1-3657:16:writable] Error: Failed to compile all functions in package HpcOmMemory.

Code:


2 errors out of 9 messages:
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmScheduler.mo:4963:9-4963:47:writable] Notification: taskLst:=listAppend(taskLst, _) has the first argument in the "wrong" order.
  It is very slow to keep appending a linked list (scales like O(N²)).
  Consider building the list in the reverse order in order to improve performance (scales like O(N) even if you need to reverse a lot of lists). Use annotation __OpenModelica_DisableListAppendWarning=true to disable this message for a certain assignment.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmScheduler.mo:4966:9-4966:67:writable] Notification: outgoingDepTasks:=listAppend(outgoingDepTasks, _) has the first argument in the "wrong" order.
  It is very slow to keep appending a linked list (scales like O(N²)).
  Consider building the list in the reverse order in order to improve performance (scales like O(N) even if you need to reverse a lot of lists). Use annotation __OpenModelica_DisableListAppendWarning=true to disable this message for a certain assignment.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmScheduler.mo:4378:9-4378:45:writable] Notification: clusters:=listAppend(clusters, _) has the first argument in the "wrong" order.
  It is very slow to keep appending a linked list (scales like O(N²)).
  Consider building the list in the reverse order in order to improve performance (scales like O(N) even if you need to reverse a lot of lists). Use annotation __OpenModelica_DisableListAppendWarning=true to disable this message for a certain assignment.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmScheduler.mo:3178:9-3178:43:writable] Notification: tasks:=listAppend(tasks, _) has the first argument in the "wrong" order.
  It is very slow to keep appending a linked list (scales like O(N²)).
  Consider building the list in the reverse order in order to improve performance (scales like O(N) even if you need to reverse a lot of lists). Use annotation __OpenModelica_DisableListAppendWarning=true to disable this message for a certain assignment.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmScheduler.mo:2998:9-2998:76:writable] Notification: outgoingDepTasks:=listAppend(outgoingDepTasks, _) has the first argument in the "wrong" order.
  It is very slow to keep appending a linked list (scales like O(N²)).
  Consider building the list in the reverse order in order to improve performance (scales like O(N) even if you need to reverse a lot of lists). Use annotation __OpenModelica_DisableListAppendWarning=true to disable this message for a certain assignment.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmScheduler.mo:3013:9-3013:52:writable] Notification: tmpNodeList:=listAppend(tmpNodeList, _) has the first argument in the "wrong" order.
  It is very slow to keep appending a linked list (scales like O(N²)).
  Consider building the list in the reverse order in order to improve performance (scales like O(N) even if you need to reverse a lot of lists). Use annotation __OpenModelica_DisableListAppendWarning=true to disable this message for a certain assignment.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmScheduler.mo:3038:9-3038:52:writable] Notification: tmpNodeList:=listAppend(tmpNodeList, _) has the first argument in the "wrong" order.
  It is very slow to keep appending a linked list (scales like O(N²)).
  Consider building the list in the reverse order in order to improve performance (scales like O(N) even if you need to reverse a lot of lists). Use annotation __OpenModelica_DisableListAppendWarning=true to disable this message for a certain assignment.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmScheduler.mo:2899:3-2899:36:writable] Error: Duplicate elements:
HpcOmSimCode.Schedule tmpSchedule.
[$HOME/OpenModelica_v1_14/OMCompiler/Compiler/BackEnd/HpcOmScheduler.mo:31:1-6818:19:writable] Error: Failed to compile all functions in package HpcOmScheduler.

Can anyone help me with is? Many thanks in advance! current/smile

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