Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldms_ls option to print decomposition templates #1224

Merged
merged 1 commit into from
Jul 3, 2023
Merged

Conversation

tom95858
Copy link
Collaborator

This feature dumps a decomposition template for each unqique schema published by an ldmsd. Although this template can be used directly, it is intended to be edited by the user to define indices of interest and rename/remove columns.

While developing this change it was discovered that the type names produced by ldms_metric_type_to_str() were not symmetric with those consumed by ldms_metric_str_to_type(). This change addresses this discrepency.

Also added is a #define for the minimum SHA256 schema digest string length LDMS_DIGEST_STR_LENGTH.

@tom95858
Copy link
Collaborator Author

@morrone, @narategithub Please take a look at this change and try it out if you can. I have confirmed that the template files created are successfully consumed by an ldmsd. This change does not bother to guess what the "indices" section might be, but creates it nonetheless for the user to edit. This mitigates the pain somewhat of discovering the digests and stuffing them in the digest section so that they can be mapped to schema decomposition rules.

Here's some example output:

{
  "type" : "flex",
  "decomposition" : {
     "slurm_job_data_decomp" : {
       "type" : "static",
       "rows" : [
          {
            "schema" : "slurm_job_data",
            "cols" : [
              { "src" : "context", "dst" : "context", "type" : "char[]", "array_len" : 255 },
              { "src" : "data", "rec_member" : "uid", "dst" : "uid", "type" : "s64" },
              { "src" : "data", "rec_member" : "total_tasks", "dst" : "total_tasks", "type" : "s64" },
              { "src" : "data", "rec_member" : "nodeid", "dst" : "nodeid", "type" : "s64" },
              { "src" : "data", "rec_member" : "local_tasks", "dst" : "local_tasks", "type" : "s64" },
              { "src" : "data", "rec_member" : "ncpus", "dst" : "ncpus", "type" : "s64" },
              { "src" : "data", "rec_member" : "job_id", "dst" : "job_id", "type" : "s64" },
              { "src" : "data", "rec_member" : "gid", "dst" : "gid", "type" : "s64" },
              { "src" : "data", "rec_member" : "nnodes", "dst" : "nnodes", "type" : "s64" }
,
              { "src" : "event", "dst" : "event", "type" : "char[]", "array_len" : 255 },
              { "src" : "timestamp", "dst" : "timestamp", "type" : "s64" },
              { "src" : "schema", "dst" : "schema", "type" : "char[]", "array_len" : 255 }
          ]
        }
      ],
      "indices" : [
      ]
    },
     "slurm_step_data_decomp" : {
... snip ...
     },
  },
  "digest" : {
   "AD6D601CB7089CB18BE36D7C993B1D0865C8A4BC53B2F01B673C22F0EC88E452" : "slurm_task_data_decomp",
    "F655F30DE2E43104080D8B1262A536F1D9BF5567E701519D6ED341C38E96F393" : "slurm_job_data_decomp",
    "F8853EF57772A98F70DEF3FE90A628BB0DC882998AC10E2982510A85C61DA7D1" : "slurm_step_data_decomp"
  }
}

@tom95858
Copy link
Collaborator Author

@morrone, @narategithub sorry forgot the command syntax...

ldms_ls -h localhost -p 20001 -a munge -d

The command honors all the set filter syntax so, if you only want a single set/schema, you could do this:

ldms_ls -h localhost -p 20001 -a munge -d orion-01/meminfo

... or all the schema on a particular node ...

ldms_ls -h localhost -p 20001 -a munge -d -E orion-01/.*

@morrone
Copy link
Collaborator

morrone commented Jun 30, 2023

Looks good to me from what I can see here. I probably won't have a chance to try it until some time next week, but I'll try to fit it in then.

@narategithub
Copy link
Collaborator

@tom95858 I tested this and found 2 issues:

  1. the 'timestamp' is missing from the decomposition dump, and
  2. the "indices" attribute was misplaced. It supposed to be a member of a row object.

I'm sending you a patch in another email.

This feature dumps a decomposition template for each unqique
schema published by an ldmsd. Although this template can be
used directly, it is intended to be edited by the user to
define indices of interest and rename/remove columns.

While developing this change it was discovered that the
type names produced by ldms_metric_type_to_str() were
not symmetric with those consumed by ldms_metric_str_to_type().
This change addresses this discrepency.

Also added is a #define for the minimum SHA256 schema digest
string length LDMS_DIGEST_STR_LENGTH.
@tom95858 tom95858 merged commit 5830abf into OVIS-4 Jul 3, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants