Skip to content

Commit

Permalink
print job id if submitted successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
yuema137 committed Aug 6, 2024
1 parent f659dbe commit caf1476
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions utilix/batchq.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,16 +475,23 @@ def submit(self) -> None:
# Add the job command
slurm.add_cmd(self.jobstring)

print(f"Your log is located at: {self.log}")

# Handle dry run scenario
if self.verbose or self.dry_run:
print(f"Generated slurm script:\n{slurm.script()}")

if self.dry_run:
return
# Submit the job
slurm.sbatch(shell="/bin/bash")

try:
job_id = slurm.sbatch(shell="/bin/bash")
if job_id:
print(f"Job submitted successfully. Job ID: {job_id}")
print(f"Your log is located at: {self.log}")
else:
print("Job submission failed.")
except Exception as e:
print(f"An error occurred while submitting the job: {str(e)}")


def submit_job(
Expand Down

0 comments on commit caf1476

Please sign in to comment.