UWB-Biocomputing / WorkBench

Software and data provenance management platform for simulations of dissociated cortical cultures.
https://uwb-biocomputing.github.io/WorkBench/
Apache License 2.0
1 stars 3 forks source link

Investigate the parsing of BrainGrid output log files #58

Closed jConquest closed 3 years ago

jConquest commented 3 years ago

As BrainGrid is going through upgrades to the log output that occurs during simulation execution, it is important to research what the current Workbench system does to parse the output log files of BrainGrid. Identify the code that is being called in workbench to parse in order to

  1. update this code to reflect changes to the parse output from BrainGrid

  2. expand this code to get updates from execution in workbench without having to repeatedly click the analyze button

jConquest commented 3 years ago

Analyze button causes the parsing of log files. Currently, Analyze button front-end code lives in SimStartAttributesSelector.java, see line 136

Front-end calls analyzeScriptOutput() function of the WorkbenchManager object passed to SimStarterAttributesSElector.java as a parameter.

In WorkbenchManager.java, analyzeScriptOutput() starts on line 419. It adds to the workbench output messageAccumilator, determines project output location using the substantiated ProjectMgr object (not to be confused with ProjectManager), and calls analyzeScriptOutput() on the ScriptManager object substantiated by the WorkbenchManager analyzeScriptOutput() function

jConquest commented 3 years ago

The back-end code for the parsing of log output files is in ScriptManager.java starting on line 634. See analyzeScriptOutput()

jConquest commented 3 years ago

public long analyzeScriptOutput(SimulationSpecification simSpec, ProjectMgr projectMgr, ProvMgr provMgr, String outputTargetFolder) throws JSchException, SftpException, IOException

gets localOutputFileName, creates a OutputAnalyzer object and then calls analyzeOutput on the OutputAnalzyer object using localOutputFilename as input to function.

jConquest commented 3 years ago

In OutputAnalyzer.java on line 46 we see the analyzeOutput() fucntion uses Script and ExecutedCommand objects

Using java scanner, it opens the output file and parse by line.

Using the Script object to determine if the current line that is parsed is a command, if true the following proceeds: parse command from line, and substantiated ExecuteCommand object with this parsed line as input for the getExectuedCommand function.

It then sets the start date if null and calls getImportantText to obtain the current script exit status. If not null set exit status using ExecutCommand object's setExitStatus function.

Then gets time ended, sets the completed time on ExecuteCommand calling setTimeCompleted and calls addCommand() before iterating to the next line

jConquest commented 3 years ago

in OutputAnalyzer.java the two helper function being called are:

getImportantText() on line 218

and addCommand() on line 289