def make_rundir(path):
try:<EOL><INDENT>if not os.path.exists(path):<EOL><INDENT>os.makedirs(path)<EOL><DEDENT>prev_rundirs = glob(os.path.join(path, "<STR_LIT>"))<EOL>current_rundir = os.path.join(path, '<STR_LIT>')<EOL>if prev_rundirs:<EOL><INDENT>x = sorted([int(os.path.basename(x)) for x in prev_rundirs])[-<NUM_LIT:1>]<EOL>current_rundir = os.path.join(path, '<STR_LIT>'.format(x + <NUM_LIT:1>))<EOL><DEDENT>os.makedirs(current_rundir)<EOL>logger.debug("<STR_LIT>".format(current_rundir))<EOL>return os.path.abspath(current_rundir)<EOL><DEDENT>except Exception as e:<EOL><INDENT>logger.error("<STR_LIT>")<EOL>logger.error("<STR_LIT>".format(e))<EOL>raise<EOL><DEDENT>
When a path has not been specified, make the run directory.

    Creates a rundir with the following hierarchy:
        ./runinfo <- Home of all run directories
          |----000
          |----001 <- Directories for each run
          | ....
          |----NNN

    Kwargs:
        - path (str): String path to a specific run dir
               Default : None.