MATLAB Answers

Polyspace Code Prover doesn't create a report after a remote execution via command line

52 views (last 30 days)
Alessandro Samori
Alessandro Samori on 21 Sep 2021 at 14:14
Edited: Anirban on 23 Sep 2021 at 13:13
I'm trying to run Polyspace Code Prover by command line in Windows. I create an "-options-file" to configure Polyspace. I'm using the option "-batch" and "-scheduler" to use a remote server. I'd like to have a report in a pdf format in a location that I want. To have this, I put at the end of my options file these lines:
# name of the report
-report-output-name test1_Code
# template provided by Polyspace
-report-template C:\Program Files\Polyspace\R2019b\toolbox\polyspace\psrptgen\templates\Developer.rpt
# choose wich extension for the report [HTML|PDF|Word]
-report-output-format PDF
-results-dir C:\Polyspace_Workspace\Results
After running the command "polyspace-code-prover -options-file <path>\myOptionsFile.txt" by command line, everything is going well (no error) and if I verify in Polyspace tool->Open Job Monitor I can see my task that is being executed. However, when I verify in the path of the result (C:\Polyspace_Workspace\Results\Polyspace-Doc), there isn't the .pdf file and if I open the "ps_results.pscp" with Polyspace it gives me this warning:
Does someone know how to generate the report when the remote server finishes the execution? I read this sentence that alarmed me:
"After the analysis, you might have to manually download the results from the cluster" at the link of the documentation https://it.mathworks.com/help/polyspace_code_prover_server/ref/runbugfinderorcodeproveranalysisonaremoteclusterbatch.html#bt51qas-2
Am I doing mistakes in creating the report? If further information is needed, I will provide it.
Thanks,
Alessandro

Accepted Answer

Anirban
Anirban on 22 Sep 2021 at 15:11
Edited: Anirban on 23 Sep 2021 at 13:13
Thanks for the question!
If you use the remote analysis options in the Polyspace user interface, the results are automatically downloaded after analysis and the report generation should occur fine.
At the command line, you have to explicitly download the results using the polyspace-jobs-manager command using the syntax:
polyspace-jobs-manager download -job ID -results-folder FolderPath
Once you submit a job, the compilation part of the analysis runs locally. Then, the data is submitted to the server. After submission, the results folder contains a file ID.txt that gives you the job ID (or even at the console, you can see the job ID). You can use the command polyspace-jobs-manager listjobs to check if the job with your ID is completed. Once completed, you can download the results using the above syntax. Then, you can use the polyspace-report-generator command to generate a report from the downloaded results.
As you can see, this is not as friendly as the automatic download and report generation in the UI. There are two stages where you have to implement some sort of spooling: check if the compilation is done and an ID is available, then later check if the job has completed on the server. If you are comfortable doing that, you can write a script that will do this. The desktop workflow was mainly designed to be interactive. So, even if there are commands available, it takes quite a bit of work to put them into a script where everything would be automated.
  1 Comment
Alessandro Samori
Alessandro Samori on 23 Sep 2021 at 6:33
Hi Anirban,
Your answer solved my issue. In fact the, job ID is in the folder C:\Polyspace_Workspace\Results\Polyspace-Doc\.status and if I run the command
polyspace-jobs-manager download -job <content of the ID.txt file without the name o the server> -results-folder C:\Polyspace_Workspace\Results1\Polyspace-Doc
the result is automatically generated because, probably, I inserted the generator commands at the end of the "options file".
Thank you so much for your fast answer and for the details in it.

Sign in to comment.

More Answers (0)

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by