Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-01468// Views: AA-01468// Created: 2018-04-18 21:59:14// Last Updated: 2020-10-13 20:48:52
RT-LAB
RT-LAB and HYPERSIM : How to know which Compiler to use ? Intel or GCC ?

RT-LAB and HYPERSIM : How to know which Compiler to use ? Intel or GCC ?


In both RT-LAB and HYPERSIM, the Default Compiler is Intel, if you have bought a license as a client.

1 - Compiler Differences

Using the GCC Compiler (gcc for RT-LAB and opgcc for HYPERSIM), there are less Optimizations being done. The Intel Compiler (opicc both for RT-LAB and HYPERSIM), which makes more Optimizations, can offer a more performing Compiled Code reducing the Timestep in your model by up to 30% compared to GCC, according to Intel.

The drawback is that the Intel Compiler takes longer to Compile than GCC which can sometimes lead to a TimeOut error in HYPERSIM (/usr/bin/gmake -j10 makefile.out error). The Memory Limit might be reached during the Compilation Task when using the Intel Compiler.

This error can be fixed by switching to the GCC Compiler which is faster and uses less resources but more time will be necessary during the Real-Time Simulation to complete the same processes than when using the Intel Compiler.


2 - How to change Compiler in RT-LAB or HYPERSIM

For RT-LAB, please consult this KB article.

For HYPERSIM, please consult this KB article.


3 - Optimization Flags (or cflags)

The Compilers have Optimization levels known as cflags. 

For Intel and GCC, the basic flags are -O0, -O1 and -O2 where -O0 = No Optimization -O1 = A bit of Optimization and -O2 = Maximum Optimization.

-O2 is the value by default for Intel and GCC compilers.

You can find more details about Optimization here for each Compiler here:

Intel : https://software.intel.com/sites/default/files/managed/12/f1/Quick-Reference-Card-Intel-Compilers-v16.pdf

GCC : https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html


4 - How to change  Optmization flags manually in RT-LAB or HYPERSIM

RT-LAB

Double-click your model and go to Development -> Compiler -> Compiler Options and set the desired Optimization Flags. Then compile your code (Build the Model). As mentioned above, the value by default is -O2.

Note that this tool works for both Intel and GCC compilers.





HYPERSIM

 - HYPERSIM versions 2019.3+

1. Open the desired model.

2. Open Settings from HYPERSIM ribbon and go to Target tab. 

3. Set the desired values for C flags.

Same as for RT-LAB, the value used by default is -O2 (when the C flags option is not set explicitly) and this works for both Intel and GCC compilers.


 - HYPERSIM versions 6.2 to 2019.2

1. Open the desired model.

2. Open Settings from HYPERSIM ribbon and go to Advanced Target Settings tab. 

3. Set the desired values for C flags.


 - HYPERSIM versions 6.0 and 6.1

1. Open the desired model.

2. Go to the Options tab in HYPERSIM>Simulation>Options

3. Select your target and set the Architecture to Real-Time. Click on the Options tab.

4. Set desired values for C flags.


- Versions prior to HYPERSIM 6.0

1. Go to the File Path of the .ecf HYPERSIM Model (where you saved you Model).

2. Open the modelname_hyp folder and locate the preferences.txt file.

3. Open it and add the following line:

architecture.linux-rhel5-32-opalrt-rt.cflags={Desired Optimization Flag here}

Note that this is the same preferences.txt file that we would modify to change to the GCC compiler in HYPERSIM