Changeset 4270


Ignore:
Timestamp:
Feb 19, 2007, 2:25:18 PM (17 years ago)
Author:
nick
Message:

small change to screen_catcher and added cases for true and false to caching

Location:
anuga_core/source/anuga
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/util.py

    r4248 r4270  
    502502##################### end of obsolete stuff ? ############
    503503
    504 def start_screen_catcher(dir_name, myid=0, numprocs=1):
     504def start_screen_catcher(dir_name, myid=0, numprocs=1, print_to_screen=False,
     505                          verbose=False):
    505506    """Used to store screen output and errors to file, if run on multiple
    506507    processes eachprocessor will have its own output and error file.
     
    509510    dir_name = dir_name
    510511    if access(dir_name,W_OK) == 0:
    511         print 'Make directory %s' %dir_name
     512        if verbose: print 'Make directory %s' %dir_name
     513        if verbose: print "myid", myid
    512514        mkdir (dir_name,0777)
    513515    screen_output_name = dir_name + "screen_output_%d_%d.txt" %(myid,numprocs)
    514516    screen_error_name = dir_name + "screen_error_%d_%d.txt" %(myid,numprocs)
    515    
     517    print screen_output_name
    516518    #used to catch screen output to file
    517519    sys.stdout = Screen_Catcher(screen_output_name)
     
    533535        fid = open(self.filename, 'a')
    534536        fid.write(stuff)
     537#        if print_to_screen: print stuff
    535538
    536539def get_revision_number():
  • anuga_core/source/anuga/caching/caching.py

    r4198 r4270  
    13231323  import types
    13241324
    1325   # On some architectures None gets different hash values
     1325  # On some architectures None, False and True gets different hash values
    13261326  if T is None:
     1327    return(-1)
     1328  if T is False:
     1329    return(0)
     1330  if T is True:
    13271331    return(1)
    13281332
Note: See TracChangeset for help on using the changeset viewer.