Skip to content
Open
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
8 changes: 4 additions & 4 deletions src/slurmanalyser/sacctlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,22 +436,22 @@ def get_colnames_from_sacclog(filename):
return colnames

@staticmethod
def parse_sacclog_iter_generic(filename, colnames=None, header=True):
def parse_sacclog_iter_generic(filename, columns=None, header=True):
"""This is generic sacct log processor and only can handle | in the jobname"""
m_open = get_file_open(filename)

# newline = '\n' is importent because some jobs contains \r and universal new line treat it as a new line
with m_open(filename, 'rt', newline = '\n') as fin:
if header:
line = next(fin).rstrip()
if colnames is not None and colnames != line.split("|"):
if columns is not None and columns != line.split("|"):
raise ValueError("Column names do not match one in file!")

ncols = len(colnames)
ncols = len(columns)
col_pos = array.array('l', [0] * (ncols + 1))

# assume only JobName can contain |
icol_jobname = colnames.index("JobName")
icol_jobname = columns.index("JobName")

for line in fin:
# no | in comment or jobname
Expand Down