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) title = "Condor Jobs on HCC"
3. [HCC Documentation](HCC-Documentation_332651.html) description = "How to run jobs using Condor on HCC machines"
4. [Quick Start Guides](Quick-Start-Guides_1245279.html) weight = "54"
+++
<span id="title-text"> HCC-DOCS : Condor Jobs on HCC </span> 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 [condor_dir.zip](/attachments/3178558.zip).
Created by <span class="author"> Huang Cheng-Wei</span>, last modified #### Login to a HCC Cluster
by <span class="editor"> Adam Caprez</span> on Sep 17, 2013
This quick start demonstrates how to run multiple copies of<span 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.
style="font-size: 14.0px;line-height: 1.4285715;"> Fortran/C program
using Condor on HCC supercomputers. The sample codes and submit scripts {{< highlight bash >}}
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>
Login to Sandhills
------------------
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.
``` syntaxhighlighter-pre
$ cd $WORK $ cd $WORK
$ mkdir condor_dir $ mkdir condor_dir
$ cd condor_dir $ cd condor_dir
$ mkdir job_0 $ mkdir job_0
$ mkdir job_1 $ mkdir job_1
``` {{< /highlight >}}
In the subdirectory condor`_dir`, save all the relevant codes. Here we 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`, 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 ...@@ -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 the serial code turned "parallel". Parallelization here is achieved
through the submit script. through the submit script.
**demo\_f\_condor.f90** <span class="collapse-source expand-control" {{%expand "demo_condor.f90" %}}
style="display:none;"><span {{< highlight fortran >}}
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_condor Program demo_f_condor
implicit none implicit none
integer, parameter :: N = 5 integer, parameter :: N = 5
...@@ -94,15 +72,12 @@ Subroutine proc(w) ...@@ -94,15 +72,12 @@ Subroutine proc(w)
Return Return
End Subroutine 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 //demo_c_condor
#include <stdio.h> #include <stdio.h>
...@@ -141,10 +116,12 @@ int main(int argc, char* argv[]){ ...@@ -141,10 +116,12 @@ int main(int argc, char* argv[]){
printf("sum(y)= %lf\n", sum); printf("sum(y)= %lf\n", sum);
return 0; return 0;
} }
``` {{< /highlight >}}
{{% /expand %}}
Compiling the Code ---
------------------
#### Compiling the Code
The compiled executable needs to match the "standard" environment of the The compiled executable needs to match the "standard" environment of the
worker node. The easies way is to directly use the compilers installed 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 ...@@ -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 compiler of the HCC supercomputer is GNU Compier Collection. The version
can be looked up by the command lines `gcc -v` or `gfortran -v`. 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 $ gfortran demo_f_condor.f90 -o demo_f_condor.x
$ gcc demo_c_condor.c -o demo_c_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 Create a submit script to request 2 jobs (queue). The name of the job
subdirectories is specified in the line `initialdir`. The subdirectories is specified in the line `initialdir`. The
`$(process)` macro assigns integer numbers to the job subdirectory `$(process)` macro assigns integer numbers to the job subdirectory
name `job_`. The numbers run form 0 to <span name `job_`. The numbers run form `0` to `queue-1`. The name of the input
style="font-family: monospace;">queue-1</span>. The name of the input
data file is specified in the line `transfer_input_files`. data file is specified in the line `transfer_input_files`.
**submit\_f.condor** {{% panel header="`submit_f.condor`"%}}
{{< highlight bash >}}
``` syntaxhighlighter-pre
universe = grid universe = grid
grid_resource = pbs grid_resource = pbs
batch_queue = guest batch_queue = guest
...@@ -181,11 +156,11 @@ error = Fortran_$(process).err ...@@ -181,11 +156,11 @@ error = Fortran_$(process).err
initialdir = job_$(process) initialdir = job_$(process)
transfer_input_files = data.dat transfer_input_files = data.dat
queue 2 queue 2
``` {{< /highlight >}}
{{% /panel %}}
**submit\_c.condor**
``` syntaxhighlighter-pre {{% panel header="`submit_c.condor`"%}}
{{< highlight bash >}}
universe = grid universe = grid
grid_resource = pbs grid_resource = pbs
batch_queue = guest batch_queue = guest
...@@ -197,20 +172,22 @@ error = C_$(process).err ...@@ -197,20 +172,22 @@ error = C_$(process).err
initialdir = job_$(process) initialdir = job_$(process)
transfer_input_files = data.dat transfer_input_files = data.dat
queue 2 queue 2
``` {{< /highlight >}}
{{% /panel %}}
Submit the Job #### Submit the Job
--------------
The job can be submitted through the command `condor_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 status can be monitored by entering `condor_q` followed by the
username. username.
``` syntaxhighlighter-pre {{< highlight bash >}}
$ condor_submit submit_f.condor $ condor_submit submit_f.condor
$ condor_submit submit_c.condor $ condor_submit submit_c.condor
$ condor_q <username> $ condor_q <username>
``` {{< /highlight >}}
Replace `<username>` with your HCC username.
Sample Output Sample Output
------------- -------------
...@@ -219,46 +196,24 @@ In the job subdirectory `job_0`, the sum from 1 to 5 is computed and ...@@ -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 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. from 6 to 10 is computed and printed to the `.out` file.
**Fortran\_0.out** <span class="collapse-source expand-control" {{%expand "Fortran_0.out" %}}
style="display:none;"><span {{< highlight batchfile>}}
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 = 1 1.0000000000000000
i,x = 2 2.0000000000000000 i,x = 2 2.0000000000000000
i,x = 3 3.0000000000000000 i,x = 3 3.0000000000000000
i,x = 4 4.0000000000000000 i,x = 4 4.0000000000000000
i,x = 5 5.0000000000000000 i,x = 5 5.0000000000000000
sum(y) = 15.000000000000000 sum(y) = 15.000000000000000
``` {{< /highlight >}}
{{% /expand %}}
**Fortran\_1.out** <span class="collapse-source expand-control" {{%expand "Fortran_1.out" %}}
style="display:none;"><span {{< highlight batchfile>}}
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 6.0000000000000000 i,x = 1 6.0000000000000000
i,x = 2 7.0000000000000000 i,x = 2 7.0000000000000000
i,x = 3 8.0000000000000000 i,x = 3 8.0000000000000000
i,x = 4 9.0000000000000000 i,x = 4 9.0000000000000000
i,x = 5 10.000000000000000 i,x = 5 10.000000000000000
sum(y) = 40.000000000000000 sum(y) = 40.000000000000000
``` {{< /highlight >}}
{{% /expand %}}
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/)
This diff is collapsed.
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment