Skip to content

Long runtimes on Windows for code using parameter estimate #293

@lbianchi-lbl

Description

@lbianchi-lbl

This was originally reported on #249, where we noticed that example notebooks in Tutorials/Advanced/ParamEst take approximately 10 times longer to complete on Windows than on Ubuntu. This might or might not be related to recent changes in Pyomo and/or PySP.

I've started to look into this in more detail using one of the ParamEst notebooks, parameter_estimation_NRTL_using_state_block_solution_testing. Here's a summary of what I found out:

  • I extracted the Python code in the notebook to a standalone file (parmest_state_block.py, attached inside parmest.zip)
  • Running the file as a script with python parmest_state_block.py on Ubuntu and Windows seems to confirm the fact that the runtime on Windows (~400 s) is much longer than on Ubuntu (~40 s)
    • My testing on Windows was on a VM
    • Comparing the outputs (ubuntu.log and win.log, attached), my untrained eye didn't spot any glaring differences between the two
    • The output of pip list for each system is attached
  • Running the file through the standard cProfile compiler (python -m cProfile -o parmest.prof parmest_state_block.py) on the two OSes resulted in the two .prof files attached inside parmest.zip
    • These can be visualized interactively with the snakeviz tool (pip install snakeviz && snakeviz parmest.prof)
    • The information on Windows looks partial or incomplete (possibly because of differences in how the two OSes collect metrics from subprocesses?)
  • Finally, I ran the notebook manually on Windows, with similarly long runtimes. A PDF export of the finished output is attached (HTML version inside parmest.zip)

parameter_estimation_NRTL_using_state_block_solution_testing.pdf
parmest.zip
pip-list-ubuntu.txt
pip-list-win.txt
ubuntu.log
win.log

Metadata

Metadata

Labels

Priority:HighHigh Priority Issue or PRbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions