Skip to content

Install_HYBRID

mikkdm edited this page Nov 7, 2022 · 9 revisions

Installing the HYBRID repository including RAVEN (and its plugins) as a sub-module

1. Cloning the HYBRID repository and Getting External Properties

Cloning HYBRID

The first step in installing the package is to clone the HYBRID repository. To do this, use

git clone [email protected]:idaholab/HYBRID.git

This will download the repository into a folder called 'hybrid'. To go inside the folder, use

cd hybrid

Note: An ssh key needs to be registered for Github. Instructions to generate and register ssh keys can be found here.

If you have troubles accessing the repository, see Installation trouble shooting.

Downloading the ExternalMedia Package

For some of the models the standard material packages available in the Modelica Standard Library are insufficient so we incorporate the external media package CoolProp.

To properly download the latest version of the ExternalMedia package and make the appropriate machine changes please follow the link below.

ExternalMedia Download Video

2. Install RAVEN and its plugins as a sub-module

The next step is to download and install RAVEN and the submodules (e.g. TEAL and TRANSFORM) plugin as a sub-module of the HYBRID repository. Information on this can be found here.

Set up the HYBRID repository

In order to set up the hybrid repository, you must inform the framework about the location of the DYMOLA python_interface. For doing so, navigate to the hybrid directory:

cd <path to your hybrid repository>/hybrid

and run the following command:

./scripts/write_hybridrc.sh -p DYMOLA_PATH

where DYMOLA_PATH is the path to the python_interface egg folder in the DYMOLA installation. For example,

  ./scripts/write_hybridrc.sh -p /c/Program\ Files/Dymola\ 2020x/Modelica/Library/python_interface/dymola.egg

Setup Dymola .mos file load.

For the automatic regression test system to properly test the downloaded library the proper NHES library must be loaded automatically by dymola in the dymola.mos file located at C:\Program Files\Dymola 2020\insert\dymola.mos for example. To properly run the tests the NHES and the TRANSFORM libraries need to be automatically loaded by Dymola upon startup. This can be accomplished by adding to the Dymola.mos until it looks something like:

RunScript("$DYMOLA/insert/displayunit.mos", true);
definePostProcessing("SDF output", "Convert result file to SDF format", "Modelica.Utilities.System.command(\"\\\"%DYMOLA%/bin/dsres2sdf\\\" %RESULTFILE%.mat %RESULTFILE%.sdf\")");

openModel("C:\Users\FRICKL\Desktop\TRANSFORM3_20_2020\TRANSFORM-Library\TRANSFORM\package.mo"); //Loads Transform package.mo

openModel("C:\msys64\home\FRICKL\hybrid_devel\hybrid\models\NHES\package.mo"); //Loads NHES package from hybrid directory

cd("C:\Users\FRICKL\Desktop\TESsystem"); //Place where all the Dymola runs will occur.

Having the Dymola.mos file written like this will allow Dymola to automatically load all the needed libraries for Regression testing.

Run regression tests related to the HYBRID project

In addition to the RAVEN tests (that are run at the end of the RAVEN installation), there are also some RAVEN tests specifically made to test the HYBRID repository. To run these, one can use:

cd <path to your hybrid repository>/hybrid
./run_tests -jX -lY --only-run-types ZZ

where:

  • "X" is the number of processors to use for testing
  • "Y" the maximum load to limit to execute the tests
  • "ZZ" the subtype of tests to be run. Currently only "raven" and "dymola" are available.

If all the tests need to be run, just execute the following command:

./run_tests -jX -lY 

The output will look like the following:

