~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to madgraph/interface/madevent_interface.py

  • Committer: olivier Mattelaer
  • Date: 2013-01-09 17:21:54 UTC
  • mto: (177.4.2 2.0.0beta3)
  • mto: This revision was merged to the branch mainline in revision 239.
  • Revision ID: olivier.mattelaer@uclouvain.be-20130109172154-jfir62ryghtzx2y2
correct bug in large (more than 300) multi_run

Show diffs side-by-side

added added

removed removed

Lines of Context:
2510
2510
    ############################################################################      
2511
2511
    def do_refine(self, line):
2512
2512
        """Advanced commands: launch survey for the current process """
2513
 
        devnull = os.open(os.devnull, os.O_RDWR)  
 
2513
        devnull = open(os.devnull, 'w')  
2514
2514
        self.nb_refine += 1
2515
2515
        args = self.split_arg(line)
2516
2516
        # Check argument's validity
2590
2590
        self.results.add_detail('error', error)   
2591
2591
 
2592
2592
        self.update_status('finish refine', 'parton', makehtml=False)
 
2593
        devnull.close()
2593
2594
        
2594
2595
    ############################################################################ 
2595
2596
    def do_combine_events(self, line):
2729
2730
 
2730
2731
        run = self.run_name
2731
2732
        tag = self.run_card['run_tag']
2732
 
        devnull = os.open(os.devnull, os.O_RDWR)
 
2733
        devnull = open(os.devnull, 'w')
2733
2734
 
2734
2735
        if not os.path.exists(pjoin(self.me_dir, 'Events', run)):
2735
2736
            os.mkdir(pjoin(self.me_dir, 'Events', run))
2792
2793
                misc.call(['gzip', output], stdout=devnull, stderr=devnull, 
2793
2794
                                                                     cwd=O_path) 
2794
2795
        self.update_status('End Parton', level='parton', makehtml=False)
 
2796
        devnull.close()
2795
2797
 
2796
2798
    ############################################################################ 
2797
2799
    def do_create_gridpack(self, line):
3890
3892
            self.update_status('', level=None)
3891
3893
        except Exception, error:         
3892
3894
            pass
 
3895
        devnull = open(os.devnull, 'w')
3893
3896
        try:
3894
 
            devnull = os.open(os.devnull, os.O_RDWR) 
3895
3897
            misc.call(['./bin/internal/gen_cardhtml-pl'], cwd=self.me_dir,
3896
3898
                        stdout=devnull, stderr=devnull)
3897
3899
        except:
3898
3900
            pass
 
3901
        devnull.close()
3899
3902
 
3900
3903
        return super(MadEventCmd, self).do_quit(line)
3901
3904
    
4650
4653
        self.total_jobs = 0
4651
4654
        subproc = [P for P in os.listdir(pjoin(self.me_dir,'SubProcesses')) if 
4652
4655
                   P.startswith('P') and os.path.isdir(pjoin(self.me_dir,'SubProcesses', P))]
 
4656
        devnull = os.open(os.devnull, os.O_RDWR)
4653
4657
        for nb_proc,subdir in enumerate(subproc):
4654
4658
            subdir = subdir.strip()
4655
4659
            Pdir = pjoin(self.me_dir, 'SubProcesses',subdir)
4661
4665
                if os.path.basename(match)[:4] in ['ajob', 'wait', 'run.', 'done']:
4662
4666
                    os.remove(pjoin(Pdir, match))
4663
4667
            
4664
 
            devnull = os.open(os.devnull, os.O_RDWR)
 
4668
 
4665
4669
            logfile = pjoin(Pdir, 'gen_ximprove.log')
4666
4670
            proc = misc.Popen([pjoin(bindir, 'gen_ximprove')],
4667
4671
                                    stdin=subprocess.PIPE,
4702
4706
        
4703
4707
        
4704
4708
        self.update_status('finish refine', 'parton', makehtml=False)
 
4709
        devnull.close()
4705
4710
 
4706
4711
 
4707
4712
class AskforEditCard(cmd.OneLinePathCompletion):