Biosym/MSI IPC
Fortran Application Program InterfaceBiosym/MSI IPC allows INTEGER, REAL*8, and CHARACTER data to be exchanged. All data exchanges are done via IPC Frames, which consist of a header describing the data which follow.
The routines to write data out (usually to Discover) consist of single function calls. The arguments to the functions describe the data to be sent.
The routines to read data consist of two calls. The first call is always ``BiosymIpc_ReadHeaderf'', which returns information about the data that will follow. The program uses this information to make the appropriate follow-up call that puts the transfered data into a local array.
The few remaining calls perform tasks such as initializing the connection, closing the connection, and determining version information.
Many read and write functions contain numItem and numElement arguments. These arguments are merely descriptive of how the data is organized. For example, coordinates are a common thing to exchange. The Discover program will send coordinates as collections of (x,y,z) with numElement == 3 and numItems == the number of points to be transferred.
To use these routines you need to compile the file ipcf.f (FORTRAN) and the file ipc.c (C). Both resulting objects (ipcf.o and ipc.o) must be linked with your program. Note that ipc.c requires the file ipc.h, and ipcf.f requires the file ipcf.inc.
Parallel Note:
On shared-memory parallel machines, use of these functions must be single-threaded and locked to one node, due to static data structures.
SUBROUTINE BiosymIpc_Initf()
Initialize an IPC connection. There is no input or output to the
routine. The environmental variables BiosymIpcIn and BiosymIpcOut are
set up by the Discover program before the client program is
executed; these are used to establish the connection.
SUBROUTINE BiosymIpc_ReadHeaderf(type,
& numItem,
& numElement,
& numByte,
& message,
& messageMax,
& messageLen,
& endOfFile,
& status)
Read an IPC frame header. Input:
SUBROUTINE BiosymIpc_ReadString128f(string,
& iString,
& iiString,
& status)
Read an IPC string frame into an array of character*128 variables. Input:
SUBROUTINE BiosymIpc_WriteIntegerf(data,
& numItem,
& numElement,
& message,
& messageLen,
& flush,
& status)
Write an IPC frame of integers. Input:
SUBROUTINE BiosymIpc_WriteReal8f(data,
& numItem,
& numElement,
& message,
& messageLen,
& flush,
& status)
Write an IPC frame of real*8 values. Input:
SUBROUTINE BiosymIpc_WriteStringf(data,
& numItem,
& numElement,
& message,
& messageLen,
& flush,
& status)
Write an IPC frame of arbitrary-length strings. Input:
SUBROUTINE BiosymIpc_WriteString128f(string,
& lenString,
& iString,
& numItem,
& numElement,
& message,
& messageLen,
& flush,
& status)
Write a series of char*128 variables in strings with lengths given in
the corresponding lenString. Input:
SUBROUTINE BiosymIpc_WriteBtcl128f(command,
& nCommand,
& noNewline,
& iString,
& flush,
& status)
Write a series of char*128 variables in command. The strings will
be interpreted by Discover as a series of BTCL commands to be
executed. Discover concatenates all the strings into a single
string and evaluates this. Discover must be waiting in an evaluation loop, collecting IPC frames, and evaluating the contents. See the Discover IPC documentation for how to do this in a Discover script.
Input:
SUBROUTINE BiosymIpc_WriteRawBtcl128f(command,
& nCommand,
& noNewline,
& iString,
& flush,
& status)
Write an array of character*128 variables which should contain BTCL
code. The write is done without an IPC frame header.
Discover must be waiting in an evaluation loop, collecting
lines, and evaluating them as they form complete commands. See the Discover IPC documentation for
how to do this in a Discover script. The strings are concatenated into one large string for writing as indicated by the noNewline flag.
Input:
SUBROUTINE BiosymIpc_GetErrorf(err, maxChar)
Return the last BiosymIpc error message. Input:
SUBROUTINE BiosymIpc_GetLocalVersionf(ver, maxChar)
Return the version string for the BiosymIpc code being used in this
program. Input:
SUBROUTINE BiosymIpc_GetRemoteVersionf(ver, maxChar)
Return the version string for the BiosymIpc code being used by the
remote program. Input:
SUBROUTINE BiosymIpc_Int2Charf(c, ia, n, l)
Utility to convert a string from a zero-terminated array of integers
into a character variable. Input:
SUBROUTINE BiosymIpc_Char2Intf(ia, c, n)
Utility to convert a character variable into a zero-terminated array
of integers. Input:
SUBROUTINE BiosymIpc_ReadIntegerf(data,
& status)
Read an IPC integer frame into an array of integers. Output:
SUBROUTINE BiosymIpc_ReadReal8f(data,
& status)
Read an IPC 8-byte real frame into an array of 8-byte reals. Output:
SUBROUTINE BiosymIpc_ReadStringf(data,
& status)
Read an IPC string frame into an array of integers representing
the strings. Use BiosymIpc_Int2Charf to convert to Fortran character
variables. Output:
Main
access page
Advanced-Use access. Copyright Biosym/MSI