Index: /trunk/anuga_core/source/anuga/__init__.py
===================================================================
--- /trunk/anuga_core/source/anuga/__init__.py	(revision 9544)
+++ /trunk/anuga_core/source/anuga/__init__.py	(revision 9545)
@@ -20,6 +20,6 @@
 
 #Add path of package to PYTHONPATH to allow C-extensions to be loaded
-import sys
-sys.path += __path__
+#import sys
+#sys.path += __path__
 
 
@@ -28,4 +28,6 @@
 #-----------------------------------------------------
 
+from numpy.testing import Tester
+test = Tester().test
 
 from anuga.__metadata__ import __version__, __date__, __author__
Index: unk/anuga_core/source/anuga/parallel/README
===================================================================
--- /trunk/anuga_core/source/anuga/parallel/README	(revision 9544)
+++ 	(revision )
@@ -1,3 +1,0 @@
-
-Read http://anuga.anu.edu.au/wiki/AnugaParallel
-
Index: /trunk/anuga_core/source/anuga/parallel/setup.py
===================================================================
--- /trunk/anuga_core/source/anuga/parallel/setup.py	(revision 9544)
+++ /trunk/anuga_core/source/anuga/parallel/setup.py	(revision 9545)
@@ -3,106 +3,33 @@
 import os
 import sys
+import commands
+import shlex
+import string
 
 from os.path import join
 
 #=================================================
-# Code taken from pypar
-#=================================================
-
-
-import string
-import tempfile
-import shlex
-
-def uniq_arr(arr):
-    """Remove repeated values from an array and return new array."""
-    ret = []
-    for i in arr:
-        if i not in ret:
-            ret.append(i)
-    return ret
-
-def _run_command(cmd):
-    import subprocess
-
-    #print('running ' + cmd)
-    try:
-        #FIXME SR: The following only works for python 2.7!
-        #output = subprocess.check_output(cmd, shell=True)
-        #FIXME SR: This works for python 2.6
-        output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
-
-    except:
-        output = ''
-
-    return output
+# Code taken from pysph
+#=================================================    
     
-
-def _get_mpi_cmd():
+def getoutput_mpicc():
     """Returns the output of the command used to compile using
     mpicc."""
     # LAM/OPENMPI/MPICH2
-    output = _run_command('mpicc -show') + ' -fPIC'
+    output = commands.getoutput('mpicc -show') + ' -fPIC'
 
     if output:
         return output
 
-    # FIXME: If appears that MPICH actually needs these hacks.
-
     # MPICH
     # works with MPICH version 1.2.1 (on Debian)
-    output = _run_command('mpicc -compile_info -link_info')
+    output = commands.getoutput('mpicc -compile_info -link_info')
     if output:
         return output
 
-    # Old version of MPICH needs this hack.
-    tmp_base = tempfile.mktemp()
-    tmp_c = tmp_base + ".c"
-    tmp_o = tmp_base + ".o"
-    tmp_file = open(tmp_c, "w")
-    tmp_file.write('#include "mpi.h"\nint main(){return 0;}\n')
-    tmp_file.close()
-    output = _run_command("mpicc -show;"\
-                          "mpicc -echo -c %s -o %s"%(tmp_c, tmp_o))
-    os.remove(tmp_c)
-    if os.path.exists(tmp_o):
-        os.remove(tmp_o)
-    if output:
-        return output
-    else:
-        return ''
-
-
-def get_mpi_flags():
-    output = _get_mpi_cmd()
-    print(output)
-    if not output:
-        if sys.platform=='win32': # From Simon Frost
-            #this didn't work on my machine (Vladimir Lazunin on April 7, 2009)
-            #output = "gcc -L$MPICH_DIR\SDK.gcc\lib -lmpich -I$MPICH_DIR\SDK.gcc\include"
-
-            #"MPICH_DIR" must be set manually in environment variables
-            mpi_dir = os.getenv("MPICH_DIR")
-            if mpi_dir == None:
-                print('MPICH_DIR environment variable must be set')
-                exit()
-
-            #for MPICH2
-            sdk_prefix = mpi_dir
-            lib_name = 'mpi'
-
-            #for MPICH1
-            if os.path.exists(sdk_prefix + '\\SDK'):
-                sdk_prefix += '\\SDK'
-                lib_name = 'mpich'
-            output = 'gcc -L"%(sdk_prefix)s\lib" -l"%(lib_name)s" -I"%(sdk_prefix)s\include"' % {'sdk_prefix' : sdk_prefix, 'lib_name' : lib_name}
-        else:
-            output = 'cc -L/usr/opt/mpi -lmpi -lelan'
-
-
-    # Now get the include, library dirs and the libs to link with.
-    #flags = string.split(output)
+def parse_command(output):
+    # Now get the include, library dirs and the libs to link.
     flags = shlex.split(output)
-    flags = uniq_arr(flags) # Remove repeated values.
+    #flags = uniq_arr(flags) # Remove repeated values.
     inc_dirs = []
     lib_dirs = []
@@ -130,4 +57,5 @@
 
 
+
 def configuration(parent_package='',top_path=None):
     
@@ -135,7 +63,7 @@
     from numpy.distutils.system_info import get_info
     
-    mpi_flags = get_mpi_flags()
+    mpi_flags = parse_command(getoutput_mpicc())
     
-    print(mpi_flags)
+    #print(mpi_flags)
     
     config = Configuration('parallel', parent_package, top_path)
