We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `parsl/dataflow/rundirs.py`
Content:
```
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 FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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:

{"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"}], "after_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.get(\"globals\", {}).get('runDir'):\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"}]}