搜档网
当前位置:搜档网 › COMP5426_Parallel Program_2013 Semester 1_Tutorial 1

COMP5426_Parallel Program_2013 Semester 1_Tutorial 1

COMP5426_Parallel Program_2013 Semester 1_Tutorial 1
COMP5426_Parallel Program_2013 Semester 1_Tutorial 1

Tutorial 1

This tutorial forms the first part of the exercise to be completed in the first tutorial (week 2)

These tutorials should really be attempted in the labs - however to work from home: ?Download putty (or use telnet instead)

?use putty to connect to https://www.sodocs.net/doc/7315006804.html,.au (or https://www.sodocs.net/doc/7315006804.html,.au, or https://www.sodocs.net/doc/7315006804.html,.au)

?log in using your SIT username and password

In order to log in you'll need an account set up - please contact the tutor if you do not have one set up

The first tutorial is meant to be a rather simple exercise in ensuring that you can compile and run a rather basic mpi program.

The following steps will assist you in compiling and running the code

-1. Learn a little bit about UNIX commands.

0. log into a Unix workstation “https://www.sodocs.net/doc/7315006804.html,.au” (or “https://www.sodocs.net/doc/7315006804.html,.au”) using ssh. After you have logged into the workstation , download the following setup files into your home directory:

An mpi setup file, .mpirc; a simple bash setup file, .bashrc and a sample bash profile file, .bash_profile

* Please note that these files are really meant for students who are new to UNIX systems and have no previous configuration files.

1. Make a directory for this course and this tutorial

## mkdir -p comp5426/tutorial1

2. Save / copy the tutorial source code to this directory

## cd comp5426/tutorial1

3. Compile and run the example

## mpicc -o tutorial1 tutorial1.c

## mpirun -np 5 tutorial1

Exercises

1. Find good on-line references for unix commands, such as, mkdir, cp , mv , mpicc (if you are not familiar with unix commands)

2. Find good on-line references for the C programming language (if you are not familiar with

C)

3. Visit the MPI reference websites, specified on the course home page, for the details of MPI

4. Try to understand the code given

5. Modify tutorial1.c for it to print out the hostname of each of the machines, instead of process ranks.

相关主题