~ubuntu-branches/ubuntu/maverick/dolfin/maverick

« back to all changes in this revision

Viewing changes to test/system/parallel-assembly-solve/test.py

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2009-10-12 14:13:18 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091012141318-hkbxl0sq555vqv7d
Tags: 0.9.4-1
* New upstream release. This version cleans up the design of the
  function class by adding a new abstraction for user-defined
  functions called Expression. A number of minor bugfixes and
  improvements have also been made.
* debian/watch: Update for new flat directory structure.
* Update debian/copyright.
* debian/rules: Use explicit paths to PETSc 3.0.0 and SLEPc 3.0.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"Run solver.py in parallel"
 
2
 
 
3
__author__ = "Anders Logg (logg@simula.no)"
 
4
__date__ = "2009-08-17 -- 2009-09-21"
 
5
__copyright__ = "Copyright (C) 2009 Anders Logg"
 
6
__license__  = "GNU LGPL version 2.1"
 
7
 
 
8
# Modified by Johan Hake
 
9
 
 
10
import sys
 
11
from dolfin_utils.commands import getoutput
 
12
from dolfin import has_mpi, has_parmetis
 
13
 
 
14
if not (has_mpi() and has_parmetis()):
 
15
    print "DOLFIN has not been compiled with mpi and Parmetis. Test is not run."
 
16
    sys.exit(0)
 
17
 
 
18
# If it works on nine processes, it works for any number of processes (N. Jansson, 2009)
 
19
num_processes = 9 # Should really be 9 here, but it breaks
 
20
 
 
21
# Run solver.py
 
22
output = getoutput("mpirun -n %d python solver.py" % num_processes)
 
23
if len(sys.argv) > 1 and sys.argv[1] == "--debug":
 
24
    print output
 
25
 
 
26
# Return exit status
 
27
if "ERROR" in output:
 
28
    sys.exit(1)
 
29
else:
 
30
    print "OK"
 
31
    sys.exit(0)