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.

ritm.compile_model(model, is_ext_mode)

Builds a model based on the RITM.

Arguments

  • model::Model: an object of the Model type.

  • is_ext_mode::Bool: a flag indicating the execution mode of the model. true — the model is executed interactively. false — the model runs in independent mode.

Examples

model = engee.gcm()
ritm.upload_model(model)
ritm.generate_executable_code(model, false)
ritm.compile_model(model, false)
ritm.generate_executable_code(model, is_ext_mode)

Generates a Si-strapping on the RITM.

Arguments

  • model::Model: an object of the Model type.

  • is_ext_mode::Bool: a flag indicating the execution mode of the model. true — the model is executed interactively. false — the model runs in independent mode.

Examples

model = engee.gcm()
ritm.upload_model(model)
ritm.generate_executable_code(model, false)
ritm.set_url(url)

Sets the address of the RITM machine.

Arguments

url::String: the address of the RITM machine.

Examples

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

Starts the model based on the RITM.

Arguments

model::Model: an object of the Model type.

Examples

ritm.start_model(model)
ritm.stop_model()

Stops the model at the RITM.

Arguments

Missing (the method is called from the RITM object).

Examples

ritm.stop_model()
ritm.upload_model(model)

Loads the model to the RITM.

Arguments

model::Model: an object of the Model type.

Examples

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

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

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using sequential 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 for which profiling data is requested.

  • file_path::String: the path 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 by file_path. If false, returns the result string.

Examples

# Gets the profiling data as a string
result = RITM_API.getData(ritm, "newmodel_1", "", false)

# Saves data to a file at RITM
RITM_API.getData(ritm, "newmodel_1", "/user/profile.txt", true)
RITM_API.getFile(ritm::Any, file_name::String; from=/mydir::String, to=::String)

Retrieves the specified file file_name from the directory /home/ritm/build/model_name/build/, where model_name — the name of the model in Engee.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

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

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

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

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 lines of model execution logs for the RITM.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • num::Int64: the 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 name of the output file can be specified explicitly; by default, it is used "screenshot.png".

Arguments

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

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

Examples

# Creates a screenshot and gets the path to it
path = RITM_API.getScreenshot(ritm, "example.png")
RITM_API.isConnected(ritm::Any)

Checks the availability of the RITM.

Arguments

ritm::Any: an object of the target RITM platform. It is set using consecutive 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 whether the specified model is running on the target RITM platform. Returns true if the model with the specified name is currently in progress on the RITM machine, and false if it is not executed.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive 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 condition needs to be checked.

Examples

# Checks whether the "newmodel_1" model is running
is_active = RITM_API.isRunning(ritm, "newmodel_1")
RITM_API.listFiles(ritm::Any, path::String)

Displays a list of files in the specified directory.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • path::String: the 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: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model::String: the name of the model. If left empty "", then returns the result of profiling the system in the form [total, used, free]. If you specify the model name, it returns 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 — the name of the model in Engee.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

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

  • path=/mydir::String: the 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/")