~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to bin/mg5_aMC

mwrge with 2.7.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
                 help='force to launch debug mode')
58
58
parser.add_option("-m", "--mode", dest="plugin",
59
59
                  help="Define some additional command provide by a PLUGIN")
60
 
                               
 
60
parser.add_option("-s", "--nocaffeinate", action="store_false", default=True, dest='nosleep',
 
61
                  help='For mac user, forbids to use caffeinate when running with a script')                               
61
62
(options, args) = parser.parse_args()
62
63
if len(args) == 0:
63
64
    args = ''
74
75
import logging.config
75
76
import madgraph.interface.coloring_logging
76
77
 
 
78
if ' ' in os.getcwd():
 
79
    logging.warning("Path does contains spaces. We advise that you change your current path to avoid to have space in the path.")
 
80
 
77
81
try: 
78
82
    import readline
79
83
except ImportError:
165
169
# Call the cmd interface main loop
166
170
try:
167
171
    if options.file or args:
 
172
        if sys.platform == "darwin" and options.nosleep:
 
173
            logging.getLogger('madgraph').warning("launching caffeinate to prevent idle sleep when MG5aMC is running. Run './bin/mg5_aMC -s' to prevent this.")
 
174
            pid = os.getpid()
 
175
            subprocess.Popen(['caffeinate', '-i', '-w', str(pid)])
168
176
        # They are an input file 
169
177
        if args:
170
178
            input_file = os.path.realpath(args[0])