Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/tst/testinstall/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 18.9.2025 mit Größe 8 kB image not shown  

Quelle  chap4.html   Sprache: unbekannt

 
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (hpc) - Chapter 4: Console User Interface</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap4"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap3.html">[Previous Chapter]</a>    <a href="chap5.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chap4_mj.html">[MathJax on]</a></p>
<p><a id="X7AFF436381C319CD" name="X7AFF436381C319CD"></a></p>
<div class="ChapSects"><a href="chap4.html#X7AFF436381C319CD">4 <span class="Heading">Console User Interface</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4.html#X7B958D607F9E0EF3">4.1 <span class="Heading">Console UI commands</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X8149CF507A188BFB">4.1-1 <span class="Heading">!shell [name]</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X8589D19484DBBA7B">4.1-2 <span class="Heading">!fork [name]</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X7E57FE757CBAD4BC">4.1-3 <span class="Heading">!list</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X7C2721208570CF5D">4.1-4 <span class="Heading">!kill id</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X86052CA284DD8E8E">4.1-5 <span class="Heading">!break id</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X8022D93682DD8ABE">4.1-6 <span class="Heading">!name [id] name</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X810ED84D848681B6">4.1-7 <span class="Heading">!info id</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X847F80AB873516DC">4.1-8 <span class="Heading">!hide [id|*]</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X87515BA77E6327EE">4.1-9 <span class="Heading">!watch [id|*]</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X8295E57782EEF3ED">4.1-10 <span class="Heading">!keep num</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X8305DFEA87C30627">4.1-11 <span class="Heading">!prompt (id|*) string</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X8484498A787248A2">4.1-12 <span class="Heading">!prefix (id|*) string</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X80CE7A5B874A8D6B">4.1-13 <span class="Heading">!select id</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X7A5980F782780572">4.1-14 <span class="Heading">!next</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X838676D07FBD27CE">4.1-15 <span class="Heading">!previous</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X7B6441957CFB191E">4.1-16 <span class="Heading">!replay num [id]</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X850D86EE8203F94D">4.1-17 <span class="Heading">!id</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X84FE74AA7C34C493">4.1-18 <span class="Heading">!source file</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X84BA0EF7803E2920">4.1-19 <span class="Heading">!alias shortcut expansion</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X80E7398679C4B87C">4.1-20 <span class="Heading">!unalias shortcut</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X79D5CE9A86D5FC6A">4.1-21 <span class="Heading">!eval expr</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X831807A67C6B4B2D">4.1-22 <span class="Heading">!run function string</span></a>
</span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4.html#X876007F6862BA1BD">4.2 <span class="Heading">GAP functions to access the Shell UI</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X84154E44780A3402">4.2-1 TextUIRegisterCommand</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X85312D647966343E">4.2-2 TextUIForegroundThread</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X7AD377F882A1EEC8">4.2-3 TextUIForegroundThreadName</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X8117AC7980300EF5">4.2-4 TextUISelectThread</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X7C9543F07F0FECF5">4.2-5 TextUIOutputHistory</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X839D85B97B23BC3C">4.2-6 TextUISetOutputHistoryLength</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X81AB547681B0A2C8">4.2-7 TextUINewSession</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X7B69D7177D7742D2">4.2-8 TextUIRunCommand</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4.html#X8532502D78CE5475">4.2-9 TextUIWritePrompt</a></span>
</div></div>
</div>

<h3>4 <span class="Heading">Console User Interface</span></h3>

<p>HPC-GAP has a multi-threaded user interface to assist with the development and debugging of concurrent programs. This user interface is enabled by default; to disable it, and use the single-threaded interface, GAP has to be started with the <code class="code">-S</codeoption.</p>

<p><a id="X7B958D607F9E0EF3" name="X7B958D607F9E0EF3"></a></p>

<h4>4.1 <span class="Heading">Console UI commands</span></h4>

<p>The console user interface provides the user with the option to control threads by commands prefixed with an exclamation mark ("!"). Those commands are listed below.</p>

<p>For ease of use, users only need to type as many letters of each commands so that it can be unambiguously selected. Thus, the shell will recognize <code class="code">!l</code> as an abbreviation for <code class="code">!list</code>.</p>

<p><a id="X8149CF507A188BFB" name="X8149CF507A188BFB"></a></p>

<h5>4.1-1 <span class="Heading">!shell [name]</span></h5>

<p>Starts a new shell thread and switches to it. Optionally, a name for the thread can be provided.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">!shell</span>
--- Switching to thread 4
[4] gap>
</pre></div>

<p><a id="X8589D19484DBBA7B" name="X8589D19484DBBA7B"></a></p>

<h5>4.1-2 <span class="Heading">!fork [name]</span></h5>

<p>Starts a new background shell thread. Optionally, a name for the thread can be provided.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">!fork</span>
--- Created new thread 5
</pre></div>

<p><a id="X7E57FE757CBAD4BC" name="X7E57FE757CBAD4BC"></a></p>

