Modules
A class for submitting jobs to Slurm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pool_size |
int
|
Number of jobs to submit at the same time, by default None |
None
|
ncpus_per_job |
int
|
Number of cpus per job, by default 1 |
1
|
max_jobs_per_node |
int
|
Maximum number of jobs to submit to a single node, by default None |
None
|
node_list |
List[str]
|
List of nodes to submit jobs to, by default None |
None
|
partition |
str
|
Partition to submit jobs to, by default None |
None
|
max_pool_size |
int
|
Maximum number of jobs to submit, by default 1000 |
1000
|
Source code in autosbatch/autosbatch.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
__enter__()
¶
Clean up the scripts and log files.
Source code in autosbatch/autosbatch.py
425 426 427 |
|
__exit__(exc_type, exc_val, exc_tb)
¶
Clean up the scripts and log files.
Source code in autosbatch/autosbatch.py
429 430 431 |
|
clean()
classmethod
¶
Clean up the scripts and log files.
Source code in autosbatch/autosbatch.py
415 416 417 418 419 |
|
close()
¶
Clean up the scripts and log files.
Source code in autosbatch/autosbatch.py
421 422 423 |
|
get_nodes(sortByload=True)
classmethod
¶
Get nodes information from sinfo.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sortByload |
bool
|
Sort nodes by load, by default True |
True
|
Returns:
Type | Description |
---|---|
Dict
|
Information of nodes, by default |
Source code in autosbatch/autosbatch.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
map(func, params)
¶
Submit a list of commands to the cluster.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func |
Callable
|
Function to call |
required |
params |
Iterable
|
Parameters to pass to the function |
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in autosbatch/autosbatch.py
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
|
multi_submit(cmds, job_name, shuffle=False, sleep_time=0.5)
¶
Submit jobs to multiple nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cmds |
List[str]
|
Commands to run |
required |
job_name |
str
|
Name of the job |
required |
logging_level |
int
|
Logging level, by default logging.WARNING |
required |
shuffle |
bool
|
Shuffle the commands, by default False |
False
|
sleep_time |
float
|
Time to sleep between each submission, by default 0.5 |
0.5
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in autosbatch/autosbatch.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
|
single_submit(partition, node, cpus_per_task, cmds, job_name='job')
¶
Submit a single job.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
partition |
str
|
Partition to submit jobs to |
required |
node |
str
|
Node to submit jobs to |
required |
cpus_per_task |
int
|
Number of CPUs to use |
required |
cmds |
str or List[str]
|
Commands to run |
required |
job_name |
str
|
Name of the job, by default 'job' |
'job'
|
logging_level |
int
|
Logging level, by default logging.WARNING |
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in autosbatch/autosbatch.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
|
starmap(func, params)
¶
Submit a list of commands to the cluster.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func |
Callable
|
Function to call |
required |
params |
Iterable[Iterable]
|
Parameters to pass to the function |
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in autosbatch/autosbatch.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
|