Initializing help system before first use

Functions of the XPRD library

Contexts and event handling

Each Mosel instance is attached to an XPRD context. This structure is also used to handle the queue of events received from the models run on the associated Mosel instances.

XPRDabortwait
Release a thread suspended by a call to XPRDwaitevent.
XPRDdropevent
Drop the next event from the queue.
XPRDfinish
Release an XPRD context.
XPRDgetevent
Retrieve the next event from the queue.
XPRDinit
Create a new XPRD context.
XPRDqueueempty
Check whether the event queue is empty.
XPRDwaitevent
Suspend the execution of the calling thread until an event is available.

Mosel instances management

The XPRDconnect function starts a Mosel instance and returns a XPRDmosel object. The method used to create this instance depends on a connection string that is interpreted in a similar way as with the connect function of the mmjobs Mosel module: three I/O drivers can be used to launch a Mosel instance. The first one, "rcmd:", executes a command in a separate process—typically this will be directly mosel or a special command to start Mosel on a remote host (e.g. the command ssh). The second driver, "xsrv:", requires the xprmsrv Mosel remote launcher to run on the target machine: the connection is established with such a server through a TCP link. The last driver, "xssh:", is similar to the previous one but establishes the connection to the server through a secure SSH tunnel. The handling of the tunnel is achieved by a separate process: by default, the xprmsrv program is used but optionally another SSH client may be selected using XPRDsetsshcmd.

XPRDbanner
Get the connection banner of a Mosel instance.
XPRDcompmod, XPRDcompmodsec
Compile a model source file.
XPRDconnect
Create a new Mosel instance.
XPRDconnected
Check whether a Mosel instance is still connected.
XPRDdisconnect
Release a Mosel instance.
XPRDgetxprd
Get the XPRD context associated to a Mosel instance.
XPRDinstid
Get the ID of a Mosel instance.
XPRDsetdefstream
Set default input/output streams.
XPRDsysinfo
Get system information about the host running a Mosel instance.

Model management

A model object is created by loading a bim file onto a Mosel instance with a call to XPRDloadmod. Once a model has been loaded, it can be run (XPRDrunmod), send events (XPRDsendevent) and possibly be interrupted before its normal termination (XPRDstoprunmod). Additional functions provide information about the last execution. Models must be unloaded using XPRDunloadmod in order to release the resources they use both on the local host and the remote instance.

XPRDgetdata
Return the data pointer of a model.
XPRDgetexitcode
Return the exit code of a model after its execution.
XPRDgetmosel
Get a reference to the Mosel instance on which a model is loaded.
XPRDgetnumber
Return the model number.
XPRDgetrmtid
Return the ID of the model on the remote instance.
XPRDgetstatus
Return the current status of a model.
XPRDloadmod, XPRDloadmodsec
Load a Binary Model file onto the specified instance.
XPRDresetmod
Reset a model.
XPRDrunmod
Run a model.
XPRDsendevent
Send an event to a running model.
XPRDsetdata
Define the data pointer of a model.
XPRDstoprunmod
Stop a running model.
XPRDunloadmod
Unload a model.

Remote file access

These basic file operation routines allow an application to open a file for reading or writing on a remote host through a connected Mosel instance.

XPRDfclose
Close a file that was previously opened with XPRDfopen.
XPRDfflush
Flush buffer of an output stream.
XPRDfopen
Open a file on a remote instance.
XPRDfread
Read a block of data from a remote file.
XPRDfskip
Skip a block of data from a remote file.
XPRDfwrite
Write a block of data to a remote file.

Connection manager

As soon as the first connection is established the connection manager is started and it is shut down when all connections have been closed. This manager consists in a background thread handling the communication protocol required by the Mosel Distributed Framework. The functions of this section can be used to control this manager: start and stop independently of active connections as well as handling of messages.

XPRDsetmsgcb
Set the message callback.
XPRDsetmsglev
Change the verbosity level of the library.
XPRDshutdown
Shut down the connection manager.
XPRDstart
Start the connection manager.

Miscellaneous

XPRDfindxsrvs
Search xprmsrv servers on the local network.
XPRDgetfsrvopt
Get configuration settings for XPRDfindxsrvs.
XPRDgetkeepalive
Get KeepAlive settings.
XPRDgetsshcmd
Get the command used for SSH connections.
XPRDsetfsrvopt
Set configuration settings for XPRDfindxsrvs.
XPRDsetkeepalive
Set KeepAlive settings.
XPRDsetsshcmd
Set the command to use for SSH connections.