# $Id: README,v 1.5 2007/07/16 19:52:15 yarkhan Exp $

These directory provides an example using a Microsoft Compute Cluster
machine as a batch execution environment for a GridSolve server
(running under Cygwin).

You will need Cygwin installed on the compile node and on the node on
which you run the GridSolve server.  The node running the GridSolve
server also needs to be able to submit jobs to the cluster.  In our
testing setup, the GridSolve server is run on the compile node.  In
this batch submit environment, the GridSolve server does not require
any substantial CPU time, so it should be acceptible to run it on the
compile node.

* Compilation 

  * On a compile node of the cluster, build the GridSolve distribution
    under Cygwin (this is tested using gcc and g77).  It is best if
    this can be done on a disk location which will be visable to the
    compute nodes.  

    configure 
    make

  * Edit the scripts gs_mscc_submit, gs_mscc_probe and gs_mscc_cancel

    * In gs_mscc_submit, you will have to correct the name of the job
      scheduler for your site.

    * In gs_mscc_submit you will have to specify the location of
      cygwin1.dll visable from the compute node.  Usually it can be
      copied from the default location (/cygdrive/C/cygwin/bin/cygwin1.dll
       or C:\cygwin\bin\cygwin1.dll) to ./examples/microsoft_compute_cluster.

    * In gs_mscc_probe and gs_mscc_cancel you will have to correct the
      name of the job scheduler on your site.

  * Build services for the compute cluster
    e.g. src/problem/GS_problem_compile ../examples/microsoft_compute_cluster/totaltest.idl

  * Make sure that the build is on a disk space that can be seen from
    the compute nodes.  If the distribution needs to be moved from its
    build location, you may need to set the GRIDSOLVE_ROOT environment
    variable to point to that location.  The compute nodes need to be
    able to find the built services and the input data files.


* Running the server

  * The server needs to run on a machine that has Cygwin installed,
    and that can submit jobs to the cluster.  In our MSCC
    installation, that is the compile node for the cluster.

  * Start the server
    export GRIDSOLVE_AGENT myagent.subdomain.domain
    src/server/GS_server

  * Check the server log (gs_server.log) to make sure it seems OK.

  * Try a test of the services that were compiled earlier
    src/testing/gridrpc/totaltest.exe
    You should see the service output on the command line.

  * The GridSolve server expects to be able to run a job on the
    compute cluster without having to interact for a password.  The
    first time a job is run on the server (and when the password
    changes), you may need to run some other one line test job
    manually and have the cluster cache the password.
    e.g. job submit /scheduler:ms-hn hostname


* Other notes

  * Currently, the GridSolve agent does not make intelligent
    scheduling decisions for sending a service to the cluster.  This
    will be improved in future releases.

  * You can enable BLAS services.  These are setup to use the subset
    of BLAS that is distributed with GridSolve, so the BLAS library
    should be compiled and ready to use.  If you want to use a
    different BLAS library, change the settings in the blas.idl file.

    e.g. src/problem/GS_problem_compile ../examples/microsoft_compute_cluster/blas.idl

    There are some tests of the BLAS services in src/testing/gridrpc/dgemm_test 

  * A simple mandelbrot example can be compiled and used.  The
    mandlebrot routine is precompiled in GridSolve.  To enable the
    service, try something like

    e.g. src/problem/GS_problem_compile ../examples/microsoft_compute_cluster/mandelbrot.idl 
   
    Then from a machine that has the GridSolve Matlab client enabled,
    you can run the demo in src/testing/matlab/mandelbrot.  

    Start Matlab in src/testing/matlab.  Use the gs_setup script to
    point to the GridSolve Matlab client library and setup the
    GridSolve agent. Change directory to mandelbrot.  Run the
    mandelbrot_gui script.  This should start and GUI with an
    interactive matlab figure.  You can select regions in the figure,
    and then click on redraw to have GridSolve recalculate that
    region.

  * The SuperLU service allows for solving sparse systems using the
    sequential SuperLU_3.0 library.

    e.g. src/problem/GS_problem_compile ../examples/microsoft_compute_cluster/superlu.idl

  * The LAPACK linear algebra service (dgesv, dgeev)

    e.g. src/problem/GS_problem_compile ../examples/microsoft_compute_cluster/lapack_subset.idl
