OpenSeesPy Is Not Terrible for the Environment

This tweet made the rounds in late September, early October. Those new to OpenSeesPy, or unaware of how it works, might have been alarmed. I’m here to reassure you that OpenSeesPy is not a huge CO2 producer like native Python code.

OpenSeesPy is C++ code that calls the Python C/C++ API so that you can build and analyze OpenSees models in a Python script. The computational engine of the OpenSees framework is written in C++ and FORTRAN. So, all the finite element state determination, assembly, iterating, solving, and time stepping is fast–and light on the CO2.

Although the graph in the tweet is based on astronomy simulations, the trend carries over to finite element analysis. I’ve seen and run structural FEA code written in native Python, and it is brutally slow. But, the comparisons of Python with C++ or FORTRAN for number crunching are unfair because Python is interpreted while C++ and FORTRAN are compiled.

Of course, what you do in your Python scripts, e.g., with numpy, pandas, TensorFlow, etc., after you import openseespy.opensees can lead to larger amounts of CO2 production. But you have to weigh that against the CO2 footprint associated with prolonged development time when not using all those nice Python packages.

By the way, where’s Tcl on that graph? Although it has other strengths, for number crunching, native Tcl has to be way worse than native Python.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.