| 453 | |
| 454 | === {{{slurm_workflow}}} Library === |
| 455 | |
| 456 | We have developed a library that developers can use to change the reservation beginning times or dependency type of the dependent jobs in a workflow. This library is called {{{slurm_workflow}}}. The library has two functions. |
| 457 | |
| 458 | The first function moves all the reservations of the remaining workflow jobs to an earlier time when the workflow is created using {{{--delay}}} switch. |
| 459 | {{{ |
| 460 | /* |
| 461 | IN: number seconds to move |
| 462 | OUT: 0 successful, non zero unsuccessful. set slurm_wf_error. |
| 463 | */ |
| 464 | int slurm_wf_move_all_res(uint32_t t); |
| 465 | }}} |
| 466 | |
| 467 | The second function changes the dependencies type of all jobs dependent on the current job from {{{afterok:job_id}}} to {{{after:job_id}}}. |
| 468 | {{{ |
| 469 | /* |
| 470 | OUT: 0 successful, error no otherwise. |
| 471 | */ |
| 472 | |
| 473 | int slurm_change_dep(); |
| 474 | }}} |
| 475 | |
| 476 | Call the above function to change all {{{afterok:$(SLURM_JOBID)}}} dependencies into {{{after:$(SLURM_JOBID)}} dependencies. This enables the jobs in workflow eligible for allocation by Slurm. |
| 477 | |
| 478 | The header file can be included using {{{#include "slurm/slurm_workflow.h"}}} and should be linked using {{{-lslurm_workflow}}}. |
| 479 | |