Skip to content

Issue with | character in .events file #9

@Grotvergin

Description

@Grotvergin

Hello!

We encountered an issue with using the | character inside a .events file.

On our cluster, we have several types of nodes (type_a, type_b, ..., type_f), and users can specify the desired ones in the --constraint= option. Within this list, elements are separated by the | character, which denotes a logical OR.

The problem appears when running such a job in the simulator. For example:

-dt 123 -e submit_batch_job | -J jobid_123 -sim-walltime 100 --uid=2428 -t 6060 -A proj_1567 -n 4 --constraints="type_a|type_b" pseudo.job

In this case, the simulator interprets the | character as a delimiter between the event time and the event data, which is incorrect.

Example error:

File "/opt/slurm_sim_tools/src/slurmsimtools/run_slurmsim.py", line 216, in read_trace
    event_command, event_details = line.split("|")
ValueError: too many values to unpack (expected 2)

In other words, a single line in the .events file is not allowed to contain more than one | character. This is a Python-level issue, which I have already fixed in the script.

However, I later discovered that the | delimiter is also hardcoded in C code, specifically in the strtok function:

/opt/slurm_sim_tools/slurm_simulator/contribs/sim/sim_events.c:
char * event_command = strtok(cmdline, "|");

As I understand, this means the C part of the simulator also uses | as a fixed delimiter.

Could you please advise if there is a way to work around this limitation? What would be the simplest approach to change this delimiter to another character?

Thanks,
Roma

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions