This file directory contains the example discussed in class on 2/18/99 (slightly extended). We first discussed matrix0.cpp, a matrix-vector product computation done in ordinary sequential computation, with no use of CORBA or any other kind of distributed components. However, some design choices were made with the goal of ultimately using some of its code and generic programming techniques in a distributed version. (As mentioned in class, these programs are only intended as simple exercises aimed at exploring ideas about combining generic programming techniques with distributed computing. For a serious effort at providing distributed components for linear algebra one should start with close examination of efforts such as the PETSc library, which does distributed computation but doesn't employ generic programming, or the Matrix Template Library (MTL), which makes extensive use of generic programming but doesn't (yet) do distributed computation.)
We then discussed a crude distributed version, with
block_product
function, which is a function that
is able to use a designated range of rows of a matrix m
and a column
vector c
and produce the corresponding range of elements of the column
vector r
that is the matrix-vector product of m
and c
.
This server writes the stringified object reference of the matrix
to a file whose name is given by a command line argument.
One should start two copies of the server, each with a different
file, like this:
server matrix1.ior server matrix2.ior
block_product
functions. The call of the first server's block_product
function computes the top half of a matrix-vector product
and the call on the second server does the second
half. (In this program these calls are not done in
parallel. Experimenting with that is one of the next steps.)
Assuming the above commands for starting the two servers,
one should start the client like this:
client matrix1.ior matrix2.iorThis assumes these files exist on the client's file system. If that file system is not shared with that of the servers, you must copy them manually to the client's file system. Another further step in developing this example is to avoid having to pass object references via files, by using the CORBA Naming Service.
server1.log
, server2.log
, and client.log
files for the results of this scheme.
Try out this example yourself; experiment with running it as it is, then extend it! We will discuss some extensions in class, but that will be a lot more meaningful if you have already gotten thoroughly familiar with this basic version.
To compile and link the client and server, copy the zip file to a directory you own and unzip it. If you are using Mico on a Windows platform with VC++, do
nmake/f Makefile.win32 allIf you are using Mico on a Unix platform (monica or yoyo), do
gmake allUnfortunately, linking with the Mico library on Unix is still taking a lot longer than it should.