Functions of the XPRD library
Topics covered in this chapter:
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.
Release a thread suspended by a call to XPRDwaitevent.
|
|
Drop the next event from the queue.
|
|
Release an XPRD context.
|
|
Retrieve the next event from the queue.
|
|
Create a new XPRD context.
|
|
Check whether the event queue is empty.
|
|
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.
Get the connection banner of a Mosel instance.
|
|
Compile a model source file.
|
|
Create a new Mosel instance.
|
|
Check whether a Mosel instance is still connected.
|
|
Release a Mosel instance.
|
|
Get the XPRD context associated to a Mosel instance.
|
|
Get the ID of a Mosel instance.
|
|
Set default input/output streams.
|
|
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.
Return the data pointer of a model.
|
|
Return the exit code of a model after its execution.
|
|
Get a reference to the Mosel instance on which a model is loaded.
|
|
Return the model number.
|
|
Return the ID of the model on the remote instance.
|
|
Return the current status of a model.
|
|
Load a Binary Model file onto the specified instance.
|
|
Reset a model.
|
|
Run a model.
|
|
Send an event to a running model.
|
|
Define the data pointer of a model.
|
|
Stop a running model.
|
|
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.
Close a file that was previously opened with XPRDfopen.
|
|
Flush buffer of an output stream.
|
|
Open a file on a remote instance.
|
|
Read a block of data from a remote file.
|
|
Skip a block of data from a remote file.
|
|
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.
Set the message callback.
|
|
Change the verbosity level of the library.
|
|
Shut down the connection manager.
|
|
Start the connection manager.
|
Miscellaneous
Search xprmsrv servers on the local network.
|
|
Get configuration settings for
XPRDfindxsrvs.
|
|
Get KeepAlive settings.
|
|
Get the command used for SSH connections.
|
|
Set configuration settings for
XPRDfindxsrvs.
|
|
Set KeepAlive settings.
|
|
Set the command to use for SSH connections.
|
© 2001-2023 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.