Fuzzball Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

MPI Hello, World

The Fuzzfiles below are a slight modification of this “Hello world” example. The workflows use these containers that are available in two MPI flavors; MPICH and OpenMPI. This simple workflow demonstrates jobs running on multiple nodes in Fuzzball.

Please select either the MPICH or OpenMPI tab to see the appropriate Fuzzfile for each flavor of MPI.
version: v1
jobs:
  mpi-hello-world:
    env:
      - PATH=/usr/lib64/mpich/bin:/usr/local/bin:/usr/bin:/bin
    image:
      uri: oras://docker.io/anderbubble/mpich-hello-world.sif
    command:
      - /bin/sh
      - '-c'
      - mpi_hello_world
    resource:
      cpu:
        cores: 1
        affinity: NUMA
      memory:
        size: 1GB
    multinode:
      nodes: 2
      implementation: mpich
version: v1
jobs:
  mpi-hello-world:
    env:
      - PATH=/usr/lib64/openmpi/bin:/usr/local/bin:/usr/bin:/bin
    image:
      uri: oras://docker.io/anderbubble/openmpi-hello-world.sif
    command:
      - /bin/sh
      - '-c'
      - mpi_hello_world
    resource:
      cpu:
        cores: 1
        affinity: NUMA
      memory:
        size: 1GB
    multinode:
      nodes: 2
      implementation: openmpi

This workflow can be run through the GUI or the CLI.

Please select either the GUI or CLI tab to see the appropriate instructions for your environment.

If you click “Workflow Editor” and “Create New”, you will see a blank page in the workflow editor.

Fuzzball create new workflow section

Now you can either click the ellipses (...) menu in the lower right and select “Edit YAML” or simply press e on your keyboard. An editor with a Fuzzfile stub will appear.

Fuzzball editor newly opened

You can delete the current contents and copy and paste one of the workflow definitions of from above. The screenshot below shows the MPICH version pasted into the workflow editor.

Fuzzball editor copied and pasted MPICH hello world workflow

Now pressing “save” will return you to the interactive workflow editor. You will now see the mpi-hello-world job instead of a blank editor page. The Fuzzball GUI will automatically validate the yaml file for syntax errors.

Fuzzball workflow editor with MPI hello world

Submitting your workflow to Fuzzball with the GUI is easy. Simply press the triangular “Start Workflow” button in the lower right corner of the workflow editor. You will be prompted to provide an optional descriptive name for your workflow.

Fuzzball name workflow and submit screen

Now you can click on “Start Workflow” in the lower right corner of the dialog box and your workflow will be submitted. If you click “Go to Status” you can view the workflow status page. The screenshot below shows the status page for a hello world workflow submission.

Fuzzball workflow status page

To retrieve logs produced by this workflow, select the mpi-hello-world job within the workflow, and click the “Logs” option on the right.

Fuzzball workflow dashboard showing logs from the hello world job

To run this workflow through the CLI you will need access to the Fuzzball CLI. You can install it using the Fuzzball CLI installation instructions.

First, you can create a Fuzzfile mpi-hello-world.fz the contents above one of the using the text editor of your choice.

You can start start this workflow using the CLI by running the following command:

$ fuzzball workflow start mpi-hello-world.fz
Workflow "6560d335-02dc-4f38-93f3-21ffd9349fc5" started.

You can monitor the workflow’s status by running the following command:

$ fuzzball workflow describe <workflow UUID>
Name:      mpi-hello-world.fz
Email:     bphan@ciq.co
UserId:    e554e134-bd2d-455b-896e-bc24d8d9f81e
Status:    STAGE_STATUS_STARTED
Created:   2024-08-23 10:27:11AM
Started:   2024-08-23 10:27:12AM
Finished:  N/A
Error:


Stages:
KIND     | STATUS   | NAME                                          | STARTED               | FINISHED
Workflow | Started  | 6560d335-02dc-4f38-93f3-21ffd9349fc5          | 2024-08-23 10:27:11AM | N/A
Image    | Finished | oras://docker.io/anderbubble/mpich-hello-w... | 2024-08-23 10:27:12AM | 2024-08-23 10:27:28AM
Job      | Pending  | mpi-hello-world                               | N/A                   | N/A

You can view outputs logged by the workflow, by executing the following command:

$ fuzzball workflow log 6560d335-02dc-4f38-93f3-21ffd9349fc5 mpi-hello-world
Hello world! Processor mpi-hello-world-1, Rank 0 of 2, CPU 0, NUMA node 0, Namespace mnt:[4026532667]
Hello world! Processor mpi-hello-world-0, Rank 1 of 2, CPU 0, NUMA node 0, Namespace mnt:[4026532656]