IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4734


Ignore:
Timestamp:
Aug 9, 2005, 2:14:16 PM (21 years ago)
Author:
eugene
Message:

work on opihi and pclient

Location:
trunk/Ohana/doc/www/html
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/doc/www/html/IPP-subsystems/pclient/index.htm

    r4732 r4734  
    33<meta name=page  content=pclient summary>
    44
    5 #pclient/# is the remote process monitor for pcontrol, the parallel
     5<tt>pclient</tt> is the remote process monitor for pcontrol, the parallel
    66process controller.
    77
     
    99
    1010<p>
    11 The program #pclient/# is used to support the remote jobs which are
    12 run on the remote hosts by #pcontrol/#.  The concept of pclient is to
     11The program <tt>pclient</tt> is used to support the remote jobs which are
     12run on the remote hosts by <tt>pcontrol</tt>.  The concept of pclient is to
    1313act as a buffer between the job running on the remote host and
    1414pcontrol.  The pcontrol design uses (by default) ssh connections
  • trunk/Ohana/doc/www/html/Opihi-Programs/index.htm

    r4733 r4734  
    1313arithmetic on variables, input from source files, and a variety of
    1414other useful tools.  Opihi has a simple command-line interaction that
    15 resembles the UNIX tcsh, but with many additional useful features.  It
    16 can also be used as a scripting language much like #sh/# or perl.
     15resembles the UNIX <tt>tcsh</tt>, but with many additional useful
     16features.  It can also be used as a scripting language much like
     17<tt>sh</tt> or perl.
    1718
    1819<p>
    1920Opihi includes tools to manipulate and display 1-D (vector) and 2-D
    20 (matrix) data.  Two external programs are used to graphical display.
    21 These are the image display tool (Kii), the graphing tool (Kapa), and
    22 the vector and matrix manipulation commands.  Various functions are
    23 available to perform math, statistical, and other operations on
    24 vectors and images.
     21(image) data.  Two external programs are used for graphical display:
     22the image display tool (Kii) and the graphing tool (Kapa).  Various
     23functions are available to perform math, statistical, and other
     24operations on vectors and images.
    2525
    2626<h3> User Interface </h3>
     
    2828<p>
    2929The command-line interaction is based on the readline libraries and
    30 behaves like tcsh.  Arrows can be used for editing.  There is both
    31 command and file completion with the TAB key.  Multiple commands can
    32 generally be placed on one line with semi-colons as separators. 
    33 
    34 The interface has an interaction similar to <tt>tcsh</tt>.  The arrows
    35 allow editing of previous commands.  You can also use emacs-like
    36 commands such as cntl-a to reach the beginning of the line and cntl-e
    37 to reach the end.  There is command and file completion: if you type
    38 part of a command (as the first thing on a line) and then type tab, it
    39 will fill in as much as possible, until the word is not unique.
    40 Typing tab twice at that point will list the possible endings.  For
    41 any but the first word on a line, the same thing will happen for the
    42 files in the current directory.  It is also possible to type just a
     30behaves like #tcsh/#.  Arrows can be used for editing.  There is both
     31command and file completion with the TAB key.  You can also use
     32emacs-like commands such as ctrl-a to reach the beginning of the line
     33and ctrl-e to reach the end.  It is also possible to type just a
    4334fraction of a command, as long as it is unique.  An ambiguous command
    4435will list the possible alternatives.  For example:
    4536
    4637<pre>
    47 dvo: c
     38opihi: c
    4839ambiguous command: c ( catalog cgrid clear create cursor )
    4940</pre>
    5041
    51 The shell is an interpretive programming language.
     42Multiple commands can generally be placed on one line with semi-colons
     43as separators.
    5244
    5345<h3> Data Representations</h3>
     
    5648
    5749<p>
    58 Scalar variables in Opihi are proceeded with a dollar sign ($).  A
     50Scalar variables in Opihi are prepended with a dollar sign ($).  A
    5951variable may be created and the value assigned by a line which looks
    60 like: 
     52like:
    6153
    6254<p class=eq>
     
    6759consist of the standard math operators (+,-,*,/) as well as any
    6860already-defined variables and the functions log(), ln(), sqrt(),
    69 exp(), ten() ($10^x$), sin(), cos(), etc.  Variables can be numeric or character strings.  If
    70 the shell does not understand the syntax of the line as a math
    71 expression, it is assumed to be a string.
     61exp(), ten() ($10^x$), sin(), cos(), etc.  Other special operators are
     62the carret (^) for exponetiation (eg, 2^3 is 8) and the @ symbol as a
     63binary arc-tangent (eg, 1@3 is 18.43 degrees).  In addition, the
     64operator #<</# returns the minimum of the two surrounding values, and
     65#>>/# returns the maximum.  Variables can be numeric or character
     66strings.  If the shell does not understand the syntax of the line as a
     67math expression, it is assumed to be a string.
     68
     69<em>local variables</em>
    7270
    7371<p>
    7472If there is a pair of curly brackets {} anywhere on a command line,
    75 whatever is inside is assumed to be a math expression and evaluated as
    76 well.  This later feature allows functions of variables to be passed
    77 as arguments to Opihi functions.  (see also the discussion below about
    78 temporary vectors and images).
    79 
    80 Any expression within curly brackets {} is assumed
    81 to be an arithmetical expression and is evaluated before the line is
    82 executed.  For example:
     73whatever is inside is assumed to be a math expression and evaluated
     74before the line is executed.  This later feature allows functions of
     75variables to be passed as arguments to Opihi functions.  (see also the
     76discussion below about temporary vectors and images).
     77For example:
    8378
    8479<pre>
     
    8681</pre>
    8782
    88 would give the response 7.07107.  There are math functions cos, sin,
    89 and tan, which operate on radian expressions, and also dcos, dsin,
    90 dtan, which operate on degree expressions.  There are also the
    91 equivalent inverse functions: eg., asin and dasin return radians and
    92 degrees, respectively.  The help section on Math defines all of the
    93 available math functions. 
     83would give the response 7.07107 if $fred had the value of 10.0.  There
     84are math functions #cos/#, #sin/#, and #tan/#, which operate on radian
     85expressions, and also #dcos/#, #dsin/#, #dtan/#, which operate on
     86degree expressions.  There are also the equivalent inverse functions:
     87eg., #asin/# and #dasin/# return radians and degrees, respectively.
     88The help section on Math defines all of the available math functions.
    9489
    9590<h4> Lists </h4>
     
    9792Opihi lists are grouped sets of scalar variables (which may be
    9893strings).  A list consists of N variables with names of the form
    99 <tt>name:i/#, where the value of i ranges from 0 to N-1.  In addition,
    100 the list length is defined as the value #name:n/#.  Since these are
     94<tt>name:i</tt>, where the value of i ranges from 0 to N-1.  In addition,
     95the list length is defined as the value <tt>name:n</tt>.  Since these are
    10196just informally grouped, a list may be defined by hand (ie, by
    10297defining each element and the length).  There is also the command
    103 #list/# which builds a list from the following lines until reaching
    104 a line consisting of the single word #end/#:
     98<tt>list</tt> which builds a list from the following lines until reaching
     99a line consisting of the single word <tt>end</tt>:
    105100
    106101<pre>
     
    112107</pre>
    113108
    114 will define the variables #$sample:0 - $sample:2/#, and #$sample:n/#,
     109will define the variables <tt>$sample:0 - $sample:2</tt>, and <tt>$sample:n</tt>,
    115110with value of 3.
    116111
     
    138133A queue is a data construct consisting of a sequence of lines from
    139134which simple selections can be made.  Data items are added and removed
    140 from the queue with #queuepush/# and #queuepop/# commands which push
     135from the queue with <tt>queuepush</tt> and <tt>queuepop</tt> commands which push
    141136entries on the end of the queue and pop them off the beginning.  The
    142 available queues may be obtained with the command #queuelist/#, and
    143 the length of a specific queue may be determined with the #queuesize/#
    144 command.  The contents of a queue may be printed with #queueprint/#.
     137available queues may be obtained with the command <tt>queuelist</tt>, and
     138the length of a specific queue may be determined with the <tt>queuesize</tt>
     139command.  The contents of a queue may be printed with <tt>queueprint</tt>.
    145140Pushing data onto a non-existent queue will create the queue.  An
    146 empty queue may be created with the command #queueinit/# and a queue
    147 may be deleted with #queuedelete/#
    148 
    149 <p>
    150 The #queuepush/# commands allows for additional options which modify
    151 how the data is pushed on the queue.  The #-uniq/# flag specifies that
     141empty queue may be created with the command <tt>queueinit</tt> and a queue
     142may be deleted with <tt>queuedelete</tt>
     143
     144<p>
     145The <tt>queuepush</tt> commands allows for additional options which modify
     146how the data is pushed on the queue.  The <tt>-uniq</tt> flag specifies that
    152147the queue should be search for an existing match and not add the new
    153 data item if a matching item already exists.  The #-replace/# flag is
    154 similar to the #-uniq/# flag, but instead the new item will replace
     148data item if a matching item already exists.  The <tt>-replace</tt> flag is
     149similar to the <tt>-uniq</tt> flag, but instead the new item will replace
    155150the existing match, if a match is found.  These two options have
    156151identical results if the match is made based on the entire line.
    157152However, they may be more usefully distinguished by specifying a
    158 restriction on the match with the #-key/# flag.  This flag specified
     153restriction on the match with the <tt>-key</tt> flag.  This flag specified
    159154which whitespace-separated element of the line to use for the match,
    160155with the first element being element 0. 
     
    164159document.
    165160
    166 <h3> Flow-control block </h3>
    167 <h3> Shell Programing </h3>
    168 
    169 <pre>
    170 break                     -- escape from function
    171 for                       -- loops
    172 if                        -- logical cases
     161<h3> Opihi Shell Programing and Flow-control</h3>
     162
     163<pre>
    173164input                     -- read command lines from a file
    174165macro                     -- deal with the macros
    175 </pre>
    176 
    177 <p>
    178 There are several options for programming in <tt>status</tt>.  First,
     166for                       -- for loop
     167if                        -- logical cases
     168while                     -- while loop
     169break                     -- escape from function
     170continue                  -- next loop iteration
     171</pre>
     172
     173<p>
     174There are several options for programming in the opihi shell.  First,
    179175a file which contains a series of commands can be executed with
    180 <tt>input (filename)</tt>.  It is also possible to define macros which
    181 will behave much like regular commands.  A macro is defined by typing
    182 <tt>macro name</tt> or <tt>macro create name</tt> followed by the
    183 commands.  Arguments to the macro are assigned to the variables $1
    184 .. $N and the number of arguments is given by $0.  Macros may be
    185 defined in <tt>input</tt> files, and in fact when <tt>status</tt> is
    186 started, it loads the file <tt>~/.statusrc</tt> which may contain
    187 default macros.  Simple loops and if statements can be performed, and
    188 are quite useful for complex macros.
    189 
    190 <p>
    191 'If' statements are similar in syntax to C if statements.  Math
    192 expresions in the if statement must be contained in curly braces, as
    193 elsewhere.  Variables with string values may use the logical ==
    194 operator to test if two strings are the same.  'For' loops are quite
    195 simplistic.  The form is:
    196 
    197 <pre>
    198 for var first last delta
    199  (commands)
    200 end
    201 </pre>
    202 
    203 <p>
    204 The value of <tt>$var</tt> will start at the value <tt>first</tt> and increment by
    205 <tt>delta</tt> after each loop.  The loop will stop after <tt>$var</tt> is greater
    206 than <tt>stop</tt>.  The value <tt>delta</tt> is optional, with 1 assumed.
    207 The value of <tt>$var</tt> may be changed during the loop, and if set
    208 beyong the value of <tt>last</tt> will end the loop early. 
    209 
    210 
    211 <p>
    212 Opihi has several types of flow-control features.  These include
    213 for-loops, while-loops, if-else blocks.  These blocks are defined by
    214 the corresponding command (#for/#, #while/#, #if/#) and are terminated
    215 with by a line with the single word #end/#. 
    216 
    217 <p>
    218 The for loop syntax is simplistic.  The #for/# command specifies the
    219 loop variable, the starting value, the ending value, and optionally
    220 the delta for each loop.  The implicit loop test is always to check if
    221 the loop variable is still less than the end value (or greater than if
    222 the delta value is negative).  The definitions of this loop syntax and
    223 the value of the list length (#$list:n/#) and the vector length
    224 (#vector[]/#) make for natural loops over all elements of a list or
    225 vector.  Below are a few examples:
    226 
    227 <pre>
    228 for i 1 10 0.1
    229  echo $i
    230 end
    231 </pre>
    232 This runs the loop with the variable #$i/# running from 1.0, 1.1, up to 9.9
    233  (inclusive).
    234 
    235 <pre>
    236 for i 0 $list:n
    237  echo $list:$i
    238 end
    239 </pre>
    240 This would print all the elements of the list.
    241 
    242 <pre>
    243 for i 0 vector[]
    244  echo vector[$i]
    245 end
    246 </pre>
    247 This would print all the elements of the vector.
    248 
    249 <p>
    250 The if-block begins with a line of the form: #if (condition)/# and
    251 ends with a single #end/#.  A line with a single #else/# specifies the
    252 optional else portion of the block.  The conditional expression is a
    253 valid math inequality with approximately C-syntax:
    254 
    255 ##
    256 (($i < 10) && ($i > 4))
    257 /##
    258 
    259 The elements of the inequality may also be string comparisons.  The
    260 only valid string comparisons are #==/# and #!=/#. 
    261 
    262 <p>
    263 The while loop begins with a line of the form #while (condition)/# and
    264 ends with a single #end/#.  The conditions follow the same rules as
    265 the if conditional statements.
    266 
    267 <p>
    268 *continue, break, auto-break concepts/*
    269 
    270 
    271 
     176<tt>input (filename)</tt>.  When an opihi-based program is started, it
     177loads a file from the user's home directory, with a name of the form
     178<tt>~/.programrc</tt>.  This resource file may contain any commands,
     179and allows a user to customize his or her environment.
     180
     181<p>
     182It is also possible to define macros which will behave much like
     183regular commands.  A macro is defined by typing <tt>macro name</tt> or
     184<tt>macro create name</tt> followed by the commands.  Arguments to the
     185macro are assigned to the variables $1 .. $N and the number of
     186arguments is given by $0.  Macros may be defined in <tt>input</tt>
     187files.  The following is a sample macro:
     188
     189<pre>
    272190macro test
    273191 echo "this is a macro"
     
    281199
    282200<p>
    283 Some of the other useful programming features are the ability to
    284 run files as scripts (<tt>input (filename)</tt>) and the option of
    285 performing unix system calls (<tt>exec (command)</tt>). 
     201Opihi has several types of flow-control features.  These include
     202for-loops, while-loops, if-else blocks.  These blocks are defined by
     203the corresponding command (<tt>for</tt>, <tt>while</tt>, <tt>if</tt>) and are terminated
     204with by a line with the single word <tt>end</tt>. 
     205
     206<p>
     207The for-loop syntax is simplistic.  The <tt>for</tt> command specifies
     208the loop variable, the starting value, the ending value, and
     209optionally the delta for each loop.  The implicit loop test is always
     210to check if the loop variable is still less than the end value (or
     211greater than if the delta value is negative).  The definitions of this
     212loop syntax and the value of the list length (<tt>$list:n</tt>) and
     213the vector length (<tt>vector[]</tt>) make for natural loops over all
     214elements of a list or vector.  Below are a few examples:
     215
     216<pre>
     217for i 1 10 0.1
     218 echo $i
     219end
     220</pre>
     221This runs the loop with the variable <tt>$i</tt> running from 1.0, 1.1, up to 9.9
     222 (inclusive).
     223
     224<pre>
     225for i 0 $list:n
     226 echo $list:$i
     227end
     228</pre>
     229This would print all the elements of the list.
     230
     231<pre>
     232for i 0 vector[]
     233 echo vector[$i]
     234end
     235</pre>
     236This would print all the elements of the vector.
     237
     238<p>
     239The if-block begins with a line of the form: <tt>if (condition)</tt> and
     240ends with a single <tt>end</tt>.  A line with a single <tt>else</tt> specifies the
     241optional else portion of the block.  The conditional expression is a
     242valid math inequality with approximately C-syntax:
     243
     244<pre>
     245(($i < 10) && ($i > 4))
     246</pre>
     247
     248The elements of the inequality may also be string comparisons.  The
     249only valid string comparisons are <tt>==</tt> and <tt>!=</tt>. 
     250
     251<p>
     252The while loop begins with a line of the form <tt>while (condition)</tt> and
     253ends with a single <tt>end</tt>.  The conditions follow the same rules as
     254the if conditional statements.
     255
     256<em>continue, break, auto-break concepts</em>
     257
    286258
    287259<h3> Miscellaneous Commands </h3>
     
    307279files (this includes general help not associated with a specific
    308280command). 
     281
     282<em>output</em>
     283
     284<em>scan</em>
    309285
    310286<h3> 1D Data and the Graphing Window </h3>
Note: See TracChangeset for help on using the changeset viewer.