@@ -74,7 +74,7 @@ cdef class Jobs(MultiClusterMap):
7474 """ Retrieve all Jobs from the Slurm controller
7575
7676 Args:
77- preload_passwd_info (bool, optional):
77+ preload_passwd_info (bool, optional):
7878 Decides whether to query passwd and groups information from
7979 the system.
8080 Could potentially speed up access to attributes of the Job
@@ -246,7 +246,7 @@ cdef class Job:
246246 job_info_msg_t * info = NULL
247247 Job wrap = None
248248
249- try :
249+ try :
250250 verify_rpc(slurm_load_job(& info, job_id, slurm.SHOW_DETAIL))
251251
252252 if info and info.record_count:
@@ -282,7 +282,7 @@ cdef class Job:
282282 cdef _swap_data(Job dst, Job src):
283283 cdef slurm_job_info_t * tmp = NULL
284284 if dst.ptr and src.ptr:
285- tmp = dst.ptr
285+ tmp = dst.ptr
286286 dst.ptr = src.ptr
287287 src.ptr = tmp
288288
@@ -305,7 +305,7 @@ cdef class Job:
305305 Implements the slurm_signal_job RPC.
306306
307307 Args:
308- signal (Union[str, int]):
308+ signal (Union[str, int]):
309309 Any valid signal which will be sent to the Job. Can be either
310310 a str like `SIGUSR1`, or simply an [int][].
311311 steps (str):
@@ -315,7 +315,7 @@ cdef class Job:
315315 signaled.
316316 The value `batch` in contrast means, that only the batch-step
317317 will be signaled. With `all` every step is signaled.
318- hurry (bool):
318+ hurry (bool):
319319 If True, no burst buffer data will be staged out. The default
320320 value is False.
321321
@@ -338,7 +338,7 @@ cdef class Job:
338338 flags |= slurm.KILL_FULL_JOB
339339 elif steps.casefold() == " batch" :
340340 flags |= slurm.KILL_JOB_BATCH
341-
341+
342342 if hurry:
343343 flags |= slurm.KILL_HURRY
344344
@@ -417,7 +417,7 @@ cdef class Job:
417417
418418 Examples:
419419 >>> import pyslurm
420- >>>
420+ >>>
421421 >>> # Setting the new time-limit to 20 days
422422 >>> changes = pyslurm.JobSubmitDescription(time_limit="20-00:00:00")
423423 >>> pyslurm.Job(9999).modify(changes)
@@ -442,10 +442,10 @@ cdef class Job:
442442
443443 Examples:
444444 >>> import pyslurm
445- >>>
445+ >>>
446446 >>> # Holding a Job (in "admin" mode by default)
447447 >>> pyslurm.Job(9999).hold()
448- >>>
448+ >>>
449449 >>> # Holding a Job in "user" mode
450450 >>> pyslurm.Job(9999).hold(mode="user")
451451 """
@@ -483,11 +483,11 @@ cdef class Job:
483483
484484 Examples:
485485 >>> import pyslurm
486- >>>
486+ >>>
487487 >>> # Requeing a Job while allowing it to be
488488 >>> # scheduled again immediately
489489 >>> pyslurm.Job(9999).requeue()
490- >>>
490+ >>>
491491 >>> # Requeing a Job while putting it in a held state
492492 >>> pyslurm.Job(9999).requeue(hold=True)
493493 """
@@ -509,7 +509,7 @@ cdef class Job:
509509
510510 Raises:
511511 RPCError: When sending the message to the Job was not successful.
512-
512+
513513 Examples:
514514 >>> import pyslurm
515515 >>> pyslurm.Job(9999).notify("Hello Friends!")
@@ -539,7 +539,7 @@ cdef class Job:
539539 #
540540 # The copyright notices for the file this function was taken from is
541541 # included below:
542- #
542+ #
543543 # Portions Copyright (C) 2010-2017 SchedMD LLC <https://www.schedmd.com>.
544544 # Copyright (C) 2002-2007 The Regents of the University of California.
545545 # Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -621,7 +621,7 @@ cdef class Job:
621621
622622 @property
623623 def nice (self ):
624- if self .ptr.nice == slurm.NO_VAL:
624+ if self .ptr.nice == slurm.NO_VAL:
625625 return None
626626
627627 return self .ptr.nice - slurm.NICE_OFFSET
@@ -647,7 +647,7 @@ cdef class Job:
647647
648648 @property
649649 def state_reason (self ):
650- if self .ptr.state_desc:
650+ if self .ptr.state_desc:
651651 return cstr.to_unicode(self .ptr.state_desc)
652652
653653 return cstr.to_unicode(slurm_job_reason_string(self .ptr.state_reason))
@@ -808,7 +808,7 @@ cdef class Job:
808808 def cpus_per_task (self ):
809809 if self .ptr.cpus_per_tres:
810810 return None
811-
811+
812812 return u16_parse(self .ptr.cpus_per_task, on_noval = 1 )
813813
814814 @property
@@ -1031,7 +1031,7 @@ cdef class Job:
10311031 task_str = cstr.to_unicode(self .ptr.array_task_str)
10321032 if not task_str:
10331033 return None
1034-
1034+
10351035 if " %" in task_str:
10361036 # We don't want this % character and everything after it
10371037 # in here, so remove it.
@@ -1042,7 +1042,7 @@ cdef class Job:
10421042 @property
10431043 def end_time (self ):
10441044 return _raw_time(self .ptr.end_time)
1045-
1045+
10461046 # https://github.com/SchedMD/slurm/blob/d525b6872a106d32916b33a8738f12510ec7cf04/src/api/job_info.c#L480
10471047 cdef _calc_run_time(self ):
10481048 cdef time_t rtime
@@ -1153,6 +1153,15 @@ cdef class Job:
11531153 else :
11541154 return None
11551155
1156+ @property
1157+ def gres_tasks_per_sharing (self ):
1158+ if self .ptr.bitflags & slurm.GRES_MULT_TASKS_PER_SHARING:
1159+ return " multiple"
1160+ elif self .ptr.bitflags & slurm.GRES_ONE_TASK_PER_SHARING:
1161+ return " one"
1162+ else :
1163+ return None
1164+
11561165 @property
11571166 def kill_on_invalid_dependency (self ):
11581167 return u64_parse_bool_flag(self .ptr.bitflags, slurm.KILL_INV_DEP)
@@ -1191,7 +1200,7 @@ cdef class Job:
11911200 """ Retrieve the resource layout of this Job on each node.
11921201
11931202 !!! warning
1194-
1203+
11951204 Return type may still be subject to change in the future
11961205
11971206 Returns:
@@ -1204,25 +1213,25 @@ cdef class Job:
12041213 #
12051214 # The copyright notices for the file that contains the original code
12061215 # is below:
1207- #
1216+ #
12081217 # Portions Copyright (C) 2010-2017 SchedMD LLC <https://www.schedmd.com>.
12091218 # Copyright (C) 2002-2007 The Regents of the University of California.
12101219 # Copyright (C) 2008-2010 Lawrence Livermore National Security.
12111220 # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
12121221 # Written by Morris Jette <[email protected] > et. al. 1213- # CODE-OCEC-09-009. All rights reserved.
1222+ # CODE-OCEC-09-009. All rights reserved.
12141223 #
12151224 # Slurm is licensed under the GNU General Public License. For the full
12161225 # text of Slurm's License, please see here:
12171226 # pyslurm/slurm/SLURM_LICENSE
12181227 #
12191228 # Please, as mentioned above, also have a look at Slurm's DISCLAIMER
12201229 # under pyslurm/slurm/SLURM_DISCLAIMER
1221- #
1230+ #
12221231 # TODO: Explain the structure of the return value a bit more.
12231232 cdef:
12241233 slurm.job_resources * resources = < slurm.job_resources* > self .ptr.job_resrcs
1225- slurm.hostlist_t hl
1234+ slurm.hostlist_t * hl
12261235 uint32_t rel_node_inx
12271236 int bit_inx = 0
12281237 int bit_reps = 0
@@ -1299,9 +1308,9 @@ cdef class Job:
12991308 free(host)
13001309
13011310 slurm.slurm_hostlist_destroy(hl)
1302- return output
1311+ return output
1312+
13031313
1304-
13051314# https://github.com/SchedMD/slurm/blob/d525b6872a106d32916b33a8738f12510ec7cf04/src/api/job_info.c#L99
13061315cdef _threads_per_core(char * host):
13071316 # TODO
0 commit comments