<h5>4.1-3 <span class="Heading">!list</span></h5>

<p>List all current threads that are interacting with the user. This does not list threads created with <code class="code">CreateThread()</code> that have not entered a break loop.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">!list</span>
--- Thread 0 [0]
--- Thread 4 [4]
--- Thread 5 [5] (pending output)
</pre></div>

<p><a id="X7C2721208570CF5D" name="X7C2721208570CF5D"></a></p>

<h5>4.1-4 <span class="Heading">!kill id</span></h5>

<p>Terminates the specified thread.</p>

<p><a id="X86052CA284DD8E8E" name="X86052CA284DD8E8E"></a></p>

<h5>4.1-5 <span class="Heading">!break id</span></h5>

<p>Makes the specified thread enter a break loop.</p>

<p><a id="X8022D93682DD8ABE" name="X8022D93682DD8ABE"></a></p>

<h5>4.1-6 <span class="Heading">!name [id] name</span></h5>

<p>Give the thread with the numerical identifier or name <code class="code">id</code> the name <code class="code">name</code>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">!name 5 test</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">!list</span>
--- Thread 0 [0]
--- Thread 4 [4]
--- Thread test [5] (pending output)
</pre></div>

<p><a id="X810ED84D848681B6" name="X810ED84D848681B6"></a></p>

<h5>4.1-7 <span class="Heading">!info id</span></h5>

<p>Provide information about the thread with the numerical identifier or name <code class="code">id</code>. <em>Not yet implemented</em>.</p>

<p><a id="X847F80AB873516DC" name="X847F80AB873516DC"></a></p>

<h5>4.1-8 <span class="Heading">!hide [id|*]</span></h5>

<p>Hide output from the thread with the numerical identifier or name <code class="code">id</code> when it is not the foreground thread. If no thread is specified, make this the default behavior for future threads.</p>

<p><a id="X87515BA77E6327EE" name="X87515BA77E6327EE"></a></p>

<h5>4.1-9 <span class="Heading">!watch [id|*]</span></h5>

<p>Show output from the thread with the numerical identifier or name <code class="code">id</code> even when it is not the foreground thread. If no thread is specified, make this the default behavior for future threads.</p>

<p><a id="X8295E57782EEF3ED" name="X8295E57782EEF3ED"></a></p>

<h5>4.1-10 <span class="Heading">!keep num</span></h5>

<p>Keep <code class="code">num</code> lines of output from each thread.</p>

<p><a id="X8305DFEA87C30627" name="X8305DFEA87C30627"></a></p>

<h5>4.1-11 <span class="Heading">!prompt (id|*) string</span></h5>

<p>Set the prompt for the specified thread (or for all newly created threads if <code class="code">*</code> was specified) to be <code class="code">string</code>. If the string contains the pattern <code class="code">id</code>, it is replaced with the numerical id of the thread; if it contains the pattern <code class="code">name</code>, it is replaced with the name of the thread; if the thread has no name, the numerical id is displayed instead.</p>

<p><a id="X8484498A787248A2" name="X8484498A787248A2"></a></p>

<h5>4.1-12 <span class="Heading">!prefix (id|*) string</span></h5>

<p>Prefix the output from the specified thread (or for all newly created threads if <code class="code">*</code> was specified) with <code class="code">string</code>. The same substitution rules as for the <code class="code">!prompt</codecommand apply.</p>

<p><a id="X80CE7A5B874A8D6B" name="X80CE7A5B874A8D6B"></a></p>

<h5>4.1-13 <span class="Heading">!select id</span></h5>

<p>Make the specified thread the foreground thread.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">!select 4</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">!select 4</span>
--- Switching to thread 4
[4] gap>
</pre></div>

<p><a id="X7A5980F782780572" name="X7A5980F782780572"></a></p>

<h5>4.1-14 <span class="Heading">!next</span></h5>

<p>Make the next thread in numerical order the foreground thread.</p>

<p><a id="X838676D07FBD27CE" name="X838676D07FBD27CE"></a></p>

<h5>4.1-15 <span class="Heading">!previous</span></h5>

<p>Make the previous thread in numerical order the foreground thread.</p>

<p><a id="X7B6441957CFB191E" name="X7B6441957CFB191E"></a></p>

<h5>4.1-16 <span class="Heading">!replay num [id]</span></h5>

<p>Display the last <code class="code">num</code> lines of output of the specified thread. If no thread was specified, display the last <code class="code">num</code> lines of the current foreground thread.</p>

<p><a id="X850D86EE8203F94D" name="X850D86EE8203F94D"></a></p>

<h5>4.1-17 <span class="Heading">!id</span></h5>

<p><code class="code">!id</code> is a shortcut for <code class="code">!select id</code>.</p>

<p><a id="X84FE74AA7C34C493" name="X84FE74AA7C34C493"></a></p>

<h5>4.1-18 <span class="Heading">!source file</span></h5>

<p>Read commands from file <code class="code">file</code>.</p>

