Commit d64366a5 authored by Adam Caprez's avatar Adam Caprez
Browse files

Update quickstarts

parent 1f6e2722
+++
title = "HCC Documentation"
description = "HCC Documentation Home"
weight = "1"
+++
HCC Documentation
============================
......@@ -13,7 +19,7 @@ existing resource, acquiring 'priority access'. Finally, several
machines are available via Condor for opportunistic use. This will allow
users almost immediate access, but the job is subject to preemption.
#### <a href="http://hcc.unl.edu/new-user-request" class="external-link">New Users Sign Up</a>
#### [New Users Sign Up](http://hcc.unl.edu/new-user-request)
#### [Quick Start Guides](/quickstarts)
......@@ -31,12 +37,6 @@ campus users. It has 4 CPU/ 64 cores and 256GB RAM per nodes. Two nodes
have 512GB RAM for very large memory jobs. So for jobs requiring more
than 16 cores per node or large memory, Tusker would be a better option.
**Sandhills**: Sandhills is a condominium-style cluster, and the
majority is owned by various research groups on campus. Jobs from
resource owners have first priority in their owned partitions. Users
that do not own resources (Guests) can do opportunistic computation, but
we would recommend using Crane or Tusker.
User Login
----------
......@@ -79,27 +79,19 @@ $ cd $WORK
Resources
---------
- <span style="color: rgb(0,0,0);">Crane</span> - HCC's newest
machine, Crane has 7232 Intel Xeon cores in 452 nodes with 64GB RAM
per node.
- ##### Crane - HCC's newest machine, Crane has 7232 Intel Xeon cores in 452 nodes with 64GB RAM per node.
- Tusker - consists of 106 AMD Interlagos-based nodes (6784 cores)
interconnected with Mellanox QDR Infiniband.
- ##### Tusker - consists of 106 AMD Interlagos-based nodes (6784 cores) interconnected with Mellanox QDR Infiniband.
- Sandhills - has 1440 AMD cores housed in 42 nodes with 128GB per
node and 2 nodes with 256GB per node.
- ##### [Red](http://hcc.unl.edu/red/index.php) - This cluster is the resource for UNL's US CMS Tier-2 site.
- <a href="http://hcc.unl.edu/red/index.php" class="external-link">Red </a>-
This cluster is the resource for UNL's US CMS Tier-2 site.
- [CMS](http://www.uscms.org/)
- [Open Science Grid](http://www.opensciencegrid.org)
- [MyOSG](https://myosg.grid.iu.edu/)
- <a href="http://www.uscms.org/" class="external-link">CMS</a>
- <a href="http://www.opensciencegrid.org/" class="external-link">Open Science Grid</a>
- <a href="https://myosg.grid.iu.edu/" class="external-link">MyOSG</a>
- ##### Anvil - HCC's cloud computing cluster based on Openstack
- [Glidein](The-Open-Science-Grid_11635314.html) - A gateway to
running jobs on the OSG, a collection of computing resources across
the US.
- Anvil - HCC's cloud computing cluster based on Openstack
- ##### [Glidein](The-Open-Science-Grid_11635314.html) - A gateway to running jobs on the OSG, a collection of computing resources across the US.
Resource Capabilities
---------------------
......
1. [HCC-DOCS](index.html)
2. [HCC-DOCS Home](HCC-DOCS-Home_327685.html)
3. [HCC Documentation](HCC-Documentation_332651.html)
4. [Quick Start Guides](Quick-Start-Guides_1245279.html)
+++
title = "Basic Linux commands"
description = "Simple commands you'll want to know"
weight = "32"
+++
<span id="title-text"> HCC-DOCS : Bash Commands </span>
=======================================================
Basic commands
--------------
Created by <span class="author"> Carrie Brown</span>, last modified on
Oct 26, 2017
[Video Tutorial](#BashCommands-video)
###### [[Jump to the Video Tutorial]](#tutorial-video)
Holland clusters all run on the Linux operating system, similarly to how
your personal computer might run Windows or Mac OS. However, unlike
......@@ -26,12 +24,12 @@ versatility and performance.**
Below, we have compiled a list of common commands and usage examples.
For a more information, check out one of these references:
- <a href="https://eharstad.github.io/shell-novice/" class="external-link">Software Carpentry's &quot;Introduction to the Bash Shell&quot; Lesson</a> -
a great walkthrough of the basics of Bash designed for novice users
- <a href="http://www.comptechdoc.org/os/linux/usersguide/" class="external-link">Linux Users Guide</a> -
detailed information about the Linux command line and how to utilize
it
- <a href="https://www.cheatography.com/davechild/cheat-sheets/linux-command-line/" class="external-link">Linux Command Line Cheat Sheet</a> -
- [Software Carpentrys "Introduction to the Bash Shell" Lesson](https://eharstad.github.io/shell-novice) -
a great walkthrough of the basics of Bash designed for novice users
- [Linux Users Guide](http://www.comptechdoc.org/os/linux/usersguide) -
detailed information about the Linux command line and how to utilize
it
- [Linux Command Line Cheat Sheet](https://www.cheatography.com/davechild/cheat-sheets/linux-command-line) -
a quick reference for Linux commands. Offers a PDF version that you
can print out.
......@@ -210,8 +208,7 @@ cd $HOME (or $WORK)
</tbody>
</table>
<span id="BashCommands-video" class="confluence-anchor-link"></span>
Document generated by Confluence on Oct 24, 2018 14:47
Tutorial Video
--------------
[Atlassian](http://www.atlassian.com/)
{{< youtube B0VdKiHNjU4 >}}
+++
title = "For Mac/Linux Users"
description = "Quickstart Guide for Mac/Linux Users"
weight = "30"
weight = "22"
+++
##### Use of Duo two-factor authentication is **required** to access HCC resources.
......@@ -16,7 +16,7 @@ with the HCC supercomputers.
If you are running Windows, please use the quickstart [For Windows
Users]({{< relref "for_windows_users" >}}).
Accessing to HCC Supercomputers
Access to HCC Supercomputers
-------------------------------
For Mac/Linux users, use the system program Terminal to assess to the
......
+++
title = "Fortran/C on HCC"
description = "How to compile and run Fortran/C program on HCC machines"
weight = "50"
+++
This quick start demonstrates how to implement a Fortran/C program on
HCC supercomputers. The sample codes and submit scripts can be
downloaded from [serial_dir.zip](/attachments/serial_dir.zip).
#### Login to a HCC Cluster (Tusker or Crane) 
Log in to a HCC cluster through PuTTY ([For Windows Users]({{< relref "/quickstarts/for_windows_users">}})) or Terminal ([For Mac/Linux
Users]({{< relref "/quickstarts/for_maclinux_users">}})) and make a subdirectory called `serial_dir` under the `$WORK` directory. 
{{< highlight bash >}}
$ cd $WORK
$ mkdir serial_dir
{{< /highlight >}}
In the subdirectory `serial_dir`, save all the relevant Fortran/C codes. Here we include two demo
programs, `demo_f_serial.f90` and `demo_c_serial.c`, that compute the sum from 1 to 20. 
{{%expand "demo_f_serial.f90" %}}
{{< highlight bash >}}
Program demo_f_serial
implicit none
integer, parameter :: N = 20
real*8 w
integer i
common/sol/ x
real*8 x
real*8, dimension(N) :: y
do i = 1,N
w = i*1d0
call proc(w)
y(i) = x
write(6,*) 'i,x = ', i, y(i)
enddo
write(6,*) 'sum(y) =',sum(y)
Stop
End Program
Subroutine proc(w)
real*8, intent(in) :: w
common/sol/ x
real*8 x
x = w
Return
End Subroutine
{{< /highlight >}}
{{% /expand %}}
{{%expand "demo_c_serial.c" %}}
{{< highlight c >}}
//demo_c_serial
#include <stdio.h>
double proc(double w){
double x;
x = w;
return x;
}
int main(int argc, char* argv[]){
int N=20;
double w;
int i;
double x;
double y[N];
double sum;
for (i = 1; i <= N; i++){
w = i*1e0;
x = proc(w);
y[i-1] = x;
printf("i,x= %d %lf\n", i, y[i-1]) ;
}
sum = 0e0;
for (i = 1; i<= N; i++){
sum = sum + y[i-1];
}
printf("sum(y)= %lf\n", sum);  
 
return 0;
}
{{< /highlight >}}
{{% /expand %}}
---
#### Compiling the Code
The compiling of a Fortran/C++ code to executable is usually done behind
the scene in a Graphical User Interface (GUI) environment, such as
Microsoft Visual Studio. In a HCC cluster, the compiling is done
explicitly by first loading a choice compiler and then executing the
corresponding compiling command. Here we will use the GNU Complier
Collection, `gcc`, for demonstration. Other available compilers such as
`intel` or `pgi` can be looked up using the command
line `module avail`. Before compiling the code, make sure there is no
dependency on any numerical library in the code. If invoking a numerical
library is necessary, contact a HCC specialist
({{< icon name="envelope" >}}[hcc-support@unl.edu] (mailto:hcc-support@unl.edu)) to
discuss implementation options.
{{< highlight bash >}}
$ module load compiler/gcc/8.2
$ gfortran demo_f_serial.f90 -o demo_f_serial.x
$ gcc demo_c_serial.c -o demo_c_serial.x
{{< /highlight >}}
The above commends load the `gcc` complier and use the compiling
commands `gfortran` or `gcc` to compile the codes to`.x` files
(executables). 
#### Creating a Submit Script
Create a submit script to request one core (default) and 1-min run time
on the supercomputer. The name of the main program enters at the last
line.
{{% panel header="`submit_f.serial`"%}}
{{< highlight bash >}}
#!/bin/sh
#SBATCH --mem-per-cpu=1024
#SBATCH --time=00:01:00
#SBATCH --job-name=Fortran
#SBATCH --error=Fortran.%J.err
#SBATCH --output=Fortran.%J.out
module load compiler/gcc/4.9
./demo_f_serial.x
{{< /highlight >}}
{{% /panel %}}
{{% panel header="`submit_c.serial`"%}}
{{< highlight bash >}}
#!/bin/sh
#SBATCH --mem-per-cpu=1024
#SBATCH --time=00:01:00
#SBATCH --job-name=C
#SBATCH --error=C.%J.err
#SBATCH --output=C.%J.out
module load compiler/gcc/4.9
./demo_c_serial.x
{{< /highlight >}}
{{% /panel %}}
#### Submit the Job
The job can be submitted through the command `sbatch`. The job status
can be monitored by entering `squeue` with the `-u` option.
{{< highlight bash >}}
$ sbatch submit_f.serial
$ sbatch submit_c.serial
$ squeue -u <username>
{{< /highlight >}}
Replace `<username>` with your HCC username.
#### Sample Output
The sum from 1 to 20 is computed and printed to the `.out` file (see
below). 
{{%expand "Fortran.out" %}}
{{< highlight batchfile>}}
i,x = 1 1.0000000000000000
i,x = 2 2.0000000000000000
i,x = 3 3.0000000000000000
i,x = 4 4.0000000000000000
i,x = 5 5.0000000000000000
i,x = 6 6.0000000000000000
i,x = 7 7.0000000000000000
i,x = 8 8.0000000000000000
i,x = 9 9.0000000000000000
i,x = 10 10.000000000000000
i,x = 11 11.000000000000000
i,x = 12 12.000000000000000
i,x = 13 13.000000000000000
i,x = 14 14.000000000000000
i,x = 15 15.000000000000000
i,x = 16 16.000000000000000
i,x = 17 17.000000000000000
i,x = 18 18.000000000000000
i,x = 19 19.000000000000000
i,x = 20 20.000000000000000
sum(y) = 210.00000000000000
{{< /highlight >}}
{{% /expand %}}
{{%expand "C.out" %}}
{{< highlight batchfile>}}
i,x= 1 1.000000
i,x= 2 2.000000
i,x= 3 3.000000
i,x= 4 4.000000
i,x= 5 5.000000
i,x= 6 6.000000
i,x= 7 7.000000
i,x= 8 8.000000
i,x= 9 9.000000
i,x= 10 10.000000
i,x= 11 11.000000
i,x= 12 12.000000
i,x= 13 13.000000
i,x= 14 14.000000
i,x= 15 15.000000
i,x= 16 16.000000
i,x= 17 17.000000
i,x= 18 18.000000
i,x= 19 19.000000
i,x= 20 20.000000
sum(y)= 210.000000
{{< /highlight >}}
{{% /expand %}}
1. [HCC-DOCS](index.html)
2. [HCC-DOCS Home](HCC-DOCS-Home_327685.html)
3. [HCC Documentation](HCC-Documentation_332651.html)
4. [Quick Start Guides](Quick-Start-Guides_1245279.html)
<span id="title-text"> HCC-DOCS : Fortran/C on HCC </span>
==========================================================
Created by <span class="author"> Huang Cheng-Wei</span>, last modified
by <span class="editor"> Jingchao Zhang</span> on Dec 08, 2016
This quick start demonstrates how to implement a Fortran/C program on
HCC supercomputers. The sample codes and submit scripts can be
downloaded from
&lt;[serial\_dir.zip](attachments/2851390/3178548.zip)&gt;
Login to a HCC Cluster (Tusker or Sandhills) 
---------------------------------------------
Log in to a HCC cluster through PuTTY ([For Windows
Users](For-Windows-Users_2851288.html)) or Terminal ([For Mac/Linux
Users](2851290.html)) and make a subdirectory called serial\_dir under
the `$WORK` directory. 
``` syntaxhighlighter-pre
$ cd $WORK
$ mkdir serial_dir
```
In the subdirectory `serial_dir`, save all the relevant Fortran/C codes.
Here we include two demo
programs, `demo_f_serial.f90` and `demo_c_serial.c`, that compute the
sum from 1 to 20. 
**demo\_f\_serial.f90** <span class="collapse-source expand-control"
style="display:none;"><span
class="expand-control-icon icon"> </span><span
class="expand-control-text">Expand source</span></span> <span
class="collapse-spinner-wrapper"></span>
``` syntaxhighlighter-pre
Program demo_f_serial
implicit none
integer, parameter :: N = 20
real*8 w
integer i
common/sol/ x
real*8 x
real*8, dimension(N) :: y
do i = 1,N
w = i*1d0
call proc(w)
y(i) = x
write(6,*) 'i,x = ', i, y(i)
enddo
write(6,*) 'sum(y) =',sum(y)
Stop
End Program
Subroutine proc(w)
real*8, intent(in) :: w
common/sol/ x
real*8 x
x = w
Return
End Subroutine
```
**demo\_c\_serial.c** <span class="collapse-source expand-control"
style="display:none;"><span
class="expand-control-icon icon"> </span><span
class="expand-control-text">Expand source</span></span> <span
class="collapse-spinner-wrapper"></span>
``` syntaxhighlighter-pre
//demo_c_serial
#include <stdio.h>
double proc(double w){
double x;
x = w;
return x;
}
int main(int argc, char* argv[]){
int N=20;
double w;
int i;
double x;
double y[N];
double sum;
for (i = 1; i <= N; i++){
w = i*1e0;
x = proc(w);
y[i-1] = x;
printf("i,x= %d %lf\n", i, y[i-1]) ;
}
sum = 0e0;
for (i = 1; i<= N; i++){
sum = sum + y[i-1];
}
printf("sum(y)= %lf\n", sum);  
 
return 0;
}
```
Compiling the Code
------------------
The compiling of a Fortran/C++ code to executable is usually done behind
the scene in a Graphical User Interface (GUI) environment, such as
Microsoft Visual Studio. In a HCC cluster, the compiling is done
explicitly by first loading a choice compiler and then executing the
corresponding compiling command. Here we will use the GNU Complier
Collection, `gcc`, for demonstration. Other available compilers such as
`intel` or `pgi` can be looked up using the command
line `module avail`. <span
style="font-size: 14.0px;line-height: 1.4285715;">Before compiling the
code, make sure there is no dependency on any numerical library in the
code. If invoking a numerical library is necessary, contact a HCC
specialist
(<a href="mailto:hcc-support@unl.edu" class="external-link">hcc-support@unl.edu</a>) to
discuss implementation options. </span>
| |
|--------------------------------|
| $ module load compiler/gcc/8.2 |
$ gfortran demo\_f\_serial.f90 -o demo\_f\_serial.x
$ gcc demo\_c\_serial.c -o demo\_c\_serial.x
The above commends load the `gcc` complier and use the compiling
commands `gfortran` or `gcc` to compile the codes to`.x` files
(executables). 
Creating a Submit Script
------------------------
Create a submit script to request one core (default) and 1-min run time
on the supercomputer. The name of the main program enters at the last
line.
**submit\_f.serial**
``` syntaxhighlighter-pre
#!/bin/sh
#SBATCH --mem-per-cpu=1024
#SBATCH --time=00:01:00
#SBATCH --job-name=Fortran
#SBATCH --error=Fortran.%J.err
#SBATCH --output=Fortran.%J.out
module load compiler/gcc/4.9
./demo_f_serial.x
```
**submit\_c.serial**
``` syntaxhighlighter-pre
#!/bin/sh
#SBATCH --mem-per-cpu=1024
#SBATCH --time=00:01:00
#SBATCH --job-name=C
#SBATCH --error=C.%J.err
#SBATCH --output=C.%J.out
module load compiler/gcc/4.9
./demo_c_serial.x
```
Submit the Job
--------------
The job can be submitted through the command `sbatch`. The job status
can be monitored by entering `squeue` with the `-u` option.
``` syntaxhighlighter-pre
$ sbatch submit_f.serial
$ sbatch submit_c.serial
$ squeue -u <username>
```
Sample Output
-------------
The sum from 1 to 20 is computed and printed to the `.out` file (see
below). 
**Fortran.out** <span class="collapse-source expand-control"
style="display:none;"><span
class="expand-control-icon icon"> </span><span
class="expand-control-text">Expand source</span></span> <span
class="collapse-spinner-wrapper"></span>
``` syntaxhighlighter-pre
i,x = 1 1.0000000000000000
i,x = 2 2.0000000000000000
i,x = 3 3.0000000000000000
i,x = 4 4.0000000000000000
i,x = 5 5.0000000000000000
i,x = 6 6.0000000000000000
i,x = 7 7.0000000000000000
i,x = 8 8.0000000000000000
i,x = 9 9.0000000000000000
i,x = 10 10.000000000000000
i,x = 11 11.000000000000000
i,x = 12 12.000000000000000
i,x = 13 13.000000000000000
i,x = 14 14.000000000000000
i,x = 15 15.000000000000000
i,x = 16 16.000000000000000
i,x = 17 17.000000000000000
i,x = 18 18.000000000000000
i,x = 19 19.000000000000000
i,x = 20 20.000000000000000
sum(y) = 210.00000000000000
```
**C.out** <span class="collapse-source expand-control"
style="display:none;"><span
class="expand-control-icon icon"> </span><span
class="expand-control-text">Expand source</span></span> <span
class="collapse-spinner-wrapper"></span>
``` syntaxhighlighter-pre
i,x= 1 1.000000
i,x= 2 2.000000
i,x= 3 3.000000
i,x= 4 4.000000
i,x= 5 5.000000
i,x= 6 6.000000
i,x= 7 7.000000
i,x= 8 8.000000
i,x= 9 9.000000
i,x= 10 10.000000
i,x= 11 11.000000
i,x= 12 12.000000
i,x= 13 13.000000
i,x= 14 14.000000
i,x= 15 15.000000
i,x= 16 16.000000
i,x= 17 17.000000
i,x= 18 18.000000
i,x= 19 19.000000
i,x= 20 20.000000
sum(y)= 210.000000
```
 
 
Attachments:
------------
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[serial\_dir.zip](attachments/2851390/3178549.zip) (application/zip)
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[serial\_dir.zip](attachments/2851390/3178550.zip) (application/zip)
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[serial\_dir.zip](attachments/2851390/3178551.zip) (application/zip)
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[serial\_dir.zip](attachments/2851390/3178552.zip) (application/zip)
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[serial\_dir.zip](attachments/2851390/3178554.zip) (application/zip)
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[serial\_dir.zip](attachments/2851390/3178556.zip) (application/zip)
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[serial\_dir.zip](attachments/2851390/3178548.zip) (application/zip)