multiscale / muscle3

The third major version of the MUltiScale Coupling Library and Environment
Apache License 2.0
25 stars 13 forks source link

Bug when looking at the timeline profiling information #243

Closed DavidPCoster closed 11 months ago

DavidPCoster commented 1 year ago

muscle3 profile --timeline run_FUSION_MUSCLE3_20230626_183112/performance.sqlite Traceback (most recent call last): File "/gss_efgw_work/scratch/g2dpc/GIT/ets_paf/UQ/fusion_env/bin/muscle3", line 8, in sys.exit(muscle3()) File "/gw/switm/muscle3/0.6.0/intel/2020/lib/python3.10/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/gw/switm/muscle3/0.6.0/intel/2020/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/gw/switm/muscle3/0.6.0/intel/2020/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/gw/switm/muscle3/0.6.0/intel/2020/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/gw/switm/muscle3/0.6.0/intel/2020/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(args, **kwargs) File "/pfs/scratch/g2dpc/GIT/ets_paf/UQ/fusion_env/lib/python3.10/site-packages/muscle3/muscle3.py", line 76, in profile plot_timeline(Path(performance_file)) File "/pfs/scratch/g2dpc/GIT/ets_paf/UQ/fusion_env/lib/python3.10/site-packages/muscle3/profiling.py", line 116, in plot_timeline cur.execute( sqlite3.OperationalError: no such column: instance

and looking at the code

    cur.execute(
            "SELECT instance, (start_time - ?)"
            " FROM events AS e"
            " JOIN event_types AS et ON (e.event_type_oid = et.oid)"
            " WHERE et.name = 'REGISTER'", (min_time,))

but events looks like

CREATE TABLE events ( instance_oid INTEGER NOT NULL REFERENCES instances(oid), event_type_oid INTEGER NOT NULL REFERENCES event_types(oid), start_time INTEGER NOT NULL, stop_time INTEGER NOT NULL, port_name TEXT, port_operator_oid INTEGER REFERENCES port_operators(oid), port_length INTEGER, slot INTEGER, message_number INTEGER, message_size INTEGER, message_timestamp DOUBLE);

LourensVeen commented 1 year ago

Aw geez, I renamed the columns but failed to update the renderer. And this accesses the database directly rather than through the Python functions, so there's no unit test, because you don't want a plot popping up and waiting for user input in the middle of your tests. I tested it by hand of course, but probably against a database of an old run that had the old name. Ugh.

I'll consider a hotfix release for this actually, it's pretty annoying after all that effort to get this out the door. In the meantime you could of course edit that profiling.py file in the installation to see the pretty picture, which maybe you've already done.

LourensVeen commented 11 months ago

Fix released with 0.7.1, please reopen if you encounter further issues.