parameters: (self, overwrite=False)
return_statement: return run_proc.returncode
docstring: Submit batch job to Slurm with sbatch.
  
          The script file is written before being submitted.
  
          Args:
              overwrite (bool): Whether to overwrite script file if it
                  already exists (default: false).
  
          Returns:
              int: Exit status from sbatch.
docstring_summary: Submit batch job to Slurm with sbatch.
docstring_tokens: Submit batch job to Slurm with sbatch .
function: def submit(self, overwrite=False):
          """Submit batch job to Slurm with sbatch.
  
          The script file is written before being submitted.
  
          Args:
              overwrite (bool): Whether to overwrite script file if it
                  already exists (default: false).
  
          Returns:
              int: Exit status from sbatch.
  
          """
  
          # Construct script file
          self.write(overwrite=overwrite)
  
          # Submit batch script and pipe output to log files
          run_proc = subprocess.Popen(['sbatch', self.script_file],
                                      stdout=subprocess.PIPE,
                                      stderr=subprocess.PIPE,
                                      cwd=self.work_dir)
          out_proc = subprocess.Popen(['tee', self.out_log_file],
                                      stdin=run_proc.stdout,
                                      cwd=self.work_dir)
          err_proc = subprocess.Popen(['tee', self.err_log_file],
                                      stdin=run_proc.stderr,
                                      cwd=self.work_dir)
          run_proc.stdout.close()
          run_proc.stderr.close()
          run_proc.wait()
          out_proc.wait()
          err_proc.wait()
          return run_proc.returncode
function_tokens: def submit ( self , overwrite = False ) : # Construct script file self . write ( overwrite = overwrite ) # Submit batch script and pipe output to log files run_proc = subprocess . Popen ( [ 'sbatch' , self . script_file ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE , cwd = self . work_dir ) out_proc = subprocess . Popen ( [ 'tee' , self . out_log_file ] , stdin = run_proc . stdout , cwd = self . work_dir ) err_proc = subprocess . Popen ( [ 'tee' , self . err_log_file ] , stdin = run_proc . stderr , cwd = self . work_dir ) run_proc . stdout . close ( ) run_proc . stderr . close ( ) run_proc . wait ( ) out_proc . wait ( ) err_proc . wait ( ) return run_proc . returncode