From 35eb69f6567efdd79ab1a97826670b8e5024bc0c Mon Sep 17 00:00:00 2001 From: James Foucar Date: Wed, 29 Mar 2017 12:53:55 -0600 Subject: [PATCH] Add better support for core files Use python resource library, similar to ulimit for bash, to try to remove any size limits on core files. [BFB] --- utils/python/CIME/case_run.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/python/CIME/case_run.py b/utils/python/CIME/case_run.py index c20a7d2ccd84..b349c82e729a 100644 --- a/utils/python/CIME/case_run.py +++ b/utils/python/CIME/case_run.py @@ -6,7 +6,7 @@ from CIME.provenance import save_prerun_provenance, save_postrun_provenance from CIME.preview_namelists import create_namelists -import shutil, time, sys, os, glob +import shutil, time, sys, os, glob, resource logger = logging.getLogger(__name__) @@ -200,6 +200,13 @@ def case_run(case): "Please submit your run using the submit script like so:" " ./case.submit") + # If we need to produce core files, we need to try to ensure that the + # system will support them + try: + resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY)) + except resource.error: + pass + data_assimilation = case.get_value("DATA_ASSIMILATION") data_assimilation_cycles = case.get_value("DATA_ASSIMILATION_CYCLES") data_assimilation_script = case.get_value("DATA_ASSIMILATION_SCRIPT")