Homework: preparation for the 1st Parallel Computing hands-on session

Preparation

New VSC regulations require students to request an account individually. Do this as soon as possible; registration may take some time to propopagate within the VSC infrastructure! Please follow all steps found at their registration page: here. Note that they require you to generate a public/private key pair. Don't forget to bring your key pair with you if you want to log on to the supercomputer! So bring your key pair on a thumb drive to the programming sessions if you plan to use the university machines, and keep in mind the private key should remain private to you only.

If you use Windows: logging on (and generating key pairs) requires software such as Putty, and sending/receiving files to/from the supercomputer requires a tool like WinSCP. (Linux and Mac users: simply open up a terminal and you're ready to go!)

Exercise 1

When your account is created, you can log on the supercomputer by opening a terminal and writing ssh <your login name>@login.hpc.kuleuven.be. If asked, accept the remote fingerprint (f7:b7:12:1d:c4:e6:e7:32:72:c5:36:59:08:96:c4:6c), and use your personally generated key pair to log on. If all went well, you are now greeted by the head node of the VSC supercomputer!

We will first compile and run a Hello World example program. Follow the below steps:

  1. Create a clean directory for this course, e.g., mkdir parco (suggested) and change your working directory to there (cd parco).
  2. Get the MulticoreBSP for C library: wget http://www.multicorebsp.com/downloads/c/latest/MulticoreBSP-for-C.tar.gz.
  3. Let VIC-3 know you would like to use the GNU compiler collection module load GCC/4.8.2 (try module avail to see what other packages VIC-3 has available for you).
  4. Untar the MulticoreBSP for C package: tar xvfz MulticoreBSP-for-C.tar.gz
  5. Compile the library: cd MulticoreBSP-for-C; make
  6. Get the Hello World example: wget http://people.cs.kuleuven.be/~albert-jan.yzelman/education/parco14/home1/hello.c
  7. Compile the Hello World example:
    gcc -Iinclude/ -pthread -c -o hello.o hello.c
    gcc -o hello hello.o lib/libmcbsp1.2.0.a -lpthread -lrt
  8. Run the example: ./hello.

If all is well, you just ran your first parallel application on VIC-3. Note, however, that you executed the program on the login node; this node we share with a lot of other supercomputer users (like your classmates). You can try the command who to see exactly with whom we are sharing the machine we are currently logged on to. If we run proper parallel codes, however, we

  1. do not want to be disrupted by other users, and
  2. want to use more than a single node.
To get what we want, we have to use the batch system.

Exercise 2

Read the documentation on VIC-3's batch system, and submit the Hello-world job to run on a single node of VIC-3. Remember MulticoreBSP is shared-memory only, so using more than one node is not useful. Also note VIC-3 has various types of nodes, and that you can use the batch system to choose which node you want to run on.

  • Use the batch system to run the hello world program on a single supercomputer node. Each job submitted costs credits. Upon registration you receive free credits. If you run out of them, you can use the lp_alg_parallel_comp project account to run your jobs.

Note that for short jobs, you can use the debugging queue (-lqos=debugging). Also, your job will be more quickly executed by adding a short maximum running time (-lwalltime=1:00). Also consider allowing your job to be executed on a shared node; but while OK for a job like ./hello, think about what happens if you instead run a time-sensitive program like a benchmarking application...