Changeset 3008


Ignore:
Timestamp:
May 29, 2006, 2:09:54 PM (18 years ago)
Author:
ole
Message:

Allowed parallel version to run sequentially

Location:
development/stochastic_study
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • development/stochastic_study/project.py

    r3006 r3008  
    33
    44# Working dir
    5 working_dir = '/mnt/store/stochastic/'
     5working_dir = '/mnt/store/stochastic3/'
    66import os
    77try:
     
    2727
    2828# Stats (Suresh ?)
    29 number_of_realisations = 8000
     29number_of_realisations = 1000
     30#number_of_realisations = 16000
     31
    3032#std_dev = 0.0026  #Range is 26.035 cm
    31 #std_dev = 0.0013  #Range is 26.035 cm
    32 std_dev = 0.0006  #Range is 26.035 cm
     33std_dev = 0.0013  #Range is 26.035 cm
     34#std_dev = 0.0006  #Range is 26.035 cm
    3335mean = 0.0
    3436blocksize = 10 #How many realisations to fit at a time
  • development/stochastic_study/run_model.py

    r2989 r3008  
    3232from pyvolution.util import file_function
    3333from caching.caching import cache
    34 import pypar
    3534
    3635# Application specific imports
     
    4241#-----------------------------------------------------------------------------
    4342
    44 myid = pypar.rank()
    45 numprocs = pypar.size()
    46 processor_name = pypar.Get_processor_name()
     43try:
     44    import pypar
     45except:
     46    print 'Could not import pypar'
     47    myid = 0
     48    numprocs = 1
     49    processor_name = 'nautilus'
     50else:   
     51    myid = pypar.rank()
     52    numprocs = pypar.size()
     53    processor_name = pypar.Get_processor_name()
    4754
    4855print 'I am process %d of %d running on %s' %(myid, numprocs, processor_name)
     
    9198
    9299
    93 realisation = 0
     100realisation = 100
    94101for filename in os.listdir(project.working_dir):
    95102    if filename.startswith(project.basename) and filename.endswith('.pck'):
    96         #print 'P%d: Reading %s' %(myid, filename)
    97         fid = open(filename)
     103        print 'P%d: Reading %s' %(myid, filename)
     104        fid = open(project.working_dir + filename)
    98105        V = cPickle.load(fid)
    99106        fid.close()
     
    110117                name = project.basename + '_P%d' %myid   
    111118                domain.set_name(name)                     #Output name
     119                print 'V', V.shape
    112120                domain.set_quantity('elevation', V[:,i])  #Assign bathymetry
    113121
Note: See TracChangeset for help on using the changeset viewer.