/
SLURM.pm6
32 lines (28 loc) · 1.23 KB
/
SLURM.pm6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use v6.d.PREVIEW;
unit module DRMAA::Native-specification::SLURM:ver<0.0.1>:auth<Vittore F Scolari (vittore.scolari@gmail.com)>;
use DRMAA::Native-specification;
#use DRMAA::Session;
use DRMAA::Submission;
use DRMAA::Job-template;
class DRMAA::Native-specification::SLURM does DRMAA::Native-specification {
method provides(--> List) {
(Dependencies,);
}
# Dependencies
method job-template-after(DRMAA::Job-template:D $what, $after) {
$what.native-specification ~= ' --dependency=after:' ~ join(':', $after.map: { $_.job-id });
};
method job-template-afterany(DRMAA::Job-template:D $what, $after) {
$what.native-specification ~= ' --dependency=afterany:' ~ join(':', $after.map: { $_.job-id });
};
method job-template-afterok(DRMAA::Job-template:D $what, $after) {
$what.native-specification ~= ' --dependency=afterok:' ~ join(':', $after.map: { $_.job-id });
};
method job-template-afternotok(DRMAA::Job-template:D $what, $after) {
$what.native-specification ~= ' --dependency=afternotok:' ~ join(':', $after.map: { $_.job-id });
};
method submission-then(DRMAA::Submission:D $after, DRMAA::Job-template:D $what --> DRMAA::Submission) {
self.job-template-afterany($what, $after);
$what.run;
}
}