Project

General

Profile

Submit Grid Job » History » Version 19

Timo Eronen, 2016-12-08 12:50

1 1 Timo Eronen
h1. Submit Grid Job
2
3 12 Timo Eronen
*1. Before you can submit Grid jobs you need to prepare your setup.*
4
5
Finish first the steps described here: https://p55cc-redmine.utu.fi/projects/user-s-page/wiki/Prepare_For_Grid_Usage
6
7
*2. Other preparation*
8
9
You use the Grid resources via the ARC (Advanced Resource Connector) middleware, developed by the Nordugrid community.
10
11
There are basically two ways to submit Grid job using ARC:
12
13
# From ANY other computer but Pleione or Titan Login frontend
14
# From Pleione or Titan Login frontend. (i.e. pleione.utu.fi or titan.utu.fi)
15
16
h3. 2.1 Using the Grid from other computers
17
18
Using the Grid from other computers than Pleione or Titan you need to install ARC client software and configure it. Such tasks
19 13 Timo Eronen
are documented here: https://research.csc.fi/fgci-arc-middleware#1.3.2
20 12 Timo Eronen
21
h3. 2.2 Using the Grid from Pleione or Titan frontend
22
23 14 Timo Eronen
The rest of this guide is just short version of this guide: https://research.csc.fi/fgci-using-arc-middleware
24
25 1 Timo Eronen
So you might want to read the comprehensive guide before running the example.
26 15 Timo Eronen
27 19 Timo Eronen
*3. Running self made binaries and FGCI software via runtime environment*
28 1 Timo Eronen
29 19 Timo Eronen
In principle there are two ways to use the Grid resources:
30
- running self made binaries
31
- running FGCI pre-installed software
32
33
*4. Example of running a simple self made binary as a Grid job from Titan login node*
34
35 17 Timo Eronen
To run your binary as a Grid job you need the following files:
36 16 Timo Eronen
37
- compiled program (the binary)
38
- job description file
39
- batch file
40
- possibly input file(s)
41
42
43
The c-source of an example program *gtest.c* :
44
45
<pre>
46
#include <stdio.h>
47
48
int main(void) {
49
50
char *line = NULL;
51
size_t size;
52
53
  printf("Hello UTU.\n");
54
55
  while (getline(&line, &size, stdin) != -1)
56
    printf("%s", line);
57
58
  return(0);
59
60
}
61
</pre>
62
63
Compile the source:
64
65
<pre>
66
gcc -Wall -o gtest gtest.c
67
</pre>
68
69
70
The job description file *gtest.xrsl* :
71
72
<pre>
73
&(executable=gtest.sh)
74
(jobname=g_test)
75 1 Timo Eronen
(runtimeenvironment>="ENV/FGCI")
76 16 Timo Eronen
(join="yes")
77
(stdout=std.out)
78
(cpuTime="1 hours")
79 17 Timo Eronen
(count="1")
80 16 Timo Eronen
(memory="1000")
81
(inputfiles=
82
   ("gtest" "" )
83
   ("gtest.txt" "" )
84
)
85
(outputfiles=
86
   ("gtest.tgz" "" )
87
)
88
</pre>
89
90
The batch file *gtest.sh* :
91
92
<pre>
93
#!/bin/sh
94
echo "Running gtest"
95
module load OpenMPI
96
chmod u+x gtest
97
mpirun ./gtest < gtest.txt > gtest.out
98
tar czf gtest.tgz gtest.out
99 1 Timo Eronen
echo "Done"
100 16 Timo Eronen
exit 0
101
</pre>
102
103
104 17 Timo Eronen
Input file for this test run *gtest.txt* :
105 16 Timo Eronen
106 1 Timo Eronen
<pre>
107
108 16 Timo Eronen
Hello FGCI.
109
110
</pre>
111
112 17 Timo Eronen
*Now you are ready to run the job.*
113
114 16 Timo Eronen
Get proxy to run the job:
115
116
<pre>
117
118
$ arcproxy
119
120
Enter pass phrase for private key:
121
122
Your identity: /DC=org/DC=terena/DC=tcs/C=FI/O=Turun yliopisto/CN=Timo Eronen tke@utu.fi
123
Proxy generation succeeded
124
Your proxy is valid until: 2016-12-08 19:46:02
125
</pre>
126
127
Run the job:
128
129
<pre>
130
$ arcsub gtest.xrsl
131
132
Job submitted with jobid: gsiftp://io-grid.fgci.csc.fi:2811/jobs/3dxMDmPc7Ypn9NOVEmGrhjGmABFKDmABFKDmXGKKDmABFKDmWJfHjm
133
</pre>
134
135
Query status of the job:
136
137
<pre>
138
$ arcstat gsiftp://io-grid.fgci.csc.fi:2811/jobs/3dxMDmPc7Ypn9NOVEmGrhjGmABFKDmABFKDmXGKKDmABFKDmWJfHjm
139
140
Job: gsiftp://io-grid.fgci.csc.fi:2811/jobs/3dxMDmPc7Ypn9NOVEmGrhjGmABFKDmABFKDmXGKKDmABFKDmWJfHjm
141
 Name: g_test
