Skip to content
Snippets Groups Projects
Commit ca6c4e6f authored by Adam Caprez's avatar Adam Caprez
Browse files

Merge branch 'update-quickstarts' into 'master'

Update quickstarts

See merge request !11
parents 1b8f684f b628fe47
No related branches found
No related tags found
1 merge request!11Update quickstarts
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 = "Condor Jobs on HCC"
description = "How to run jobs using Condor on HCC machines"
weight = "54"
+++
<span id="title-text"> HCC-DOCS : Condor Jobs on HCC </span>
============================================================
Created by <span class="author"> Huang Cheng-Wei</span>, last modified
by <span class="editor"> Adam Caprez</span> on Sep 17, 2013
This quick start demonstrates how to run multiple copies of<span
style="font-size: 14.0px;line-height: 1.4285715;"> Fortran/C program
This quick start demonstrates how to run multiple copies of Fortran/C program
using Condor on HCC supercomputers. The sample codes and submit scripts
can be downloaded from
&lt;</span>[condor\_dir.zip](attachments/2851447/3178558.zip)<span
style="font-size: 14.0px;line-height: 1.4285715;">&gt;. </span>
can be downloaded from [condor_dir.zip](/attachments/3178558.zip).
Login to Sandhills
------------------
#### Login to a HCC Cluster
Log in to Sandhills through PuTTY ([For Windows
Users](For-Windows-Users_2851288.html)) or Terminal ([For Mac/Linux
Users](2851290.html)) and make a subdirectory called condor\_dir under
the `$WORK` directory. In the subdirectory `condor_dir`, create job
subdirectories that host the input data files. Here we create two job
subdirectories, `job_0` and `job_1`, and put a data file (`data.dat`) in
each subdirectory. The data file in `job_0` has a column of data listing
the integers from 1 to 5. The data file in `job_1` has a integer list
from 6 to 10.
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 `condor_dir` under the `$WORK` directory. In the subdirectory `condor_dir`, create job subdirectories that host the input data files. Here we create two job subdirectories, `job_0` and `job_1`, and put a data file (`data.dat`) in each subdirectory. The data file in `job_0` has a column of data listing the integers from 1 to 5. The data file in `job_1` has a integer list from 6 to 10.
``` syntaxhighlighter-pre
{{< highlight bash >}}
$ cd $WORK
$ mkdir condor_dir
$ cd condor_dir
$ mkdir job_0
$ mkdir job_1
```
{{< /highlight >}}
In the subdirectory condor`_dir`, save all the relevant codes. Here we
include two demo programs, `demo_f_condor.f90` and `demo_c_condor.c`,
......@@ -53,13 +36,8 @@ stored in the job subdirectory. No additional coding are needed to make
the serial code turned "parallel". Parallelization here is achieved
through the submit script.
**demo\_f\_condor.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
{{%expand "demo_condor.f90" %}}
{{< highlight fortran >}}
Program demo_f_condor
implicit none
integer, parameter :: N = 5
......@@ -94,15 +72,12 @@ Subroutine proc(w)
Return
End Subroutine
```
{{< /highlight >}}
{{% /expand %}}
**demo\_c\_condor.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
{{%expand "demo_c_condor.c" %}}
{{< highlight c >}}
//demo_c_condor
#include <stdio.h>
......@@ -141,10 +116,12 @@ int main(int argc, char* argv[]){
printf("sum(y)= %lf\n", sum);
return 0;
}
```
{{< /highlight >}}
{{% /expand %}}
---
Compiling the Code
------------------
#### Compiling the Code
The compiled executable needs to match the "standard" environment of the
worker node. The easies way is to directly use the compilers installed
......@@ -152,24 +129,22 @@ on the HCC supercomputer without loading extra modules. The standard
compiler of the HCC supercomputer is GNU Compier Collection. The version
can be looked up by the command lines `gcc -v` or `gfortran -v`.
``` syntaxhighlighter-pre
{{< highlight bash >}}
$ gfortran demo_f_condor.f90 -o demo_f_condor.x
$ gcc demo_c_condor.c -o demo_c_condor.x
```
{{< /highlight >}}
<span style="color: rgb(0,0,0);">Creating a Submit Script</span>
----------------------------------------------------------------
#### Creating a Submit Script
Create a submit script to request 2 jobs (queue). The name of the job
subdirectories is specified in the line `initialdir`. The
`$(process)` macro assigns integer numbers to the job subdirectory
name `job_`. The numbers run form 0 to <span
style="font-family: monospace;">queue-1</span>. The name of the input
name `job_`. The numbers run form `0` to `queue-1`. The name of the input
data file is specified in the line `transfer_input_files`.
**submit\_f.condor**
``` syntaxhighlighter-pre
{{% panel header="`submit_f.condor`"%}}
{{< highlight bash >}}
universe = grid
grid_resource = pbs
batch_queue = guest
......@@ -181,11 +156,11 @@ error = Fortran_$(process).err
initialdir = job_$(process)
transfer_input_files = data.dat
queue 2
```
**submit\_c.condor**
{{< /highlight >}}
{{% /panel %}}
``` syntaxhighlighter-pre
{{% panel header="`submit_c.condor`"%}}
{{< highlight bash >}}
universe = grid
grid_resource = pbs
batch_queue = guest
......@@ -197,20 +172,22 @@ error = C_$(process).err
initialdir = job_$(process)
transfer_input_files = data.dat
queue 2
```
{{< /highlight >}}
{{% /panel %}}
Submit the Job
--------------
#### Submit the Job
The job can be submitted through the command `condor_submit`. The job
status can be monitored by entering `condor_q` followed by the
username.
``` syntaxhighlighter-pre
{{< highlight bash >}}
$ condor_submit submit_f.condor
$ condor_submit submit_c.condor
$ condor_q <username>
```
{{< /highlight >}}
Replace `<username>` with your HCC username.
Sample Output
-------------
......@@ -219,46 +196,24 @@ In the job subdirectory `job_0`, the sum from 1 to 5 is computed and
printed to the `.out` file. In the job subdirectory `job_1`, the sum
from 6 to 10 is computed and printed to the `.out` file.
**Fortran\_0.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
{{%expand "Fortran_0.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
sum(y) = 15.000000000000000
```
{{< /highlight >}}
{{% /expand %}}
**Fortran\_1.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
{{%expand "Fortran_1.out" %}}
{{< highlight batchfile>}}
i,x = 1 6.0000000000000000
i,x = 2 7.0000000000000000
i,x = 3 8.0000000000000000
i,x = 4 9.0000000000000000
i,x = 5 10.000000000000000
sum(y) = 40.000000000000000
```
Attachments:
------------
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[condor\_dir.zip](attachments/2851447/3178559.zip) (application/zip)
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[condor\_dir.zip](attachments/2851447/3178560.zip) (application/zip)
<img src="assets/images/icons/bullet_blue.gif" width="8" height="8" />
[condor\_dir.zip](attachments/2851447/3178558.zip) (application/zip)
Document generated by Confluence on Oct 24, 2018 14:47
[Atlassian](http://www.atlassian.com/)
{{< /highlight >}}
{{% /expand %}}
This diff is collapsed.
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment