Faculty banner

CITS3402 High Performance Computing
Laboratory Sheet 5

CITS3402 High Performance Computing

How to run MPI code on the cluster

  • The head node is : ecm-ubl-006.uniwa.uwa.edu.au
  • There are home directories set up for you at the head node. There is no storage in the other nodes. It is possible to synchronize your files in the other nodes, that I will explain later.
  • The other nodes are : node-1 to node-29
  • First ssh to the head node.

    Then create a host file host and write the names of the nodes in this file, one node in each line. For example:
    will create a cluster consisting of two nodes. You can add up to node-29

    Now write some MPI code. For example, here is a simple MPI code that computes Fibonacci numbers. There is no parallelism here, just each MPI process independently computes the task. You can experiment with different Fibonacci numbers, the code as it is computes fib(42).

    Compile the code by mpicc myMPI.c this will create an executable file a.out, or you can use some other name for your executable by mpicc -o myMPI myMPI.c for example.

    You have to now set up your executable in each node of the cluster. Run syncCluster. It may ask your response when you run it first, say 'yes' to everything. It will synchronize seamlessly later.

    Run your code at the head node mpirun --hostfile host myMPI. The code will run on the cluster you have created in the hostfile called host.

    If you just execute mpirun myMPI, it will run your job only at the head node. You can experiment with different host file configurations. Since each node has 12 cores, MPI creates those many processes on each node.

    How to run your code using the queue

    Amitava Datta
    September 2018

    Visit the UWA Computer Science home page School of Computer Science & Software Engineering
    The University of Western Australia
    Crawley, Western Australia, 6009.
    Phone: +61 8 9380 2716 - Fax: +61 8 9380 1089.
    CRICOS provider code 00126G
    Valid HTML 4.01!