📄 node39.htm
字号:
<P>
<dt>
<b>{mpd -h -? -help}</b><dd>
<BR>
The options -h -? or -help will print out a list of the most common command line options.
</dl>
<BR>
<P>
<HR>
<A HREF="node39.htm#Node40"><IMG WIDTH=16 HEIGHT=16 SRC="previous.xbm"></A><A HREF="node39.htm#Node39"><IMG WIDTH=16 HEIGHT=16 SRC="up.xbm"></A><A HREF="node39.htm#Node42"><IMG WIDTH=16 HEIGHT=16 SRC="next.xbm"></A><BR>
<b>Up: </b><A HREF="node39.htm#Node39"> MPD process launcher</a>
<b>Next: </b><A HREF="node39.htm#Node42"> Console commands</a>
<b>Previous: </b><A HREF="node39.htm#Node40"> Quick reference</a>
<P>
<HR><H3><A NAME="Node42">Console commands</a></H3>
<A HREF="node39.htm#Node41"><IMG WIDTH=16 HEIGHT=16 SRC="previous.xbm"></A><A HREF="node39.htm#Node39"><IMG WIDTH=16 HEIGHT=16 SRC="up.xbm"></A><A HREF="node43.htm#Node43"><IMG WIDTH=16 HEIGHT=16 SRC="next.xbm"></A><BR>
<b>Up: </b><A HREF="node39.htm#Node39"> MPD process launcher</a>
<b>Next: </b><A HREF="node43.htm#Node43"> <TT>mpich</TT> and threads</a>
<b>Previous: </b><A HREF="node39.htm#Node41"> Command line options</a>
<P>
This section describes all the commands that can be issued to a mpd in a console session.
Console sessions are established by executing <em>mpd -console</em> or <em>mpd -console
<em> host</em></em> as described in the previous section.
<P>
DATABASE OPERATIONS
<P>
An mpd can maintain a set of in-memory databases. The databases store key/value
pairs of strings. The data is not persistent, so when an mpd is taken down,
all the databases are destroyed. Mpd is not a database application. This
capability is provided so parallel applications can pass small amounts of
initialization data between processes. It is not intended to hold user data.
<P>
<dl>
<dt>
<b>dbcreate</b><dd>
<BR>
This command creates a database and returns the name.
<P>
Return values:
<P>
The name of the database or <tt>DBS_FAIL</tt> if an error occurred.
<P>
<dt>
<b>dbcreate name or name=x</b><dd>
<BR>
This command creates a database with the specified name. DBS_SUCCESS is returned
if the database is created or if it already exists.
<P>
Return values:
<P>
<tt>DBS_SUCCESS</tt> or <tt>DBS_FAIL</tt>
<P>
<dt>
<b>dbdestroy name or name=x</b><dd>
<BR>
This command removes an entire database.
<P>
Return values:
<P>
<tt>DBS_SUCCESS</tt> or <tt>DBS_FAIL</tt>
<P>
<dt>
<b>dbput name:key:value or name=x key=x value=x</b><dd>
<BR>
This command inputs a key/value pair into the specified database. The key values need
to be unique. It is not allowed to call dbput with the same key more than once into
the same database.
<P>
Return values:
<P>
<tt>DBS_SUCCESS</tt> or <tt>DBS_FAIL</tt>
<P>
<dt>
<b>dbget name:key or name=x key=x</b><dd>
<BR>
This command retrieves the value of the key in the specified database.
<P>
Return values:
<P>
The value of the key in the specified database or <tt>DBS_FAIL</tt>
<P>
<dt>
<b>dbdelete name:key or name=x key=x</b><dd>
<BR>
This command deletes a key from the specified databse.
<P>
Return values:
<P>
<tt>DBS_SUCCESS</tt> or <tt>DBS_FAIL</tt>
<P>
<dt>
<b>dbfirst name or name=x</b><dd>
<BR>
This command starts the iterator on the specified database. It returns the first
key/value pair in the database or <tt>DBS_END</tt> if the database is empty.
<P>
Return values:
<P>
<tt>key=value</tt>, or <tt>DBS_END</tt> or <tt>DBS_FAIL</tt>
<P>
<dt>
<b>dbnext name or name=x</b><dd>
<BR>
This command returns the next key/value pair in the specified database. Repeat this
command until it returns <tt>DBS_END</tt> to iterate through the entire database. You must
call <tt>dbfirst</tt> before this command to start the iteration.
<P>
Return values:
<P>
<tt>key=value</tt>, <tt>DBS_END</tt>, or <tt>DBS_FAIL</tt>
<P>
<dt>
<b>dbfirstdb</b><dd>
<BR>
This command starts the iterator on the entire database namespace. It returns the
name of the first database in the space or <tt>DBS_END</tt> if there are no existing databases.
<P>
Return values:
<P>
<tt>name=name</tt> or <tt>DBS_END</tt>
<P>
<dt>
<b>dbnextdb</b><dd>
<BR>
This command returns the name of the next database in the namespace.
Repeat this command until it returns <tt>DBS_END</tt> to iterate through the names
of all available databases. You must call <tt>dbfirstdb</tt> before this command to
start the iteration.
<P>
Return values:
<P>
<tt>name=name</tt> or <tt>DBS_END</tt>
<P>
</dl>
<BR>
PROCESS OPERATIONS
<P>
<dl>
<dt>
<b> </b><dd>
launch h=host c=cmd e=env m=map d=dir a=account p=password 0=stdin
1=stdout 2=stderr or 12=stdouterr or 012=inouterr k=rank
<P>
With the default installation, the mpds run as services on each of the nodes.
When a launch command reaches the requested node, the mpd uses the account and
password parameters to launch the requested process in the security context of
that user. If the mpd has been started in single user mode, then the mpd runs
in the security context of a single user. The mpd runs in single user mode if
it was installed with a specific username and password or if it is run from a
command prompt, <tt>mpd -d ...</tt>. When in single user mode all processes are launched
in the security context of the same user. There is no need to pass the account
and password. If they are provided they are ignored.
<BLOCKQUOTE><DL>
<DT><IMG WIDTH=14 HEIGHT=14 SRC="purpleball.gif" ALT="*">
h=host
<P>
the hostname to launch the process on. If this option is not specified the process
is launched on the local host.
<P>
<DT><IMG WIDTH=14 HEIGHT=14 SRC="purpleball.gif" ALT="*">
c=cmd
<P>
the path to the executable plus any arguments. For example: <BR>
c=c: my favorite path
myapp.exe arg1 arg2 or <BR>
c= somehost
someshare some path someapp.exe arg1 arg2.
<P>
<DT><IMG WIDTH=14 HEIGHT=14 SRC="purpleball.gif" ALT="*">
e=env
<P>
a string of environment variables to set. Single quote this list and separate values
by the vertical bar character. Example: e='var1=val1|var2=val2|var3=val3'
<P>
<DT><IMG WIDTH=14 HEIGHT=14 SRC="purpleball.gif" ALT="*">
m=map
<P>
network drive mapping option in the form: 'drive: host share'.
Multiple mappings can be specified separated by semicolons.<BR>
eg. m=y: myhost myfiles;z: myhost myhome)
<P>
<DT><IMG WIDTH=14 HEIGHT=14 SRC="purpleball.gif" ALT="*">
d=dir
<P>
the working directory to launch the process in
<P>
<DT><IMG WIDTH=14 HEIGHT=14 SRC="purpleball.gif" ALT="*">
a=account p=password
<P>
the account and password used to set the security context for the launched process.
If the mpd is in single user mode, these parameters are not necessary and they are ignored.
<P>
<DT><IMG WIDTH=14 HEIGHT=14 SRC="purpleball.gif" ALT="*">
0=stdin 1=stdout 2=stderr 12=stdouterr 012=stdinouterr k=rank
<P>
these options specify where to connect the standard input, output, and error of the
launched process. The format is host:port. For example, 012=somehost:1234, would
connect to the host ``somehost'' on port 1234 three times to redirect standard input,
output and error. When connecting to this host, the mpd sends a five byte message
first. The first byte is a 0, 1, or a 2 to signify stdin, stdout or stderr. The next
4 bytes are the integer specified by the k=rank option. If no k option is specified
a value of zero is sent by default.
</DL></BLOCKQUOTE>
<BR>
Return values:
<P>
launchid
<P>
<dt>
<b>geterror launchid</b><dd>
<BR>
This command returns the current error message for the launch command corresponding
to the provided launchid. ERROR_SUCCESS signifies that the launch was successful.
If the launch command is still in progress, the return value is LAUNCH_PENDING.
If there is an error associated with the launch, the specific error message will be
returned.
<P>
Return values:
<P>
<tt>ERROR_SUCCESS</tt>, <tt>LAUNCH_PENDING</tt>, ``specific error message''
<P>
<dt>
<b>getpid launchid</b><dd>
<BR>
This command blocks until the process associated with launchid has been started.
If there was an error in the startup of the process, this command will return -1
and geterror can be used to get the specific error message.
<P>
Return values:
<P>
process id or -1
<P>
<dt>
<b>getexitcode launchid</b><dd>
<BR>
This command returns the exit code of the process associated with launchid. If the
process is still running, ACTIVE is returned. If there was a error launching the
process, FAIL will be returned and geterror can be called to retrieve the error message.
<P>
Return values:
<P>
exitcode, <tt>ACTIVE</tt>, <tt>FAIL</tt>
<P>
<dt>
<b>getexitcodewait launchid</b><dd>
<BR>
This command blocks until the process associated with launchid exits. If there is
an error and the process was not launched, FAIL will be returned and geterror can be
called to retrieve the error message.
<P>
Return values:
<P>
exitcode, <tt>FAIL</tt>
<P>
<dt>
<b>freeprocess launchid</b><dd>
<BR>
This command frees the local structures used to store the process id, exit code and
state. freeprocess should be called after there is no need to get any further
information about a process, usually after a successful call to one of the getexitcode
commands. After this command, the launchid becomes invalid and cannot be used in any
other calls.
<P>
Return values:
<P>
nothing
<P>
<dt>
<b>kill launchid</b><dd>
<BR>
This command kills the process associated with launchid. <tt>kill launchid</tt> will only
work if there is a valid process id in the local launchid structure. If the state is
LAUNCH_PENDING or an error has occurred, kill will not succeed. This is important
because if a launch command is issued and immediately followed by a kill command,
the kill will not succeed if the state of the process is LAUNCH_PENDING. To guarantee
that the process has started before trying to kill it you should call getpid first.
<P>
Return values:
<P>
nothing
<P>
<dt>
<b>kill host=x pid=x</b><dd>
<BR>
This command attempts to kill the process on host x associated with pid x. kill can
only kill processes launched by the mpd.
<P>
Return values:
<P>
nothing
<P>
<dt>
<b>killall</b><dd>
<BR>
This command attempts to kill all the processes launched by the mpd.
<P>
Return values:
<P>
nothing
<P>
<dt>
<b>ps</b><dd>
<BR>
This command returns a list of the active processes started by the mpd.
<P>
Return values:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -