~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/clients/qrsh/qrsh.html

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 
2
<html>
 
3
<head>
 
4
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
5
   <meta http-equiv="CONTENT-TYPE" content="text/html; charset=iso-8859-1">
 
6
   <meta name="GENERATOR" content="Mozilla/4.76C-CCK-MCD Netscape [en] (X11; U; SunOS 5.8 sun4u) [Netscape]">
 
7
   <meta name="AUTHOR" content="Joachim Gabler">
 
8
   <meta name="CREATED" content="20010611;17143700">
 
9
   <meta name="CHANGEDBY" content="Joachim Gabler">
 
10
   <meta name="CHANGED" content="20010625;17001600">
 
11
</head>
 
12
<body>
 
13
 
 
14
<h1>
 
15
<a NAME="qrsh_dokument"></a>QRSH- Queue Remote Shell</h1>
 
16
 
 
17
<h1>
 
18
Overview</h1>
 
19
Qrsh starts a job similar to qsub, with the difference that
 
20
<ul>
 
21
<li>
 
22
stdin/stdout/stderr is not redirected to a file but to the callers iostreams,
 
23
usually the current terminal</li>
 
24
 
 
25
<li>
 
26
it is possible to start binaries</li>
 
27
 
 
28
<li>
 
29
the returncode of the executed command is propagated to the caller by qrsh</li>
 
30
 
 
31
<li>
 
32
if no command is specified, an rlogin session is started</li>
 
33
 
 
34
<li>
 
35
if a special commandline option -inherit is specified, qrsh will start
 
36
a subtask in an existing Gridengine parallel job</li>
 
37
</ul>
 
38
Qrsh uses the rsh/rshd mechanism (or any similar tool like ssh) to start
 
39
the remote process and redirect io.
 
40
<p>If nothing else is configured, qrsh will start
 
41
<tt>$SGE_ROOT/utilbin/$ARCH/rsh</tt>,
 
42
the rshd used is <tt>$SGE_ROOT/utilbin/$ARCH/rshd</tt>, which is a rshd
 
43
derived from NetBSD code extended by some code to allow process control
 
44
and collection of usage information (see also
 
45
<tt>3rdparty/remote</tt>).
 
46
<p>To configure the system rsh/rshd or an other mechanism the values <tt>rsh_client</tt>
 
47
and <tt>rsh_daemon</tt> resp. <tt>rlogin_client</tt> and <tt>rlogin_daemon</tt>
 
48
in the cluster configuration have to be set.
 
49
<h1>
 
50
Controll flow</h1>
 
51
 
 
52
<h2>
 
53
Remote execution</h2>
 
54
If a user submits a job with qrsh, the following actions are taken
 
55
<ol>
 
56
<li>
 
57
The commandline is parsed and split into codine options and commandline
 
58
to be executed</li>
 
59
 
 
60
<li>
 
61
A job object is created</li>
 
62
 
 
63
<li>
 
64
The job is submitted (communicated to qmaster)</li>
 
65
 
 
66
<li>
 
67
qrsh waits for the job to be started; in regular intervals it requests
 
68
the job status from qmaster, to detect if the job has eventually been deleted</li>
 
69
 
 
70
<li>
 
71
qmaster sends order to start job to execd</li>
 
72
 
 
73
<li>
 
74
execd starts shepherd</li>
 
75
 
 
76
<li>
 
77
The corresponding shepherd contacts qrsh over a socket connection and passes
 
78
the execution host and the port on which a rshd will be started.</li>
 
79
 
 
80
<li>
 
81
qrsh forks and executes a rsh command that connects to the specified host
 
82
and port number on the execution host, then it waits for the command to
 
83
exit</li>
 
84
 
 
85
<li>
 
86
On the execution side, rshd will start a qrsh_starter command</li>
 
87
 
 
88
<li>
 
89
The qrsh_starter sets up the jobs environment, starts a users login shell
 
90
and executes the specified commandline</li>
 
91
 
 
92
<li>
 
93
After the command exits, the qrsh_starter writes the exit code of the command
 
94
to a file and exits, rshd exits</li>
 
95
 
 
96
<li>
 
