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

Add JSON schema #22

Open
mxmlnkn opened this issue Apr 30, 2019 · 0 comments
Open

Add JSON schema #22

mxmlnkn opened this issue Apr 30, 2019 · 0 comments

Comments

@mxmlnkn
Copy link

mxmlnkn commented Apr 30, 2019

For a quick check for correctness of the profile summaries, I propose to add a schema definition file to this repo:

profile-summary.1.schema.json: JSON schema matching the current format

{
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties":
  {
    "Trace": {
      "type": "object",
      "properties":
      {
        "FileName": { "type": "string" },
        "Id": { "type": "integer" }
      }
    },
    "JobId": { "type": "integer" },
    "NodeCount": { "type": "integer", "minimum": 0 },
    "ProcessCount": { "type": "integer", "minimum": 0 },
    "ThreadCount": { "type": "integer", "minimum": 0 },
    "TimerResolution": { "type": "integer", "minimum": 0 },
    "HardwareCounters": { "type": "array" },
    "Functions": {
      "type": "object",
      "patternProperties":
      {
        "":
        {
          "type": "object",
          "properties":
          {
            "Count": { "type": "integer", "minimum": 0 },
            "Time": { "type": "integer", "minimum": 0 }
          }
        }
      }
    },
    "Messages": {
      "type": "object",
      "patternProperties": { "": { "type": "object" } }
    },
    "CollectiveOperations": {
      "type": "object",
      "patternProperties": { "": { "type": "object" } }
    },
    "IOOperations": {
      "patternProperties":
      {
        "":
        {
          "type": "object",
          "properties":
          {
            "Bytes": { "type": "integer", "minimum": 0 },
            "Count": { "type": "integer", "minimum": 0 },
            "MetaOperationTime": { "type": "integer", "minimum": 0 },
            "TransferOperationTime": { "type": "integer", "minimum": 0 }
          }
        }
      }
    },
    "Files": {
      "type": "array",
      "items":
      {
        "type": "object",
        "properties":
        {
          "FileName": { "type": "string" },
          "IoParadigm": {
            "type": "array",
            "items": { "type": "string" }
          },
          "AccessModes": { "type": "string", "pattern": "^[RWXS]+$" },
          "ParentFile": { "type": [ "string", "null" ] }
        }
      }
    },
    "ParallelRegionTime": { "type": "integer", "minimum": 0 },
    "SerialRegionTime": { "type": "integer", "minimum": 0 },
    "TotalFunctions": { "type": "integer", "minimum": 0 },
    "TotalCalls": { "type": "integer", "minimum": 0 }
  }
}

However, I'm quite unhappy with having to use patternProperties. Imho, IOOperations, Functions, Messages, CollectiveOperations, Files should not be objects with contents name : object but instead should be lists [ { name: ..., content1: ..., ... }, ... ]. In that case, the Schema would look like below:

profile-summary.2.schema.json: Proposed schema (untested)

{
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties":
  {
    "Trace": {
      "type": "object",
      "properties":
      {
        "FileName": { "type": "string" },
        "Id": { "type": "integer" }
      }
    },
    "JobId": { "type": "integer" },
    "NodeCount": { "type": "integer", "minimum": 0 },
    "ProcessCount": { "type": "integer", "minimum": 0 },
    "ThreadCount": { "type": "integer", "minimum": 0 },
    "TimerResolution": { "type": "integer", "minimum": 0 },
    "HardwareCounters": { "type": "array" },
    "Functions": {
      "type": "array",
      "items":
      {
        "type": "object",
        "properties":
        {
          "Count": { "type": "integer", "minimum": 0 },
          "Time": { "type": "integer", "minimum": 0 }
        }
      }
    },
    "Messages": {
      "type": "object",
      "items": { "type": "object" }
    },
    "CollectiveOperations": {
      "type": "object",
      "items": { "type": "object" }
    },
    "IOOperations": {
      "items":
      {
        "type": "object",
        "properties":
        {
          "Bytes": { "type": "integer", "minimum": 0 },
          "Count": { "type": "integer", "minimum": 0 },
          "MetaOperationTime": { "type": "integer", "minimum": 0 },
          "TransferOperationTime": { "type": "integer", "minimum": 0 }
        }
      }
    },
    "Files": {
      "type": "array",
      "items":
      {
        "type": "object",
        "properties":
        {
          "FileName": { "type": "string" },
          "IoParadigm": {
            "type": "array",
            "items": { "type": "string" }
          },
          "AccessModes": { "type": "string", "pattern": "^[RWXS]+$" },
          "ParentFile": { "type": [ "string", "null" ] }
        }
      }
    },
    "ParallelRegionTime": { "type": "integer", "minimum": 0 },
    "SerialRegionTime": { "type": "integer", "minimum": 0 },
    "TotalFunctions": { "type": "integer", "minimum": 0 },
    "TotalCalls": { "type": "integer", "minimum": 0 }
  }
}

However, I'm not sure which of entries should be made required. I think at least TimerResoultion should be made required as else all the times are useless. But on the other hand, maybe we are not intersted in times but only in file accesses, ...

Also, a version number as proposed in #19 is not yet included in the schema.

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

No branches or pull requests

1 participant