~maddevelopers/mg5amcnlo/aMCatNLO

« back to all changes in this revision

Viewing changes to madgraph/interface/amcatnlo_interface.py

  • Committer: Valentin Hirschi
  • Date: 2012-12-18 09:10:58 UTC
  • mfrom: (550.1.11 aMCatNLO)
  • Revision ID: spooner@pb-d-128-141-163-97.cern.ch-20121218091058-x950ogffu0odfard
1. Merged with latest revision of launchpad and made the MadLoop command 
   test safer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
        if not args:
119
119
            if self._done_export:
120
120
                args.append(self._done_export[0])
121
 
                args.append('aMC@NLO')
 
121
                args.append('auto')
122
122
 
123
123
                return
124
124
            else:
131
131
            return self.InvalidCmd, 'Invalid Syntax: Too many argument'
132
132
 
133
133
        elif len(args) == 2:
134
 
            if not args[1] in ['LO', 'NLO', 'aMC@NLO', 'aMC@LO']:
 
134
            if not args[1] in ['LO', 'NLO', 'aMC@NLO', 'aMC@LO', 'auto']:
135
135
                raise self.InvalidCmd, '%s is not a valid mode, please use "LO", "NLO", "aMC@NLO" or "aMC@LO"' % args[1]
136
136
        else:
137
137
            #check if args[0] is path or mode
138
 
            if args[0] in ['LO', 'NLO', 'aMC@NLO', 'aMC@LO'] and self._done_export:
 
138
            if args[0] in ['LO', 'NLO', 'aMC@NLO', 'aMC@LO', 'auto'] and self._done_export:
139
139
                args.insert(0, self._done_export[0])
140
140
            elif os.path.isdir(args[0]) or os.path.isdir(pjoin(MG5DIR, args[0]))\
141
141
                    or os.path.isdir(pjoin(MG4DIR, args[0])):
142
 
                args.append('aMC@NLO')
 
142
                args.append('auto')
143
143
        mode = args[1]
144
144
        
145
145
        # search for a valid path
275
275
        """ Special init tasks for the Loop Interface """
276
276
 
277
277
        mg_interface.MadGraphCmd.__init__(self, mgme_dir = '', *completekey, **stdin)
 
278
        misc.sprint(type(self.history))
278
279
        self.setup()
279
280
 
280
281
    def setup(self):
285
286
        # interfaces
286
287
        # Clear history, amplitudes and matrix elements when a model is imported
287
288
        # Remove previous imports, generations and outputs from history
288
 
        self.clean_history(remove_bef_last='import')
 
289
        self.history.clean(remove_bef_last='import')
289
290
        # Reset amplitudes and matrix elements
290
291
        self._done_export=False
291
292
        self._curr_amps = diagram_generation.AmplitudeList()
419
420
        args = self.split_arg(line)
420
421
        # Check Argument validity
421
422
        self.check_output(args)
422
 
 
423
 
        # Remove previous outputs from history
424
 
        self.clean_history(allow_for_removal = ['output'], keep_switch=True,
425
 
                           remove_bef_last='output')
426
423
        
427
424
        noclean = '-noclean' in args
428
425
        force = '-f' in args 
571
568
            if hasattr(self, 'do_shell'):
572
569
                ME = run_interface.aMCatNLOCmdShell(me_dir=argss[0], options=self.options)
573
570
            else:
574
 
                 ME = run_interface.aMCatNLOCmd(me_dir=argss[0],options=self.options)
575
 
                 ME.pass_in_web_mode()
 
571
                ME = run_interface.aMCatNLOCmd(me_dir=argss[0],options=self.options)
 
572
                ME.pass_in_web_mode()
576
573
            # transfer interactive configuration
577
574
            config_line = [l for l in self.history if l.strip().startswith('set')]
578
575
            for line in config_line:
583
580
        ext_program = launch_ext.aMCatNLOLauncher(argss[0], self, run_mode=argss[1], **options)
584
581
        ext_program.run()
585
582
        
586
 
#        mode = argss[1]
587
 
#        if options['multicore']:
588
 
#            run.cluster_mode = 2
589
 
#        elif options['cluster']:
590
 
#            run.cluster_mode = 1
591
 
#        else:
592
 
 #           run.cluster_mode = int(self.options['run_mode'])
593
 
 
594
 
 
595
 
#        run.ask_run_configuration(mode)
596
 
#        run.compile(mode, options) 
597
 
#        evt_file = run.run(mode, options)
598
 
#        if run.check_mcatnlo_dir():
599
 
#            run.run_mcatnlo(evt_file)
600
 
#        os.chdir(old_cwd)
601
583
                    
602
584
   
603
585
class aMCatNLOInterfaceWeb(mg_interface.CheckValidForCmdWeb, aMCatNLOInterface):