1*4b9ad928SBarry Smith 2*4b9ad928SBarry Smith This directory src/contrib/spai contains code to interface 3*4b9ad928SBarry SmithPETSc to the Sparse Approximate Inverse Preconditioner (SPAI) 4*4b9ad928SBarry Smithimplemented by Steven Bernard and available at 5*4b9ad928SBarry Smith 6*4b9ad928SBarry Smith http://www.sam.math.ethz.ch/~grote/spai/ 7*4b9ad928SBarry Smith 8*4b9ad928SBarry Smith To use this, you must first get and install the SPAI package. 9*4b9ad928SBarry SmithUnfortunately, SPAI does not come ready to compile into a library 10*4b9ad928SBarry Smithand is not portable to most Unix machines; though it does say it 11*4b9ad928SBarry Smithcompiles on both the IBM SP and Cray T3D, you may have to hack it 12*4b9ad928SBarry Smithslightly for other machines. 13*4b9ad928SBarry Smith 14*4b9ad928SBarry Smith Once you have created the spai_3.0 directory from the tar file. 15*4b9ad928SBarry Smith 16*4b9ad928SBarry Smith 1) Compile all the .o files in the spai_3.0 directory. You will 17*4b9ad928SBarry Smith probably have to edit the Makefile and then run make spai 18*4b9ad928SBarry Smith 2) Create a library with the command 19*4b9ad928SBarry Smith ar cr libspai.a *.o 20*4b9ad928SBarry Smith 3) On machines that require it, run ranlib on the library 21*4b9ad928SBarry Smith ranlib libspai.a 22*4b9ad928SBarry Smith 4) Edit the PETSc file bmake/$PETSC_ARCH/base.site and indicate 23*4b9ad928SBarry Smith the location of the SPAI directory 24*4b9ad928SBarry Smith 5) Cd to src/contrib/pc/spai/src and do make BOPT=g and make BOPT=O 25*4b9ad928SBarry Smith 7) You are now ready to run an example, cd to src/contrib/pc/spai/examples/ 26*4b9ad928SBarry Smith tutorials and make ex1 in the usual PETSc way. You can run it 27*4b9ad928SBarry Smith using any of the test matrices in src/mat/examples/matrices 28*4b9ad928SBarry Smith 29*4b9ad928SBarry Smith If you have problems compiling SPAI please contact Steven Bernard 30*4b9ad928SBarry Smithdirectly. If you have problems linking PETSc with SPAI or running the 31*4b9ad928SBarry Smithexamples then after checking the docs/troubleshooting.html and 32*4b9ad928SBarry Smithdocs/bugreporting.html file contact petsc-maint@mcs.anl.gov 33*4b9ad928SBarry Smith 34*4b9ad928SBarry Smith This contribution has not been extensively tested or optimized for 35*4b9ad928SBarry Smithperformance yet. 36