142
 State: Finishing
143
144
Status of 1 jobs was queried, 1 jobs returned information
145 1 Timo Eronen
</pre>
146 16 Timo Eronen
147
Job was not yet finished but after awhile:
148
149
<pre>
150
$ arcstat gsiftp://io-grid.fgci.csc.fi:2811/jobs/3dxMDmPc7Ypn9NOVEmGrhjGmABFKDmABFKDmXGKKDmABFKDmWJfHjm
151 17 Timo Eronen
152 16 Timo Eronen
Job: gsiftp://io-grid.fgci.csc.fi:2811/jobs/3dxMDmPc7Ypn9NOVEmGrhjGmABFKDmABFKDmXGKKDmABFKDmWJfHjm
153
 Name: g_test
154
 State: Finished
155
 Exit Code: 0
156
157
Status of 1 jobs was queried, 1 jobs returned information
158
</pre>
159
160
Get the results:
161
162 1 Timo Eronen
<pre>
163 16 Timo Eronen
$ arcget gsiftp://io-grid.fgci.csc.fi:2811/jobs/3dxMDmPc7Ypn9NOVEmGrhjGmABFKDmABFKDmXGKKDmABFKDmWJfHjm
164
165
Results stored at: 3dxMDmPc7Ypn9NOVEmGrhjGmABFKDmABFKDmXGKKDmABFKDmWJfHjm
166
Jobs processed: 1, successfully retrieved: 1, successfully cleaned: 1
167
</pre>
168
169 18 Timo Eronen
And then you are ready to view the results:
170 16 Timo Eronen
171
<pre>
172 1 Timo Eronen
$ ls -l 3dxMDmPc7Ypn9NOVEmGrhjGmABFKDmABFKDmXGKKDmABFKDmWJfHjm/
173
total 8
174 16 Timo Eronen
-rw------- 1 tke admin 148 Dec  8 09:14 gtest.tgz
175
-rw------- 1 tke admin  19 Dec  8 09:14 std.out
176
177 17 Timo Eronen
$ cd 3dxMDmPc7Ypn9NOVEmGrhjGmABFKDmABFKDmXGKKDmABFKDmWJfHjm/
178 16 Timo Eronen
179
$ cat std.out
180
Running gtest
181
Done
182 17 Timo Eronen
183
$ tar xf gtest.tgz
184 16 Timo Eronen
185
$ cat gtest.out
186
187
Hello UTU.
188 1 Timo Eronen
189
Hello FGCI.
190
</pre>
191 18 Timo Eronen
192 19 Timo Eronen
*5. Example of running a Grid job via FGCI runtime environments from Titan login node*
193 18 Timo Eronen
194
Comprehensive info:
195
196
https://research.csc.fi/fgci-using-software-through-runtime-environments
197
198
[will be added later]