Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HopsanCLI saves fullCSV on error #2007

Open
mrejster opened this issue Oct 20, 2020 · 3 comments
Open

HopsanCLI saves fullCSV on error #2007

mrejster opened this issue Oct 20, 2020 · 3 comments
Assignees

Comments

@mrejster
Copy link

mrejster commented Oct 20, 2020

Describe the bug
A clear and concise description of what the bug is.
When using hopsanCLI, and a component generates an error the simulation stops as it should.
But then hopsan tries to save the full CSV file anyway, WITHOUT caring about the --logonly variables. For my size model, this results in a csv file of over 300Gb. This effectively locks up the computer, and is impossible to handle since the return status seen by the calling software is received after the saving occurs.

To Reproduce
If the bug can be reproduce, please give the steps taken to reproduce the behavior:
Not sure if this applies to all components (in my example its custom components), but try making a model that throws an error during simulation and see if hopsanCLI generates a csv file not obaying the saveonly flag.

Expected behavior
A clear and concise description of what you expected to happen.
HopsanCLI should just halt on error.

Screenshots, Model or Data files
If applicable, add screenshots, models or data files, that display or cause the bug.

Hopsan version (please complete the following information):
Version information is shown in the message widget when HopsanGUI is started

  • OS: [Windows 10]
  • Version: [HopsanCore 64-bit, Version: 2.14.0.20200826.0831
    HopsanGUI 64-bit, Version: 2.14.0.20200826.0831]
  • Build: Is this an official build downloaded from the web page, or did you compile it yourself
    Custom build from Robert.

Additional information
Add any other context/information about the problem here.

Here's the output from hopsan:
Error: In hydMech_P_A_3; hydMech_P_A> ports crossing more than 10 mm!
Info: In hydMech_P_A_3; X1=0.034766076085979106
Info: In hydMech_P_A_3; X2=0.038604388594068742
Info: In hydMech_P_A_3; Simulation was stopped at t=-0.076045999992137098
Info: In md20_lr_5_5; Simulation was stopped at t=-0.076045999992137098
Error: In hydMech_P_A_3; hydMech_P_A> volume < 0!
Info: In hydMech_P_A_3; X1=0.034766076085979106
Info: In hydMech_P_A_3; X2=0.038604388594068742
Info: In hydMech_P_A_3; Simulation was stopped at t=-0.076045999992137098
Info: In md20_lr_5_5; Simulation was stopped at t=-0.076045999992137098
Saving Full results to file: cli\output.csv
Transposing CSV file

@peterNordin
Copy link
Member

peterNordin commented Oct 20, 2020

I can not recreate this issue using the latest version of Hopsan (master branch)
Can you give me an example of the commandline you use to call hopsancli ?

As an example I tested with this one:
./hopsancli_d -m ../UnitTests/HopsanCoreTests/SimulationTest/unittestmodel.hmf -s hmf --resultsFullCSV test.csv --resultsCSVSort cols --logonly TestGain\#out

I also added simulation abort at t=0.5 in that model to run the test again. (Just connect a SimulationTime block into StopSimulation) The output file still contains the same information up until the stop time, where the aborted output contains one incomplete additional line with zeroes, which is a different problem.

Also is the version information given correct ? If so try to upgrade. Not that anything in this code has changed for a while.

@peterNordin peterNordin self-assigned this Oct 20, 2020
@peterNordin
Copy link
Member

I found that if you do not use the resultsSortCSV cols option, then when the simulation aborts, the export would still contain the entire time vector. But I think that I have fixed that problem in my ongoing work #2002
Also now if the CSV data is transposed, it does not have that extra line with missing data at the end. At least in my tests.

@mrejster
Copy link
Author

mrejster commented Oct 21, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants