diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py index 95bfa066589bafd41bb1633f6974d426202b8400..f7e870b5a20e9b456816cd6270d39646a32918a9 100644 --- a/binarycpython/utils/grid.py +++ b/binarycpython/utils/grid.py @@ -5138,6 +5138,13 @@ eccentricity3=0 value=self.grid_options['slurm_extra_settings'][key] )] + # save original command line, working directory, time + lines += [ + "\nexport BINARY_C_PYTHON_ORIGINAL_CMD_LINE={cmdline}".format(cmdline=repr(self.grid_options['command_line'])), + "\nexport BINARY_C_PYTHON_ORIGINAL_WD=`pwd`", + "\nexport BINARY_C_PYTHON_ORIGINAL_SUBMISSION_TIME=`date`", + ] + lines += [ "\n# set status to \"running\"\n", diff --git a/binarycpython/utils/grid_options_defaults.py b/binarycpython/utils/grid_options_defaults.py index 7435fde92cfed776332cc180a3cb04b5fae651ca..12d2cc9a40419aaf97244630c8f7ba60cfb81ffe 100644 --- a/binarycpython/utils/grid_options_defaults.py +++ b/binarycpython/utils/grid_options_defaults.py @@ -13,6 +13,7 @@ With this its also possible to automatically generate a document containing all All the options starting with _ should not be changed by the user except when you really know what you're doing (which is probably hacking the code :P) """ +import datetime import os import sys @@ -50,7 +51,17 @@ grid_options_defaults_dict = { "do_dry_run": True, # Whether to do a dry run to calculate the total probability for this run "custom_generator": None, # Place for the custom system generator "exit_after_dry_run": False, # Exit after dry run? + + ##################### + # System information + ##################### "command_line": ' '.join(sys.argv), + "original_command_line": os.getenv('BINARY_C_PYTHON_ORIGINAL_CMD_LINE'), + "working_diretory": os.getcwd(), + "original_working_diretory": os.getenv('BINARY_C_PYTHON_ORIGINAL_WD'), + "start_time": datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S"), + "original_submission_time" : os.getenv('BINARY_C_PYTHON_ORIGINAL_SUBMISSION_TIME'), + ########################## # Execution log: ##########################