selectTaskRun {openMpp} | R Documentation |
Select modeling task run: status and results
selectTaskRun(dbCon, taskRunId)
dbCon |
database connection |
taskRunId |
id of modeling task run |
This call return task run status, time and id's of input working sets and output results.
Task run status can be one of:
i
= not yet started
p
= run in progress
w
= run in progress, wait for additional input
s
= completed successfully
e
= failed (error)
x
= reserved
Status w
means task can be dynamically updated by external script.
Model executable is waiting for additional input into or for "ready to be completed" signal.
Use setTaskWaitCompleted
function to mark task as "ready to be completed".
Use updateTask
function to insert additional task input.
List of database rows:
taskRunLst |
task_run_lst row: task run id, status and time |
taskRunSet |
task_run_set rows: input workset id's and result run id's |
To run examples you must have modelOne database modelOne.sqlite in current directory
amc1999
OpenM++ documentation: https://github.com/openmpp/openmpp.github.io/wiki
getModel
getTaskIdByName
getTaskFirstRunId
getTaskLastRunId
selectTask
selectTaskList
selectTaskRunList
setTaskWaitCompleted
# # connect to database # theDb <- dbConnect(RSQLite::SQLite(), "modelOne.sqlite", synchronous = "full") invisible(dbGetQuery(theDb, "PRAGMA busy_timeout = 86400")) # recommended # get definition for "modelOne" model # # use model name only to identify the model # if there are multiple versions of the model in database # then first one is selected: where model id = min(model_id) for "modelOne" # defRs <- getModel(theDb, "modelOne") taskId <- getTaskIdByName(theDb, defRs, "taskOne") if (taskId <= 0L) stop("task: ", "taskOne", " not found for model: ", defRs$modelDic$model_name, " ", defRs$modelDic$model_digest) # last (most recent) run of that task lastId <- getTaskLastRunId(theDb, taskId) if (lastId <= 0L) stop("task run(s) not found, task: ", taskId) # select task run status, input and output taskRunRs <- selectTaskRun(theDb, lastId) # select list of all task runs taskRunLstRs <- selectTaskRunList(theDb, taskId) dbDisconnect(theDb)