$ ./run_tests -j2 | tee out.log
######################################################################
#
#  Testing of Hybrid RAVEN Modules  (./run_tests)
#
######################################################################
/c/msys64/home/FRICKL/cleaning_hybrid/hybrid
Found $DYMOLA_PATH and set to C:/Program Files/Dymola 2021/Modelica/Library/python_interface/dymola.egg
Loading raven_libraries conda environment ...
CONDA
... Run Options:
... Mode: 1
... Verbosity: 0
... Clean: 0
... Mode: CONDA
... Conda Defs:
... Loading RAVEN libraries ...
... Detected OS as --os windows ...
... Using Python command python
... $RAVEN_LIBS_NAME set through raven/.ravenrc to raven_libraries
... >> If this is not desired, then remove it from the ravenrc file before running.
... >> RAVEN environment is named "raven_libraries"
... found conda path in ravenrc: C:/Users/FRICKL/AppData/Local/Continuum/miniconda3/etc/profile.d/conda.sh
... >> If this is not the desirable path, rerun with argument --conda-defs [path] or remove the entry from raven/.ravenrc file.
... Found conda definitions at C:/Users/FRICKL/AppData/Local/Continuum/miniconda3/etc/profile.d/conda.sh
conda 4.8.3
raven_libraries       *  C:\Users\FRICKL\AppData\Local\Continuum\miniconda3\envs\raven_libraries
... Found library environment ...
... Activating environment ...
... Activating environment ...
... done!
PYTHONPATH C:/Program Files/Dymola 2021/Modelica/Library/python_interface/dymola.egg;/c/Program Files/Dymola 2020/Modelica/Library/python_interface/dymola.egg:
rook: loading init file "C:/msys64/home/FRICKL/cleaning_hybrid/hybrid/scripts/rook.ini"
rook: ... loaded setting "add_non_default_run_types = dymola,raven"
rook: ... loaded setting "add_run_types = dymola,raven"
rook: ... loaded setting "test_dir = tests"
rook: ... loaded setting "testers_dirs = scripts/testers,raven/scripts/TestHarness/testers/"
rook: found 27 test dirs under "tests" ...
rook: loading init file "C:/msys64/home/FRICKL/cleaning_hybrid/hybrid/scripts/rook.ini"
rook: ... loaded setting "add_non_default_run_types = dymola,raven"
rook: ... loaded setting "add_run_types = dymola,raven"
rook: ... loaded setting "test_dir = tests"
rook: ... loaded setting "testers_dirs = scripts/testers,raven/scripts/TestHarness/testers/"
(1/27) Success( 35.33sec)tests\dymola_tests\BOP_L1_Boundaries_a_Test\
(2/27) Success( 35.97sec)tests\dymola_tests\BOP_L1_Boundaries_b_Test\
(3/27) Success( 13.83sec)tests\dymola_tests\Desalination_1_pass\
(4/27) Success( 15.08sec)tests\dymola_tests\Desalination_2pass_mixing\
(5/27) Success( 13.84sec)tests\dymola_tests\Desalination_2_pass\
(6/27) Success( 22.37sec)tests\dymola_tests\Desalination_NHES_basic\
(7/27) Success( 19.87sec)tests\dymola_tests\Desalination_ROmodule\
(8/27) Success( 37.94sec)tests\dymola_tests\Desalination_NHES_complex\
(9/27) Success( 15.19sec)tests\dymola_tests\GTTP_Test\
(10/27) Success( 32.14sec)tests\dymola_tests\Generic_Modular_PWR\
(11/27) Success( 21.18sec)tests\dymola_tests\HTSE_Power_Test\
(12/27) Success( 28.29sec)tests\dymola_tests\HTSE_Steam_Test\
(13/27) Success( 34.55sec)tests\dymola_tests\NSSS_test\
(14/27) Success( 46.37sec)tests\dymola_tests\NuScale_4Loop\
(15/27) Success( 29.77sec)tests\dymola_tests\NuScale_Nominal_Test\
(16/27) Success( 13.34sec)tests\dymola_tests\Simple_Breakers_Test\
(17/27) Success( 23.47sec)tests\dymola_tests\NuScale_primary_test\
(18/27) Success( 13.91sec)tests\dymola_tests\StepDownTurbines\
(19/27) Success( 15.16sec)tests\dymola_tests\StepDownTurbines_complex\
(20/27) Success( 11.99sec)tests\dymola_tests\Supervisory_Control_Test\
(21/27) Success( 12.02sec)tests\dymola_tests\Test_Battery_Storage\
(22/27) Success( 29.38sec)tests\dymola_tests\Test_Thermal_Storage\
(23/27) Success( 31.79sec)tests\dymola_tests\Thermocline_Cycling\
"failing"
(24/27) Skipped(  None!  )tests\dymola_tests\TightlyCoupled_FY18_Battery\
"failing"
(25/27) Skipped(  None!  )tests\dymola_tests\TightlyCoupled_FY18_TES\
(26/27) Success( 22.59sec)tests\dymola_tests\Thermocline_Insulation\
(27/27) Success( 28.13sec)tests\raven_tests\train\TrainArmaOnData

PASSED: 25
SKIPPED: 2
FAILED: 0
(raven_libraries)

If just a single dymola test needs to be run, execute the following command:

