{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Validation Schema for Simexpal", "description": "Schema for an experiments.yml used by simexpal", "definitions": { "str_list": { "type": "array", "items": {"type": "string"} }, "str_or_str_list": { "oneOf": [ { "type": "string"}, { "$ref": "#/definitions/str_list"} ] }, "dict_list": { "type": "array", "items": { "type": "object" } }, "int_list": { "type": "array", "items": { "type": "integer" } }, "build_arguments": { "type": "array", "items": { "type": "object", "properties": { "args": {"$ref": "#/definitions/str_or_str_list"}, "environ": {"type": "object"}, "workdir": {"type": "string"} }, "additionalProperties": false } }, "slurm_settings": { "type": "object", "properties": { "num_nodes": { "type": ["integer", "string"], "minimum": 1 }, "procs_per_node": { "type": ["integer", "string"], "minimum": 1 }, "num_threads": { "type": ["integer", "string"], "minimum": 1 }, "slurm_args": {"$ref": "#/definitions/str_or_str_list"}, "exclusive": { "type": "boolean" } } } }, "type": "object", "dependencies": { "builds": ["revisions"] }, "properties": { "builds": { "description": "list of builds", "type": "array", "items": { "type": "object", "required": ["name"], "properties": { "name": {"type": "string"}, "git": {"type": "string"}, "recursive-clone": {"type": "boolean"}, "requires": {"$ref": "#/definitions/str_or_str_list"}, "regenerate": {"$ref": "#/definitions/build_arguments"}, "configure": {"$ref": "#/definitions/build_arguments"}, "compile": {"$ref": "#/definitions/build_arguments"}, "install": {"$ref": "#/definitions/build_arguments"}, "exports_python": {"type": "string"}, "extra_paths": {"$ref": "#/definitions/str_or_str_list"} }, "additionalProperties": false } }, "revisions": { "description": "list of revisions", "type": "array", "items": { "type": "object", "required": ["build_version"], "properties": { "name": {"type": "string"}, "build_version": {"type": "object"}, "develop": {"type": "boolean"} }, "additionalProperties": false } }, "instdir": { "description": "path to the directory containing the experiment instances", "type": "string" }, "instances": { "description": "list of instances", "type": "array", "items": { "type": "object", "properties": { "method": { "type": "string", "enum": ["url", "git"] } }, "allOf": [ { "if": { "required": ["generator"], "properties": { "generator": {} } }, "then": { "required": ["generator", "items"], "properties": { "generator": { "type": "object", "required": ["args"], "properties": { "args": {"$ref": "#/definitions/str_list"} }, "additionalProperties": false }, "extra_args": {"$ref": "#/definitions/str_list"}, "set": {"$ref": "#/definitions/str_or_str_list"}, "items": { "oneOf": [ { "$ref": "#/definitions/str_list" }, { "type": "array", "items": { "type": "object", "required": ["name"], "properties": { "name": {"type": "string"}, "extra_args": {"$ref": "#/definitions/str_list"} }, "additionalProperties": false } } ] } }, "additionalProperties": false } }, { "if": { "required": ["extensions"], "properties": { "extensions": {} } }, "then": { "required": ["repo", "extensions", "items"], "properties": { "repo": {"const": "local"}, "extensions": {"$ref": "#/definitions/str_list"}, "extra_args": {"$ref": "#/definitions/str_list"}, "set": {"$ref": "#/definitions/str_or_str_list"}, "subdir": {"type": "string"}, "items": { "oneOf": [ { "$ref": "#/definitions/str_list" }, { "type": "array", "items": { "type": "object", "required": ["name"], "properties": { "name": {"type": "string"}, "extra_args": {"$ref": "#/definitions/str_list"} }, "additionalProperties": false } } ] } }, "additionalProperties": false } }, { "if": { "required": ["items"], "properties": { "items": { "type": "array", "items": { "type": "object", "required": ["files"], "properties": { "files": {} } } } } }, "then": { "required": ["repo", "items"], "properties": { "repo": {"const": "local"}, "extra_args": {"$ref": "#/definitions/str_list"}, "set": {"$ref": "#/definitions/str_or_str_list"}, "subdir": {"type": "string"}, "items": { "type": "array", "items": { "type": "object", "required": ["name", "files"], "properties": { "name": {"type": "string"}, "files": {"$ref": "#/definitions/str_list"}, "extra_args": {"$ref": "#/definitions/str_list"} }, "additionalProperties": false } } }, "additionalProperties": false } }, { "if": { "required": ["method"], "properties": { "method": {} } }, "then": { "allOf": [ { "if": { "required": ["method"], "properties": { "method": {"const": "url"} } }, "then": { "required": ["method", "url", "items"], "properties": { "method": {"const": "url"}, "url": {"type": "string"}, "extra_args": {"$ref": "#/definitions/str_list"}, "set": {"$ref": "#/definitions/str_or_str_list"}, "postprocess": {"const": "to_edgelist"}, "items": { "oneOf": [ { "$ref": "#/definitions/str_list" }, { "type": "array", "items": { "type": "object", "required": ["name"], "properties": { "name": {"type": "string"}, "extra_args": {"$ref": "#/definitions/str_list"} }, "additionalProperties": false } } ] } }, "additionalProperties": false } }, { "if": { "required": ["method"], "properties": { "method": {"const": "git"} } }, "then": { "required": ["method", "git", "repo_name", "commit", "items"], "properties": { "method": {"const": "git"}, "git": {"type": "string"}, "repo_name": {"type": "string"}, "commit": {"type": "string"}, "git_subdir": {"type": "string"}, "set": {"$ref": "#/definitions/str_or_str_list"}, "postprocess": {"const": "to_edgelist"}, "items": { "oneOf": [ { "$ref": "#/definitions/str_list" }, { "type": "array", "items": { "type": "object", "required": ["name"], "properties": { "name": {"type": "string"}, "extra_args": {"$ref": "#/definitions/str_list"} }, "additionalProperties": false } } ] } }, "additionalProperties": false } } ] } }, { "if": { "not": { "anyOf": [ { "required": ["generator"], "properties": { "generator": {} } }, { "required": ["extensions"], "properties": { "extensions": {} } }, { "required": ["items"], "properties": { "items": { "type": "array", "items": { "type": "object", "required": ["files"], "properties": { "files": {} } } } } }, { "required": ["method"], "properties": { "method": {} } } ] } }, "then": { "required": ["repo", "items"], "properties": { "repo": { "type": "string", "enum": ["local", "konect", "snap"] }, "repo-subdir": {"type": "string"}, "postprocess": {"const": "to_edgelist"}, "extra_args": {"$ref": "#/definitions/str_list"}, "set": {"$ref": "#/definitions/str_or_str_list"}, "subdir": {"type": "string"}, "items": { "oneOf": [ { "$ref": "#/definitions/str_list" }, { "type": "array", "items": { "type": "object", "required": ["name"], "properties": { "name": {"type": "string"}, "extra_args": {"$ref": "#/definitions/str_list"} }, "additionalProperties": false } } ] } }, "additionalProperties": false } } ] } }, "experiments": { "description": "list of experiments", "type": "array", "items": { "type": "object", "allOf": [ { "$ref": "#/definitions/slurm_settings" }, { "required": ["name", "args"], "properties": { "name": {"type": "string"}, "args": {"$ref": "#/definitions/str_list"}, "use_builds": {"$ref": "#/definitions/str_list"}, "output": { "oneOf": [ {"type": "string"}, { "type": "object", "properties": { "extensions": {"$ref": "#/definitions/str_list"} }, "additionalProperties": false } ] }, "timeout": { "type": "integer", "minimum": 0 }, "environ": {"type": "object"}, "repeat": { "type": "integer", "minimum": 0 }, "workdir": {"type": "string"}, "launcher": {"type": "string"}, "stdout": {"type": "string"}, "num_nodes": {}, "procs_per_node": {}, "num_threads": {}, "exclusive": {}, "slurm_args": {} }, "additionalProperties": false } ] } }, "variants": { "description": "list of variants", "type": "array", "items": { "type": "object", "allOf": [ { "if": { "required": ["range", "steps"], "properties": { "range": {}, "steps": {} } }, "then": { "allOf": [ { "$ref": "#/definitions/slurm_settings" }, { "required": ["axis", "range", "steps"], "properties": { "axis": {"type": "string"}, "extra_args": {"$ref": "#/definitions/str_list"}, "range": {"$ref": "#/definitions/int_list"}, "steps": {"type": "integer"}, "environ": {"type": "object"}, "launcher": {"type": "string"}, "num_nodes": {}, "procs_per_node": {}, "num_threads": {}, "slurm_args": {} }, "additionalProperties": false } ] } }, { "if": { "required": ["enum"], "properties": { "enum": {} } }, "then": { "allOf": [ { "$ref": "#/definitions/slurm_settings" }, { "required": ["axis", "enum"], "properties": { "axis": {"type": "string"}, "enum": {"type": "array"}, "extra_args": {"$ref": "#/definitions/str_list"}, "environ": {"type": "object"}, "launcher": {"type": "string"}, "num_nodes": {}, "procs_per_node": {}, "num_threads": {}, "slurm_args": {} }, "additionalProperties": false } ] } }, { "if": { "not": { "anyOf": [ { "required": ["range", "steps"], "properties": { "range": {}, "steps:": {} } }, { "required": ["enum"], "properties": { "enum": {} } } ] } }, "then": { "allOf": [ { "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/slurm_settings" } } } }, { "required": ["axis", "items"], "properties": { "axis": {"type": "string"}, "items": { "type": "array", "items": { "type": "object", "required": ["name"], "properties": { "name": {"type": "string"}, "extra_args": {"$ref": "#/definitions/str_list"}, "environ": {"type": "object"}, "launcher": {"type": "string"}, "num_nodes": {}, "procs_per_node": {}, "num_threads": {}, "slurm_args": {} }, "additionalProperties": false } } }, "additionalProperties": false } ] } } ] } }, "matrix": { "description": "run matrix", "type": "object", "properties": { "include": { "type": "array", "items": { "type": "object", "properties": { "experiments": {"$ref": "#/definitions/str_list"}, "revisions": {"$ref": "#/definitions/str_list"}, "axes": {"$ref": "#/definitions/str_list"}, "variants": {"$ref": "#/definitions/str_list"}, "instsets": {"$ref": "#/definitions/str_list"}, "repetitions": { "type": "integer", "minimum": 0 } }, "additionalProperties": false } } }, "additionalProperties": false } }, "additionalProperties": false }