Changeset 9140


Ignore:
Timestamp:
Jun 8, 2014, 10:36:14 PM (10 years ago)
Author:
steve
Message:

Setup logging so that log.critical writes to file ifmyod != 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/validation_tests/case_studies/patong/run_model.py

    r9139 r9140  
    5656# Tell log module to store log file in output dir
    5757log.log_filename = os.path.join(project.output_run, 'anuga_P_%g.log'%myid)
     58if myid == 0:
     59    log.console_logging_level = log.CRITICAL
     60else:
     61    log.console_logging_level = log.CRITICAL+1
    5862
    5963if(myid==0):
     
    231235t0 = time.time()
    232236
    233 ## FIXME: GD June 6 2013 -- I believe ANUGA can no longer do multiple evolves
    234 ## as the 'time' variable gets confused. Think this is because 'starttime'
    235 ## exists in both the sts input files, and in the model, and the two are
    236 ## conflated in the code
    237 ##
    238 ## Skip over the first 60 seconds
     237
     238## Jump up to time 400 sec
    239239for t in domain.evolve(yieldstep=400, finaltime=400):
    240     if myid == 0: domain.write_time()
    241 
    242 #    log.critical(domain.timestepping_statistics())
     240    log.critical(domain.timestepping_statistics())
    243241#    log.critical(domain.boundary_statistics(tags='ocean'))
    244242
    245243
    246 #barrier()
    247 ## Check various important parameters
    248244import time
    249 #time.sleep(myid)
    250 #print 'Processor ', myid , ' : ', project.yieldstep, domain.flow_algorithm
    251 #barrier()
    252 
    253 #print 'project.yieldstep', project.yieldstep
     245
    254246# Start detailed model
    255247for t in domain.evolve(yieldstep=project.yieldstep,
    256248                       finaltime=project.finaltime):
    257249
    258     #log.critical(domain.timestepping_statistics())
     250    log.critical(domain.timestepping_statistics())
    259251    #log.critical(domain.boundary_statistics(tags='ocean'))
    260 
    261     if myid == 0: domain.write_time()
    262252
    263253
Note: See TracChangeset for help on using the changeset viewer.