Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions preciceprofiling/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,19 +466,25 @@ def mergeCommand(files, outfile, align):
resolved = detectFiles(files)
sanitized = sanitizeFiles(resolved)

# Remove the old DB if present
outfile.unlink(missing_ok=True)
con = sqlite3.connect(outfile)

# We create the db in-memory and safe it to disk later (10% faster)
con = sqlite3.connect(":memory:")

loadProfilingOutputs(con, sanitized)

if align:
alignEvents(con)

# commit and tidy up
con.commit()
createIndices(con)
con.execute("VACUUM")
con.commit()

# Backup the in-memory DB to a blank DB on disk
filedb = sqlite3.connect(outfile)
con.backup(filedb)
con.close()
filedb.close()

return 0

Expand Down