Difference between revisions of "Statistical Algorithms Importer: StatusUpdate"

From Gcube Wiki
Jump to: navigation, search
(Created page with "{| align="right" ||__TOC__ |} :This page explains how to update the status of a process from a SAI-integrated algorithm. == Updating the status of a process == It is suff...")
 
Line 8: Line 8:
 
== Updating the status of a process ==
 
== Updating the status of a process ==
  
It is sufficient to '''write a file named "status.txt" ''' in the algorithms' process folder indicating '''a number from 0 to 100'''. The DataMiner will transform this information into a WPS status, also visible through the status bar of the DataMiner GUI. The algorithm's status is always forced to 100 by DataMiner at the end of the computation.  
+
It is sufficient to '''write a file named "status.txt" ''' locally to the process indicating '''a number from 0 to 100'''. The DataMiner will transform this information into a WPS status, also visible through the status bar of the DataMiner GUI. The algorithm's status is always forced to 100 by DataMiner at the end of the computation.  
  
 
For example, the following R script writes a local ./status.txt file indicating its internal status.  
 
For example, the following R script writes a local ./status.txt file indicating its internal status.  

Revision as of 12:07, 14 May 2018

This page explains how to update the status of a process from a SAI-integrated algorithm.


Updating the status of a process

It is sufficient to write a file named "status.txt" locally to the process indicating a number from 0 to 100. The DataMiner will transform this information into a WPS status, also visible through the status bar of the DataMiner GUI. The algorithm's status is always forced to 100 by DataMiner at the end of the computation.

For example, the following R script writes a local ./status.txt file indicating its internal status.

nseconds <- 60
 
nsteps = nseconds/10
 
for (i in 1:nsteps){
  status = i*100/nsteps
  cat("Status",status,"\n")
  write(status,file="status.txt")
  Sys.sleep(1)
 
}
 
output="test.txt"
write(nseconds,file=output)