Skip to content

Commit

Permalink
Fixed campaign python script. Clean-up
Browse files Browse the repository at this point in the history
removed rowid
  • Loading branch information
dmitry-ganyushin authored and vicentebolea committed Feb 21, 2024
1 parent df3a6bb commit 13d83fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions source/adios2/engine/campaign/CampaignManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ int CMapToSqlite(const CampaignRecordMap &cmap, const int rank, std::string name
sqlite3_free(zErrMsg);
}

size_t rowid = 1000;
for (auto &r : cmap)
{
sqlcmd = "INSERT INTO bpfiles (name)\n";
sqlcmd += "VALUES('" + r.first + "');";
rowid++;
rc = sqlite3_exec(db, sqlcmd.c_str(), 0, 0, &zErrMsg);
if (rc != SQLITE_OK)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import argparse
import glob
import json
import sqlite3
import zlib
from datetime import datetime
Expand Down Expand Up @@ -145,7 +144,7 @@ def AddDatasetToArchive(args: dict, dataset: str, cur: sqlite3.Cursor, hostID: i
print(f"WARNING: Dataset {dataset} is not an ADIOS dataset. Skip")


def ProcessJsonFile(args: dict, jsonlist: list, cur: sqlite3.Cursor, hostID: int, dirID: int):
def ProcessDBFile(args: dict, jsonlist: list, cur: sqlite3.Cursor, hostID: int, dirID: int):
for entry in jsonlist:
# print(f"Process entry {entry}:")
if isinstance(entry, dict):
Expand Down Expand Up @@ -217,15 +216,15 @@ def Update(args: dict, cur: sqlite3.Cursor):
# (shortHostName, longHostName))
# hostID = curHost.lastrowid

curDir = cur.execute('insert into directory values (?, ?)',
curDir = cur.execute('insert or replace into directory values (?, ?)',
(hostID, rootdir))
dirID = curDir.lastrowid
con.commit()

db_list = MergeDBFiles(dbFileList)

# print(f"Merged json = {jsonlist}")
ProcessJsonFile(args, db_list, cur, hostID, dirID)
ProcessDBFile(args, db_list, cur, hostID, dirID)

con.commit()

Expand Down

0 comments on commit 13d83fc

Please sign in to comment.