next up previous contents Back to SYMPHONY Home Page
Next: Working with PVM Up: Introduction Previous: User-defined Data Structures

   
Inter-process Communication for Distributed Computing

While the implementation of SYMPHONY strives to shield the user from having to know anything about communications protocols or the specifics of inter-process communication, it may be necessary for the user to pass information from one module to another in some cases--for instance, if the user must pass problem-specific data to the LP process after reading them in from a data file. In cases where this might be appropriate, user functions are supplied in pairs--a send function and a receive function. All data are sent in the form of arrays of either type char, int, or double, or as strings. To send an array, the user has simply to invoke the function send_?_array(? *array, int length) where ? is one of the previously listed types. To receive that array, there is a corresponding function called receive_?_array(? *array, int length). When receiving an array, the user must first allocate the appropriate amount of memory. In cases where variable length arrays need to be passed, the user must first pass the length of the array (as a separate array of length one) and then the array itself. In the receive function, this allows the length to be received first so that the proper amount of space can be allocated before receiving the array itself. Note that data must be received in exactly the same order as it was passed, as data is read linearly into and out of the message buffer. The easiest way to ensure this is done properly is to simply copy the send statements into the receive function and change the function names. It may then be necessary to add some allocation statements in between the receive function calls.


next up previous contents
Next: Working with PVM Up: Introduction Previous: User-defined Data Structures
Ted Ralphs
2000-09-08