./run_tests --re tests.dymola_tests.foldername

so for the SMR_4loop test it would be.

./run_tests --re tests.dymola_tests.SMR_4loop

3. Use or develop with the package

If you are a user, you can use the HYBRID (and RAVEN) package now.

  • The Modelica models are stored in the Models/NHES folder
  • The RAVEN input files (workflows) are stored in the Models/RAVEN_WORKFLOWS folder

If you plan to contribute to the development of the HYBRID package, please check the Development workflow.

Specific Instructions for User Locations

Users with shared clusters have some specific installation needs to use the parallel capabilities of job schedulers.

Argonne National Laboratory

For using the torque scheduler on clusters like eddy8core and eddy32core, a couple files and input file modifications need to be made.

Copying Files

There are two custom files that are needed to run RAVEN in distributed parallel on eddy clusters.

The two files are:

  • raven_qsub_ANL.sh, the environment setup script;
  • torqueMode.py, the qsub submission controller class.

Both files can be found at

/home/cluster2/tangyu/projects/hybrid/raven/framework/raven_qsub_ANL.sh

and should be copied to your project folder where the hybrid repository is installed, under hybrid/raven/framework. This will allow you to run on the eddy clusters.

Adjusting RunInfo block

In order to run with these custom modes, the <RunInfo> block needs to be adjusted with a couple additional nodes (compared to typical input files):

  1. RemoteRunCommand
<RemoteRunCommand>raven_qsub_ANL.sh</RemoteRunCommand>
  1. CustomMode
<CustomMode class="TorqueSimulationMode" file="/path/to/hybrid/raven/framework/torqueMode.py">torque</CustomMode>

replacing /path/to with your path to the hybrid repository location,

  1. clusterParameters
<clusterParameters>-q eddy8core</clusterParameters>

where eddy8core can be swapped with any eddy machine,

  1. mode
<mode>torque<runQSUB/></mode>

For example, if my username is "johndoe" and my hybrid project is in "~/projects/", my RunInfo might look like

<Simulation>
  <RunInfo>
    <WorkingDir>.</WorkingDir>
    <RemoteRunCommand>raven_qsub_ANL.sh</RemoteRunCommand>
    <CustomMode class="TorqueSimulationMode" file="/home/johndoe/projects/hybrid/raven/framework/torqueMode.py">torque</CustomMode>
    <mode>torque<runQSUB/></mode>
    <clusterParameters>-q eddy8core</clusterParameters>
    <batchSize>16</batchSize>
    <JobName>myJob</JobName>
    <Sequence>myFirstStep,mySecondStep,myThirdStep</Sequence>
    <expectedTime>2:00:00</expectedTime>
    <internalParallel>True</internalParallel>
  </RunInfo>
  ...
</Simulation>

For more information on what the other nodes do, see the RAVEN user manual.

Oak Ridge National Laboratory

To make raven, a gcc compiler newer than the default is required. Do do this, run the following (tested 2018-04-16):

module load toolchain/gcc

Steps for Romulus Cluster:

  1. Log into cluster

  2. Download and install MiniConda at your root directory (tested with python 2.7 x64). The ???? shoul have been added to your ~/.bashrc

wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
bash Miniconda2-latest-Linux-x86_64.sh
  1. Connect to INL Gitlab (this requires having already set up ssh key pairing)
ssh -D 5555 -o ProxyCommand="corkscrew snowman.ornl.gov 3128 %h %p" [email protected]
  1. Open another terminal and log into cluster again leaving the other terminal open

  2. Clone the hybrid repository into the desired location

git clone [email protected]:hybrid/hybrid.git
- If the repository path has an extra "hpc.", Remove it.
```
git clone [email protected]:hybrid/hybrid.git
git clone [email protected]:hybrid/hybrid.git
```
  1. Update submodules
cd hybrid
git submodule update --init --recursive
  1. Fix moose hit issue (this step may be fixed in future releases)
cd hybrid/raven
touch moose/framework/contrib/hit/hit.cpp
  1. Install raven_libraries
hybrid/raven/scripts/establish_conda_env.sh --install 
  1. Update gcc compiler to make raven
module load toolchain/gcc
  1. Launch job then clean, make, and test raven
qsub -IV
cd hybrid/raven
make clean
make -j2
./run_tests
- Should have mostly passed, a few skipped, and only a few failures (~10 at most)
  1. Now raven is installed you can run your .xml. An example is: