示例#1
0
    def launch(
        self
    ):  # this method should probably exist in the superclass API too [bruce 071216 comment]
        """
        Launch GAMESS job.
        Returns: 0 = Success
                 1 = Cancelled
                 2 = Failed
        """
        # Get a unique Job Id and the Job Id directory for this run.
        from analysis.GAMESS.JobManager import get_job_manager_job_id_and_dir
        ### this causes an import cycle.
        ### FIX - pass in an obj providing this func? or just move this func into SimJob.py?
        # [bruce 071216 comment]
        job_id, job_id_dir = get_job_manager_job_id_and_dir()
        self.Job_id = job_id
        self.Status = 'Queued'

        basename = self.gamessJig.name + "-" + self.gamessJig.gms_parms_info(
            '_')

        # GAMESS Job INP, OUT and BAT files.

        self.job_inputfile = os.path.join(job_id_dir, "%s.inp" % basename)

        self.job_outputfile = os.path.join(job_id_dir, "%s.out" % basename)
        self.job_batfile = os.path.join(job_id_dir, "%s.bat" % basename)

        # Write INP file (in ~/Nanorex/JobManager/Job Id subdirectory)
        writegms_inpfile(self.job_inputfile, self.gamessJig)

        # Create BAT file (in ~/Nanorex/JobManager/Job Id subdirectory)
        ## writegms_batfile(self.job_batfile, self)

        # Open INP file in editor if user checked checkbox in GAMESS jig properties UI.
        #        if self.edit_cntl.edit_input_file_cbox.isChecked():
        #            open_file_in_editor(self.job_inputfile)

        self.starttime = time.time()  # Save the start time for this job.

        # Validate Gamess Program
        r = self._validate_gamess_program()

        if r:  # Gamess program was not valid.
            return 1  # Job Cancelled.

        try:
            if sys.platform == 'win32':  # Windows
                return self._launch_pcgamess()
            else:  # Linux or MacOS
                return self._launch_gamess()
        except:
            print_compact_traceback("Exception happened when run gamess")
        return
示例#2
0
    def launch(self): # this method should probably exist in the superclass API too [bruce 071216 comment]
        """
        Launch GAMESS job.
        Returns: 0 = Success
                 1 = Cancelled
                 2 = Failed
        """
        # Get a unique Job Id and the Job Id directory for this run.
        from analysis.GAMESS.JobManager import get_job_manager_job_id_and_dir
            ### this causes an import cycle.
            ### FIX - pass in an obj providing this func? or just move this func into SimJob.py?
            # [bruce 071216 comment]
        job_id, job_id_dir = get_job_manager_job_id_and_dir()
        self.Job_id = job_id
        self.Status = 'Queued'

        basename = self.gamessJig.name + "-" + self.gamessJig.gms_parms_info('_')
      
        # GAMESS Job INP, OUT and BAT files.

        self.job_inputfile = os.path.join(job_id_dir, "%s.inp" % basename)

        self.job_outputfile = os.path.join(job_id_dir, "%s.out" %  basename)
        self.job_batfile = os.path.join(job_id_dir, "%s.bat" %  basename)
         
        # Write INP file (in ~/Nanorex/JobManager/Job Id subdirectory)
        writegms_inpfile(self.job_inputfile, self.gamessJig)
        
        # Create BAT file (in ~/Nanorex/JobManager/Job Id subdirectory)
        ## writegms_batfile(self.job_batfile, self)
        
        # Open INP file in editor if user checked checkbox in GAMESS jig properties UI.
#        if self.edit_cntl.edit_input_file_cbox.isChecked():
#            open_file_in_editor(self.job_inputfile)

        self.starttime = time.time() # Save the start time for this job.
        
        # Validate Gamess Program
        r = self._validate_gamess_program()
        
        if r: # Gamess program was not valid.
            return 1 # Job Cancelled.
           
        try:
            if sys.platform == 'win32': # Windows
                return self._launch_pcgamess()
            else: # Linux or MacOS
                return self._launch_gamess()
        except:
             print_compact_traceback("Exception happened when run gamess")    
        return
示例#3
0
    def open_tmp_inputfile(self):
        '''Writes a temporary GAMESS inputfile of the current Gamess jig and opens the
        file in an editor.
        '''
        # Make tmp_inputfile filename (i.e. ~/Nanorex/temp/jigname_parms_info.inp)
        from platform_dependent.PlatformDependent import find_or_make_Nanorex_subdir
        tmpdir = find_or_make_Nanorex_subdir('temp')
        basename = self.gamessJig.name + "-" + self.gamessJig.gms_parms_info('_')
        tmp_inputfile = os.path.join(tmpdir, "%s.inp" % basename)

        # Write INP file (in ~/Nanorex/temp subdirectory)
        from analysis.GAMESS.files_gms import writegms_inpfile
        writegms_inpfile(tmp_inputfile, self.gamessJig)

        from platform_dependent.PlatformDependent import open_file_in_editor
        open_file_in_editor(tmp_inputfile)