prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  `globals` should be an optional config field
  Running over a config without `globals`, I see:
  ```
      def make_rundir(config=None, path=None):
          """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.
          """
          try:
              if not path:
                  path = None
  >           elif config["globals"].get('runDir', None):
  E           KeyError: 'globals'
  
  ../dataflow/rundirs.py:25: KeyError
  ```
  
  </issue>
  <code>
  [start of parsl/dataflow/rundirs.py]
  1 import os
  2 from glob import glob
  3 import logging
  4 
  5 logger = logging.getLogger(__name__)
  6 
  7 
  8 def make_rundir(config=None, path=None):
  9     """When a path has not been specified, make the run directory.
  10 
  11     Creates a rundir with the following hierarchy:
  12         ./runinfo <- Home of all run directories
  13           |----000
  14           |----001 <- Directories for each run
  15           | ....
  16           |----NNN
  17 
  18     Kwargs:
  19         - path (str): String path to a specific run dir
  20                Default : None.
  21     """
  22     try:
  23         if not path:
  24             path = None
  25         elif config["globals"].get('runDir', None):
  26             path = config["globals"]['runDir']
  27 
  28         if not path:
  29             path = "./runinfo"
  30 
  31         if not os.path.exists(path):
  32             os.makedirs(path)
  33 
  34         prev_rundirs = glob(os.path.join(path, "[0-9]*"))
  35 
  36         current_rundir = os.path.join(path, '000')
  37 
  38         if prev_rundirs:
  39             # Since we globbed on files named as 0-9
  40             x = sorted([int(os.path.basename(x)) for x in prev_rundirs])[-1]
  41             current_rundir = os.path.join(path, '{0:03}'.format(x + 1))
  42 
  43         os.makedirs(current_rundir)
  44         logger.debug("Parsl run initializing in rundir:{0}".format(current_rundir))
  45         return os.path.abspath(current_rundir)
  46 
  47     except Exception as e:
  48         logger.error("Failed to create a run directory")
  49         logger.error("Error: {0}".format(e))
  50         exit(-1)
  51
  [end of parsl/dataflow/rundirs.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/parsl/dataflow/rundirs.py b/parsl/dataflow/rundirs.py
  --- a/parsl/dataflow/rundirs.py
  +++ b/parsl/dataflow/rundirs.py
  @@ -22,7 +22,7 @@
       try:
           if not path:
               path = None
  -        elif config["globals"].get('runDir', None):
  +        elif config.get("globals", {}).get('runDir'):
               path = config["globals"]['runDir']
   
           if not path:
  
verification_info: {"golden_diff": "diff --git a/parsl/dataflow/rundirs.py b/parsl/dataflow/rundirs.py\n--- a/parsl/dataflow/rundirs.py\n+++ b/parsl/dataflow/rundirs.py\n@@ -22,7 +22,7 @@\n     try:\n         if not path:\n             path = None\n-        elif config[\"globals\"].get('runDir', None):\n+        elif config.get(\"globals\", {}).get('runDir'):\n             path = config[\"globals\"]['runDir']\n \n         if not path:\n", "issue": "`globals` should be an optional config field\nRunning over a config without `globals`, I see:\r\n```\r\n    def make_rundir(config=None, path=None):\r\n        \"\"\"When a path has not been specified, make the run directory.\r\n\r\n        Creates a rundir with the following hierarchy:\r\n            ./runinfo <- Home of all run directories\r\n              |----000\r\n              |----001 <- Directories for each run\r\n              | ....\r\n              |----NNN\r\n\r\n        Kwargs:\r\n            - path (str): String path to a specific run dir\r\n                   Default : None.\r\n        \"\"\"\r\n        try:\r\n            if not path:\r\n                path = None\r\n>           elif config[\"globals\"].get('runDir', None):\r\nE           KeyError: 'globals'\r\n\r\n../dataflow/rundirs.py:25: KeyError\r\n```\n", "before_files": [{"content": "import os\nfrom glob import glob\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\ndef make_rundir(config=None, path=None):\n    \"\"\"When a path has not been specified, make the run directory.\n\n    Creates a rundir with the following hierarchy:\n        ./runinfo <- Home of all run directories\n          |----000\n          |----001 <- Directories for each run\n          | ....\n          |----NNN\n\n    Kwargs:\n        - path (str): String path to a specific run dir\n               Default : None.\n    \"\"\"\n    try:\n        if not path:\n            path = None\n        elif config[\"globals\"].get('runDir', None):\n            path = config[\"globals\"]['runDir']\n\n        if not path:\n            path = \"./runinfo\"\n\n        if not os.path.exists(path):\n            os.makedirs(path)\n\n        prev_rundirs = glob(os.path.join(path, \"[0-9]*\"))\n\n        current_rundir = os.path.join(path, '000')\n\n        if prev_rundirs:\n            # Since we globbed on files named as 0-9\n            x = sorted([int(os.path.basename(x)) for x in prev_rundirs])[-1]\n            current_rundir = os.path.join(path, '{0:03}'.format(x + 1))\n\n        os.makedirs(current_rundir)\n        logger.debug(\"Parsl run initializing in rundir:{0}\".format(current_rundir))\n        return os.path.abspath(current_rundir)\n\n    except Exception as e:\n        logger.error(\"Failed to create a run directory\")\n        logger.error(\"Error: {0}\".format(e))\n        exit(-1)\n", "path": "parsl/dataflow/rundirs.py"}]}