Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions pyslurm/pyslurm.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2746,6 +2746,10 @@ cdef class job:
# desc.min_cpus = job_opts.get("ntasks")

# TODO: ntasks_set, cpus_set

if job_opts.get("ntasks"):
desc.min_cpus = job_opts.get("ntasks") * job_opts.get("cpus_per_task")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? I think there's some conditions to calculating min_cpus.


if job_opts.get("ntasks_per_socket"):
desc.ntasks_per_socket = job_opts.get("ntasks_per_socket")

Expand Down Expand Up @@ -2833,8 +2837,13 @@ cdef class job:

# FIXME: should this be python's getcwd or C's getcwd?
# also, allow option to specify work_dir, if not, set default
cwd = os.getcwd().encode("UTF-8", "replace")
desc.work_dir = cwd

if job_opts.get("work_dir"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

work_dir = job_opts.get("work_dir").encode("UTF-8", "replace")
desc.work_dir = work_dir
else:
cwd = os.getcwd().encode("UTF-8", "replace")
desc.work_dir = cwd

if job_opts.get("requeue"):
desc.requeue = job_opts.get("requeue")
Expand Down Expand Up @@ -5592,6 +5601,7 @@ cdef class slurmdb_jobs:
dict J_dict = {}
slurm.List JOBSList
slurm.ListIterator iters = NULL
void* db_conn = slurm.slurmdb_connection_get()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I can't remember if this got taken out or was missing to begin with.


if jobids:
self.job_cond.step_list = slurm.slurm_list_create(NULL)
Expand All @@ -5616,6 +5626,8 @@ cdef class slurmdb_jobs:

JOBSList = slurm.slurmdb_jobs_get(self.db_conn, self.job_cond)

slurm.slurmdb_connection_close(&db_conn)

if JOBSList is NULL:
apiError = slurm.slurm_get_errno()
raise ValueError(slurm.slurm_strerror(apiError), apiError)
Expand Down