Engee documentation

Software control of RITM

To work with RITM software control functions in Engee, install the hardware support package by executing the command:

engee.package.install("Engee-Device-Manager")

This page presents all available functions of the software control of the CPM "RITM" in Engee.

Methods RITM.

Targets.compile_model(ritm::Any, model::Model, is_ext_mode::Bool)

Assembling the model on RITM.

Arguments

  • ritm::Any: object of the target RITM platform. Defined with the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model::Model: object of type Model.

  • is_ext_mode::Bool: flag indicating the mode of model execution. true - the model is executed in interactive mode. false - the model is executed in the independent mode.

Examples

model = Engee.engee.gcm()
Targets.upload_model(ritm, model)
Targets.generate_executable_code(ritm, model, false)
Targets.compile_model(ritm, model)
Targets.generate_executable_code(ritm::Any, model::Model, is_ext_mode::Bool)

Generates C-binding on RITM.

Arguments

  • ritm::Any: RITM target platform object. Defined with the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model::Model: object of type Model.

  • is_ext_mode::Bool: flag indicating the mode of model execution. true - the model is executed in interactive mode. false - the model is executed in the independent mode.

Examples

model = Engee.engee.gcm()
Targets.upload_model(ritm, model)
Targets.generate_executable_code(ritm, model, false)
Targets.RITM.set_url(ritm:Any, url::String)

Sets the address of the RITM machine.

Arguments

  • ritm::Any: RITM target platform object. Set with the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • url::String: RITM machine address.

Examples

ritm = Targets.RITM.Ritm()
Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
Targets.start_model(ritm::Any, model::Model)

Runs the model on RITM.

Arguments

  • ritm::Any: RITM target platform object. Defined with the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model::Model: object of type Model.

Examples

Targets.start_model(ritm, model)
Targets.stop_model(ritm::Any)

Stops the model at RITM.

Arguments

ritm::Any: RITM target platform object. Defined with the consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

Examples

Targets.stop_model(ritm)
Targets.upload_model(ritm::Any, model::Model)

Uploads the model to RITM.

Arguments

  • ritm::Any: RITM target platform object. Defined with the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model::Model: object of type Model.

Examples

model = Engee.engee.gcm()
Targets.upload_model(ritm, model)
RITM_API.getData(ritm::Any, model_name::String, file_path::String, in_file::Bool = false)

Returns the result of model profiling on RITM. Depending on the value of in_file, the result can be returned as a string or saved to a file at the specified path.

Arguments

  • ritm::Any: RITM target platform object. Specified with the consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model_name::String: name of the model for which profiling data is requested.

  • file_path::String: path where to save the result (if in_file = true). If in_file = false, the value is ignored.

  • in_file::Bool = false: specifies how to return the result. If true, the data is saved to a file at file_path. If false, a string with the result is returned.

Examples

# Получает данные профилирования как строку
result = RITM_API.getData(ritm, "newmodel_1", "", false)

# Сохраняет данные в файл на РИТМе
RITM_API.getData(ritm, "newmodel_1", "/user/profile.txt", true)
RITM_API.getFile(ritm::Any, file_name::String; from=/mydir::String, to=::String)

Gets the specified file file_name from the directory /home/ritm/build/model_name/build/, where model_name is the model name in Engee.

Arguments

  • ritm::Any: RITM target platform object. Specified using the sequential commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • file_name::String: name of the file of interest.

  • from=/mydir::String: path to the directory with the file of interest (default /home/ritm/build/model_name/build/).

  • to=::String: path to the directory in Engee to save the file (defaults to the current directory).

Examples

RITM_API.getFile(ritm, "install_manifest.txt"; from="/home/ritm/build/newmodel_1/build/", to="")
RITM_API.getLog(ritm::Any, num::Int64)

Returns the specified number of model execution log lines on the RITM.

Arguments

  • ritm::Any: RITM target platform object. Specified with the consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • num::Int64: number of output lines from the logs.

Examples

RITM_API.getLog(ritm, 10)
RITM_API.getScreenshot(ritm::Any, filename::String = "screenshot.png")

Creates a screenshot on the target RITM platform and returns the path to the saved image. The screenshot is saved in a temporary directory on the RITM machine. The output file name can be specified explicitly; the default is "screenshot.png".

Arguments

  • ritm::Any: RITM target platform object. Specified using the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • filename::String = "screenshot.png": name of the file to which the screenshot will be saved (on the RITM side).

Examples

# Создает скриншот и получает путь к нему
path = RITM_API.getScreenshot(ritm, "example.png")
RITM_API.isConnected(ritm::Any)

Checks the availability of RITM.

Arguments

ritm::Any: RITM target platform object. Defined with the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

Examples

RITM_API.isConnected(ritm)
RITM_API.isRunning(ritm::Any, model_name::String)

Checks if the specified model is running on the target RITM platform. Returns true, if the model with the specified name is currently running on the RITM machine, and false if it is not.

Arguments

  • ritm::Any: RITM target platform object. Specified with the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model_name::String: the name of the model whose state is to be checked.

Examples

# Проверяет, запущена ли модель "newmodel_1"
is_active = RITM_API.isRunning(ritm, "newmodel_1")
RITM_API.listFiles(ritm::Any, path::String)

Outputs a list of files in the specified directory.

Arguments

  • ritm::Any: RITM target platform object. Specified with the consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • path::String: path to the directory of interest.

Examples

RITM_API.listFiles(ritm, "/home/ritm/")
RITM_API.memInfo(ritm::Any, model::String)

Displays information about the memory consumed by the model.

Arguments

  • ritm::Any: RITM target platform object. Specified with the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model::String: model name. If "" is left blank, it will return the result of system profiling as [total, used, free]. If you specify the model name, it will return the number of bytes of memory consumed by the model.

Examples

RITM_API.memInfo(ritm, "newmodel_1")
RITM_API.readFile(ritm::Any, file_name::String; path=/mydir::String)

Outputs the contents of the specified file file_name from the directory /home/ritm/build/model_name/build/, where model_name is the model name in Engee.

Arguments

  • ritm::Any: RITM target platform object. Specified using the serial commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • file_name::String: name of the file of interest.

  • path=/mydir::String: path to the directory with the file of interest (by default /home/ritm/build/model_name/build/).

Examples

RITM_API.readFile(ritm, "install_manifest.txt"; path="/home/ritm/build/newmodel_1/build/")