parameters: (self, filename=None)
return_statement: return
docstring: Set output directory to d, or to /tmp/somerandomnumber if d is None
docstring_summary: Set output directory to d, or to /tmp/somerandomnumber if d is None
docstring_tokens: Set output directory to d or to / tmp / somerandomnumber if d is None
function: def configure_output_file(self, filename=None):
      """
          Set output directory to d, or to /tmp/somerandomnumber if d is None
          """
      self.first_row = True
      self.log_headers = []
      self.log_current_row = {}
  
      output_path = filename or "output/log_%i.txt" % int(time.time())
  
      out_dir = os.path.dirname(output_path)
      if not os.path.exists(out_dir) and MPIUtil.is_root_proc():
        os.makedirs(out_dir)
  
      if (MPIUtil.is_root_proc()):
        self.output_file = open(output_path, 'w')
        assert osp.exists(output_path)
        atexit.register(self.output_file.close)
  
        Logger.print2("Logging data to " + self.output_file.name)
      return
function_tokens: def configure_output_file ( self , filename = None ) : self . first_row = True self . log_headers = [ ] self . log_current_row = { } output_path = filename or "output/log_%i.txt" % int ( time . time ( ) ) out_dir = os . path . dirname ( output_path ) if not os . path . exists ( out_dir ) and MPIUtil . is_root_proc ( ) : os . makedirs ( out_dir ) if ( MPIUtil . is_root_proc ( ) ) : self . output_file = open ( output_path , 'w' ) assert osp . exists ( output_path ) atexit . register ( self . output_file . close ) Logger . print2 ( "Logging data to " + self . output_file . name ) return