97
The corresponding shepherd collects job information like usage and exit
 
98
code, it communicates the exitcode to qrsh</li>
 
99
 
 
100
<li>
 
101
qrsh exits with the exitcode of the command or an error, if an error in
 
102
the mechanism occurred.</li>
 
103
</ol>
 
104
<img SRC="process_flow1.gif" NAME="Graphic1" BORDER=0 height=788 width=1121 align=TEXTTOP>
 
105
<br>&nbsp;
 
106
<br>&nbsp;
 
107
<h2>
 
108
Remote login</h2>
 
109
If a user submits a login session with qrsh (rlogin), the following actions
 
110
are taken
 
111
<ol>
 
112
<li>
 
113
The commandline is parsed (codine options)</li>
 
114
 
 
115
<li>
 
116
A job object is created</li>
 
117
 
 
118
<li>
 
119
The job is submitted (communicated to qmaster)</li>
 
120
 
 
121
<li>
 
122
qrsh waits for the job to be started; in regular intervals it requests
 
123
the job status from qmaster, to detect if the job has eventually been deleted</li>
 
124
 
 
125
<li>
 
126
qmaster sends order to start job to execd</li>
 
127
 
 
128
<li>
 
129
execd starts shepherd</li>
 
130
 
 
131
<li>
 
132
the corresponding shepherd contacts qrsh over a socket connection and passes
 
133
the execution host and the port on which an rlogind will be started.</li>
 
134
 
 
135
<li>
 
136
Qrsh forks and executes an rlogin command that connects to the specified
 
137
host and port number on the execution host, then it waits for the command
 
138
to exit</li>
 
139
 
 
140
<li>
 
141
On the execution side, rlogind will spawn a login which creates a login
 
142
shell</li>
 
143
 
 
144
<li>
 
145
After the login shell exits, rshd exits</li>
 
146
 
 
147
<li>
 
148
The corresponding shepherd collects job information like the usage and
 
149
will communicate the job end to qrsh</li>
 
150
 
 
151
<li>
 
152
qrsh exits with the exitcode 0 or an error, if an error in the mechanism
 
153
occurred.</li>
 
154
</ol>
 
155
<img SRC="process_flow2.gif" NAME="Graphic2" BORDER=0 height=788 width=1121 align=TEXTTOP>
 
156
<br>&nbsp;
 
157
<br>&nbsp;
 
158
<br>&nbsp;
 
159
<br>&nbsp;
 
160
<br>&nbsp;
 
161
<h1>
 
162
Process hierarchie</h1>
 
163
 
 
164
<h2>
 
165
Client side</h2>
 
166
Qrsh forks a rsh or an rlogin command, if rsh shall handle stdin (no -nostdin
 
167
option to qrsh), it forks another child process that handles stdin.
 
168
<p>Qrsh -> rsh -> rsh
 
169
<p>qrsh -> rlogin
 
170
<h2>
 
171
Execution side</h2>
 
172
 
 
173
<h3>
 
174
Standard</h3>
 
175
In the standard case, the command will be executed in a users login shell:
 
176
<p>execd -> shepherd -> rshd -> qrsh_starter -> loginshell -> command
 
177
<h3>
 
178
without login shell</h3>
 
179
If the option -noshell is passed to qrsh, the command will be executed
 
180
directly without a wrapping login shell.
 
181
<p>Execd -> shepherd -> rshd -> qrsh_starter -> command
 
182
<h3>
 
183
with wrapper script</h3>
 
184
A wrapper script can be specified, that for example sets up a special environment,
 
185
e.g. A clearcase view.
 
186
<p>A wrapper script is defined in the environment variable QRSH_WRAPPER.
 
187
<p>Execd -> shepherd -> rshd -> qrsh_starter -> wrapper -> command
 
188
<h3>
 
189
rlogin case</h3>
 
190
Execd -> shepherd -> rlogind -> login shell
 
191
<br>&nbsp;
 
192
<br>&nbsp;
 
193
<br>
 
194
<center>
 
195
<p>Copyright 2001 Sun Microsystems, Inc. All rights reserved.</center>
 
196
 
 
197
</body>
 
198
</html>