mercanca / spart

spart: a user-oriented partition info command for slurm
GNU General Public License v2.0
19 stars 4 forks source link

Modular output formatter #1

Closed jtfrey closed 5 years ago

jtfrey commented 5 years ago

This set of changes to the spart program streamlines the partition summary process to produce an in-memory representation of the summary data. The display of the summary data has been modularized so that multiple formats can easily be implemented, including:

Bug fixes

Jobs can be submitted with multiple partitions; this manifests as a comma-delimited list of partition names on the job record. The previous implementation:

strncmp(
        part_buffer_ptr->partition_array[j].name,
    job_buffer_ptr->job_array[i].partition,
        strlen (part_buffer_ptr->partition_array[j].name)) == 0

doesn't account for a list of partition names and also could produce false positives for overlapping names (e.g. "large" and "large_smp") since strncmp() was used: for partition->name of "large" and a job->partition of "large_smp" the code above would evaluate to true.

Job state checking was modified to check the binary flags rather than fetching the textual state.

mercanca commented 5 years ago

Thanks for your interest and contributions! However, I want to keep the spart command as a user-oriented partition info command for slurm. Your contributions will convert the project to a very complex codebase which I cannot continue to develop. Also, from a normal user's point of view, there is not much of a difference.