sigs.k8s.io/kueue@v0.6.2/site/content/en/docs/tasks/run_kubeflow_jobs/run_mpijobs.md (about) 1 --- 2 title: "Run a MPIJob" 3 date: 2023-05-16 4 weight: 6 5 description: > 6 Run a Kueue scheduled MPIJob 7 --- 8 9 This page shows how to leverage Kueue's scheduling and resource management capabilities when running [MPI Operator](https://www.kubeflow.org/docs/components/training/mpi/) MPIJobs. 10 11 This guide is for [batch users](/docs/tasks#batch-user) that have a basic understanding of Kueue. For more information, see [Kueue's overview](/docs/overview). 12 13 ## Before you begin 14 15 Check [administer cluster quotas](/docs/tasks/administer_cluster_quotas) for details on the initial cluster setup. 16 17 Check [the MPI Operator installation guide](https://github.com/kubeflow/mpi-operator#installation). 18 19 You can [modify kueue configurations from installed releases](/docs/installation#install-a-custom-configured-released-version) to include MPIJobs as an allowed workload. 20 21 ## MPI Operator definition 22 23 ### a. Queue selection 24 25 The target [local queue](/docs/concepts/local_queue) should be specified in the `metadata.labels` section of the MPIJob configuration. 26 27 ```yaml 28 metadata: 29 labels: 30 kueue.x-k8s.io/queue-name: user-queue 31 ``` 32 33 ### b. Optionally set Suspend field in MPIJobs 34 35 ```yaml 36 spec: 37 runPolicy: 38 suspend: true 39 ``` 40 41 By default, Kueue will set `suspend` to true via webhook and unsuspend it when the MPIJob is admitted. 42 43 ## Sample MPI Job 44 45 This example is based on https://github.com/kubeflow/mpi-operator/blob/ccf2756f749336d652fa6b10a732e241a40c7aa6/examples/v2beta1/pi/pi.yaml. 46 47 {{< include "examples/jobs/sample-mpijob.yaml" "yaml" >}} 48 49 For equivalent instructions for doing this in Python, see [Run Python Jobs](/docs/tasks/run_python_jobs/#mpi-operator-job).