supercomputing_mini_workshop_february_27_2013.md 5.72 KB
Newer Older
1
2
3
4
+++
title = "Supercomputing Mini Workshop 2013"
description = "Supercomputing Mini Workshop 2013."
+++
5
6
7
8

Supercomputing Mini Workshop - February 27, 2013
================================================

9
10
11
12
{{% notice info %}}The materials found on this page were applicable at the time of the event. When referencing these, 
please check current documentation to ensure the resources are still available.A list of currently available resources can be found on the
 [Submitting Jobs page](https://hcc.unl.edu/docs/#resource-capabilities){{% /notice %}}

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
In this hour-long mini workshop, you will obtain hands-on experience
performing a simple calculation (summing from 1 to 16) with a
supercomputer, using both serial and parallel computing. No prior
knowledge of programing is required. The only thing you need to do is
follow the cheat sheets step by step (copy & paste)! We aim to give the
framework of the standard supercomputing process and demonstrate that it
does not require huge efforts for one to take advantage of
state-of-the-art supercomputing resources. 

**Logging In**

``` syntaxhighlighter-pre
ssh tusker.unl.edu -l demoXXXX
```

28
**[Cypwin Link](http://cygwin.com/install.html)**
29
30
31
32

Preparation
-----------

33
**[Download](https://unl.box.com/s/kopsfrp6ibnfds65it0g2oe3zmp3jxtx) the demo code.**
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

Copy the two folders to the clipboard 

1.  <span
    style="font-size: 10.0pt;line-height: 13.0pt;">/getting\_started/hcc\_tusker/serial\_f90</span>
2.  /getting\_started/hcc\_tusker/parallel\_f90

On your local computer:

``` syntaxhighlighter-pre
$ cd ~
$ mkdir demo_code
```

Next, search in your computer for the folder “demo\_code”, and paste the
two folders, serial\_f90 and parallel\_f90, in this folder

``` syntaxhighlighter-pre
$ ls
$ scp -r ./demo_code <username>@tusker.unl.edu:/work/demo/<username>
<enter password>
```

Serial Job
----------

First, you need to login to the cluster

``` syntaxhighlighter-pre
$ ssh <username>@tusker.unl.edu
<enter password>
```

67
Next, you will move to the working filesystem:
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

``` syntaxhighlighter-pre
$ cd /work/demo/<username>
$ ls
$ cd demo_code
$ ls
$ cd serial_f90
$ ls
```

Now, load the compiler configuration:

``` syntaxhighlighter-pre
$ module load compiler/intel/12
```

And compile the fortran code:

``` syntaxhighlighter-pre
$ ifort fortran_serial.f90 -o fortran_serial.x
```

 Next, you will submit the job to the cluster scheduler using a file
`submit_tusker.serial`.  After submitting the job, the cluster will
schedule your job to run on a node in the cluster.

``` syntaxhighlighter-pre
$ qsub submit_tusker.serial
```

98
You can watch the status
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
of the job using showq

``` syntaxhighlighter-pre
$ showq -u username
```

After the job has completed, it will disappear from the showq command.
 You can check the output of the program from demo.out:

``` syntaxhighlighter-pre
$ cat demo.out
```

Parallel Job 
-------------

Again, logged into the cluster as in the Serial job, change to the
116
working directory:
117
118
119
120
121
122

``` syntaxhighlighter-pre
$ cd /work/demo/<username>/demo_code/parallel_f90
$ ls
```

123
Then load both the compiler and the MPI (Message Passing Interface) for parallel applications.
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167

``` syntaxhighlighter-pre
$ module load compiler/intel/12
$ module load openmpi/1.6
```

Next, you will compile the special parallelized version of the summation
code.  It uses MPI for communication between the parallel processes.

``` syntaxhighlighter-pre
$ mpif90 fortran_mpi.f90 -o fortran_mpi.x
```

Next, we will submit the MPI application to the Tusker cluster scheduler
using the file `submit_tusker.mpi`.

``` syntaxhighlighter-pre
$ qsub submit_tusker.mpi
```

The Tusker cluster scheduler will pick machines (possibly several,
depending on availability) to run the parallel MPI application.  You can
check the status of the job the same way you did with the Serial job:

``` syntaxhighlighter-pre
$ showq -u <username>
```

Once you see the job has disappeared from the output of `showq`, you can
look at the output using the command:

``` syntaxhighlighter-pre
$ cat demo.out
```

Useful Commands
---------------

| Command                     | Description                                                                                                                                                                                                 |
|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| $ pwd                       | Print Working Directory - Show the directory that you are currently working in.                                                                                                                             |
| $ cd &lt;directory&gt;      | Change Directory - Change the working directory to another.                                                                                                                                                 |
| $ cd ..                     | Change Directory to the one above the current.                                                                                                                                                              |
| $ cat &lt;filename&gt;      | Print the contents of a file                                                                                                                                                                                |
168
| $ showq -u &lt;username&gt; | Show the status of jobs for user &lt;username&gt;.  |
169
170
171
| $ qdel &lt;jobid&gt;        | Remove the job &lt;jobid&gt; from the queue. Stop job if it is running.                                                                                                                                     |