Submitting Tasks
Tasks are preconfigured workflows that query or analyze cosmological simulation data. Each task defines an input schema, and each submission creates a run that can be monitored until it succeeds, fails, or is cancelled. For details about available task inputs, see the available queries.
Web Interface
Sign in to the OpenCosmo Compute Portal and select a task from the sidebar. Each task page shows the task description, a list of recent runs for that task, and a New Submission button.
To submit a task from the web interface:
- Open the task page from the sidebar.
- Click
New Submissionto open the submission dialog. - Fill in the required input parameters.
- Submit the form.
- If the task requires additional authorization, the portal prompts you to grant consent after you submit. Complete the authorization flow; you are returned to the form with your inputs preserved and can submit again.
- Monitor the run detail page that opens after a successful submission.
The run detail page shows the current status, execution stages, input parameters, and any error message, and refreshes automatically while a run is active. Successful runs can include preview files, downloadable result files, and visualization actions for supported output formats, and runs executed through Globus link to the external Globus run details. Active runs can be cancelled, and any run can be recreated or archived.
Command Line
Install the ocp command from the supporting libraries guide before using the command line. Configure a profile with the same root URL that you use in the browser:
ocp config add-profile opencosmo <portal-url>
ocp config set-profile opencosmo
ocp auth login
ocp auth login uses a device-code flow by default, which works in terminals and SSH sessions. If a task needs additional delegated authorization, login or submission may prompt you to grant consent. You can also check and grant missing task authorization explicitly:
ocp auth consent
List the tasks available to your account and inspect a task schema before submitting:
ocp task list
ocp task info <task-slug>
Submit interactively, with inline JSON, or with a JSON input file:
ocp task run <task-slug>
ocp task run <task-slug> --input '{"parameter": "value"}'
ocp task run <task-slug> --file input.json
ocp task run <task-slug> --file input.json --dry-run
After submission, ocp prints a run ID. Use that ID to monitor progress, inspect logs, retrieve results, cancel active work, or archive completed runs:
ocp run status <run-id> --watch
ocp run results <run-id>
ocp run logs <run-id>
ocp run cancel <run-id>
ocp run archive <run-id>
Useful global options include --profile opencosmo to use a specific profile for one command and --format json for machine-readable output:
ocp --profile opencosmo --format json task list
Downloaded HDF5 result files can be opened with the OpenCosmo Python Toolkit. See reading returned data for examples.
MCP
The local MCP server uses the same installed ocp command and requires an authenticated profile: run ocp auth login before starting it. Start the server with:
ocp mcp start
For MCP clients that launch stdio servers from a JSON configuration, use the authenticated profile:
{
"mcpServers": {
"opencosmo": {
"command": "ocp",
"args": ["--profile", "opencosmo", "mcp", "start"]
}
}
}
An MCP-enabled assistant can discover tasks and runs as tools, inspect task schemas, submit task input, and check run status. Review task inputs before submission, especially when a task may consume facility compute time or request additional authorization.
Troubleshooting
- If
ocp auth logincannot reach the API, confirm that<portal-url>is the portal root URL and that the portal is reachable from your network. - If a command reports that you are not authenticated, run
ocp auth loginfor the active profile. - If submission requires consent, follow the prompt or run
ocp auth consent. - If no tasks are listed, your account may not have access to any enabled tasks. Contact the portal administrators if you expected access.
- If results are unavailable, wait for the run to succeed and check
ocp run status <run-id>or the web run detail page for failures.