12-759 Computational Optimization of Systems Governed by Partial Differential Equations

Carnegie Mellon University - Fall 2003
Professor Omar Ghattas

12-759 | setup | sundance | tutorial

Tutorial

Below is a short procedure to test if your setup is ok to use Sundance.

Checking your account status

The following tutorial will show you how to test if your account set up is ok by building an executable code in your working directory. It will present the steps from how to login to a linux machine in the Andrew cell to the execution of a compiled code and plotting of the results. You will find here typical steps you will be using to get your own code running.

You will only be able to complete this task if you have already established a CS ID and set the Sundance and Trilinos environment variables correctly (refer to the setup and sundance pages for that).

  1. telnet (or ssh) to a linux machine in Andrew:

    %> telnet linux.andrew.cmu.edu

  2. authenticate to the CS cell:

    %> aklog cs.cmu.edu

  3. verify that you have been authenticated (if not, try again):

    %> klist

  4. go to your working directory (let's say you are moby):

    %> cd /afs/cs/project/taos-15/home/moby

  5. copy the Makefile to your working directory:

    %> cp ../../src/Makefile .

  6. check that you did copy the Makefile by listing your directory contents (if not there, try again):

    %> ls

  7. copy the file heat1D.cpp from the examples directory to your working directory:

    %> cp ../../src/Sundance/examples/Tests/heat1D.cpp .

  8. check that the file has been copied:

    %> ls

  9. you should be ready now to build the executable heat1D.e:

    %> make heat1D.e

  10. if everything goes fine, run the compiled and liked code:

    %> ./heat1D.e

    you should have an output of the executable in your shell similar to the one saw in class.

  11. executing heat1D.e will create the file heat1D.dat, the results of the problem, in your working directory; you can use Matlab to plot the results. But first you need to copy the plot1D.m file to your working directory:

    %> cp ../../src/Sundance/examples/plot1D.m .

    and since you are here, proceed the same way and copy the other two plotting function files plot2D.m and plot3D.m - you will likely need them later.

  12. launch Matlab in the desktop mode and plot the results (note: matlab -help is your friend):

    %> matlab -nodesktop

    and once you are in Matlab

    >> plot1D heat1D.dat

    you should obtain a plot similar to the one shown below:

If you get to this point and obtain a plot, you are ready to start building your own executables.

Send comments and questions about this page to Alexandre Cunha