<p><a id="X84BA0EF7803E2920" name="X84BA0EF7803E2920"></a></p>

<h5>4.1-19 <span class="Heading">!alias shortcut expansion</span></h5>

<p>Create an alias. After defining the alias, <code class="code">!shortcut 'rest of line'</code> will be replaced with <code class="code">!expansion 'rest of line'</code>.</p>

<p><a id="X80E7398679C4B87C" name="X80E7398679C4B87C"></a></p>

<h5>4.1-20 <span class="Heading">!unalias shortcut</span></h5>

<p>Removes the specified alias.</p>

<p><a id="X79D5CE9A86D5FC6A" name="X79D5CE9A86D5FC6A"></a></p>

<h5>4.1-21 <span class="Heading">!eval expr</span></h5>

<p>Evaluates <code class="code">expr</code> as a command.</p>

<p><a id="X831807A67C6B4B2D" name="X831807A67C6B4B2D"></a></p>

<h5>4.1-22 <span class="Heading">!run function string</span></h5>

<p>Calls the function with name <code class="code">function</code>, passing it the single argument <code class="code">string</code> as a GAP string.</p>

<p><a id="X876007F6862BA1BD" name="X876007F6862BA1BD"></a></p>

<h4>4.2 <span class="Heading">GAP functions to access the Shell UI</span></h4>

<p>There are several functions to access the basic functionality of the shell user interface. Other than <code class="func">TextUIRegisterCommand</code> (<a href="chap4.html#X84154E44780A3402"><span class="RefLink">4.2-1</span></a>), they can only be called from within a registered command.</p>

<p>Threads can be specified either by their numerical identifier or by their name (as a string). The empty string can be used to specify the current foreground thread.</p>

<p><a id="X84154E44780A3402" name="X84154E44780A3402"></a></p>

<h5>4.2-1 TextUIRegisterCommand</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIRegisterCommand</code>( <var class="Arg">name</var>, <var class="Arg">func</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Registers the command <code class="code">!name</code> with the shell UI. It will call <func> with the rest of the command line passed as a string argument when typed.</p>

<p><a id="X85312D647966343E" name="X85312D647966343E"></a></p>

<h5>4.2-2 TextUIForegroundThread</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIForegroundThread</code>(  )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns the numerical identifier of the current foreground thread.</p>

<p><a id="X7AD377F882A1EEC8" name="X7AD377F882A1EEC8"></a></p>

<h5>4.2-3 TextUIForegroundThreadName</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIForegroundThreadName</code>(  )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns the name of the current foreground thread or <code class="keyw">fail</code> if the current foreground thread has no name.</p>

<p><a id="X8117AC7980300EF5" name="X8117AC7980300EF5"></a></p>

<h5>4.2-4 TextUISelectThread</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUISelectThread</code>( <var class="Arg">id</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Makes <var class="Arg">id</var> the current foreground thread. Returns <code class="keyw">true</code> or <code class="keyw">false</code> to indicate success.</p>

<p><a id="X7C9543F07F0FECF5" name="X7C9543F07F0FECF5"></a></p>

<h5>4.2-5 TextUIOutputHistory</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIOutputHistory</code>( <var class="Arg">id</var>, <var class="Arg">count</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns the last <var class="Arg">count</var> lines of the thread specified by <var class="Arg">id</var> (which can be a numerical identifier or a name). Returns <code class="keyw">fail</code> if there is no such thread.</p>

<p><a id="X839D85B97B23BC3C" name="X839D85B97B23BC3C"></a></p>

<h5>4.2-6 TextUISetOutputHistoryLength</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUISetOutputHistoryLength</code>( <var class="Arg">length</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>By default, retain <var class="Arg">length</var> lines of output history from each thread.</p>

<p><a id="X81AB547681B0A2C8" name="X81AB547681B0A2C8"></a></p>

<h5>4.2-7 TextUINewSession</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUINewSession</code>( <var class="Arg">foreground</var>, <var class="Arg">name</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Creates a new shell thread. Here, <var class="Arg">foreground</var> is a boolean variable specifying whether it should be made the new foreground thread and <var class="Arg">name</var> is the name of the thread. The empty string can be used to leave the thread without a name.</p>

<p><a id="X7B69D7177D7742D2" name="X7B69D7177D7742D2"></a></p>

<h5>4.2-8 TextUIRunCommand</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIRunCommand</code>( <var class="Arg">command</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Run the command denoted by <var class="Arg">command</var> as though a user had typed it. The command must not contain a newline character.</p>

<p><a id="X8532502D78CE5475" name="X8532502D78CE5475"></a></p>

<h5>4.2-9 TextUIWritePrompt</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TextUIWritePrompt</code>(  )</td><td class="tdright">( function )</td></tr></table></div>
<p>Display a prompt for the current thread.</p>


<div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap3.html">[Previous Chapter]</a>    <a href="chap5.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>

100%


[ zur Elbe Produktseite wechseln0.20Quellennavigators  Analyse erneut starten  ]