Changeset 9301


Ignore:
Timestamp:
Aug 13, 2014, 5:38:21 PM (11 years ago)
Author:
steve
Message:

Testing if pypar_available before importing sequenential_distribute code

Location:
trunk/anuga_core
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/compile_all.py

    r9290 r9301  
    2929#--------------------------------------------------
    3030# Compiling anuga_1d code
     31# excluded for the time being
    3132#--------------------------------------------------
    32 os.chdir('source')
    33 os.chdir('anuga_1d')
     33#os.chdir('anuga_1d')
    3434
    3535
    36 t0 = time.time()
     36#t0 = time.time()
    3737
    3838# Attempt to compile all ANUGA_1D extensions
    39 execfile('compile_all.py')
     39#execfile('compile_all.py')
    4040
    4141
     
    5252    print '-----------------------------------------------'
    5353
    54 
     54    import pypar
    5555
    5656    # Attempt to compile Metis for use with anuga_parallel
     
    8585       
    8686except:
    87     print 'pymetis could not compile'
     87    print 'pymetis could not compile as pypar not installed'
    8888
    8989
     
    9292
    9393#--------------------------------------------------
    94 # Compiling anuga_parallel code
     94# Compiling pypar_extras
    9595#--------------------------------------------------
    9696
     
    117117        raise Exception, msg
    118118    else:
    119         msg = 'Compiled pypar_extras succesfully.'
     119        msg = 'Compiled pypar_extras successfully.'
    120120        print msg
    121121except:
  • trunk/anuga_core/source/anuga/__init__.py

    r9294 r9301  
    8787from anuga_parallel.parallel_api import send, receive
    8888from anuga_parallel.parallel_api import pypar_available, barrier, finalize
    89 from anuga_parallel.parallel_api import sequential_distribute_dump
    90 from anuga_parallel.parallel_api import sequential_distribute_load
     89
     90if pypar_available:
     91    from anuga_parallel.parallel_api import sequential_distribute_dump
     92    from anuga_parallel.parallel_api import sequential_distribute_load
    9193
    9294
  • trunk/anuga_core/source/anuga/utilities/parallel_abstraction.py

    r9261 r9301  
    6565    from pypar import *
    6666    sys.stdout = sys.__stdout__
    67     pypar_available = True    
     67    pypar_available = True
  • trunk/anuga_core/source/anuga_parallel/parallel_api.py

    r9294 r9301  
    1111from anuga.utilities.parallel_abstraction import pypar_available, barrier
    1212
    13 from anuga_parallel.sequential_distribute import sequential_distribute_dump
    14 from anuga_parallel.sequential_distribute import sequential_distribute_load
    15 
    1613
    1714
    1815# ANUGA parallel engine (only load if pypar can)
    1916if pypar_available:
     17    from anuga_parallel.sequential_distribute import sequential_distribute_dump
     18    from anuga_parallel.sequential_distribute import sequential_distribute_load
     19   
    2020    from anuga_parallel.distribute_mesh  import send_submesh
    2121    from anuga_parallel.distribute_mesh  import rec_submesh
  • trunk/anuga_core/test_all.py

    r9241 r9301  
    1616
    1717
    18 os.chdir(buildroot)
    19 os.chdir('source')
    20 os.chdir('anuga_1d')
    21 print
    22 print '======================= anuga_1d tests ================================='   
    23 print 'Changing to', os.getcwd() # This is now different from buildroot   
    24 execfile('test_all.py')
     18#os.chdir(buildroot)
     19#os.chdir('source')
     20#os.chdir('anuga_1d')
     21#print
     22#print '======================= anuga_1d tests ================================='   
     23#print 'Changing to', os.getcwd() # This is now different from buildroot   
     24#xecfile('test_all.py')
    2525
    2626
    2727
    2828# Try to run parallel tests if pypar is installed
    29 
    30 try:
    31     import pypar
    32 except:
    33     print 'anuga_parallel tests not run as pypar not installed'
    34 else:
     29from anuga import pypar_available
     30   
     31if pypar_available:
    3532    os.chdir(buildroot)
    3633    os.chdir('source')
     
    4037    print 'Changing to', os.getcwd()
    4138    execfile('test_all.py')
     39else:
     40    print 'anuga_parallel tests not run as pypar not installed'
    4241
    4342
Note: See TracChangeset for help on using the changeset viewer.