pbs_job 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pbs_job +51 -0
- data/lib/pbs_job/version.rb +1 -1
- data/spec/pbs_job_spec.rb +4 -5
- data/templates/job.pbs.tt +10 -0
- data/templates/job.qsub.tt +1 -1
- data/templates/task.tt +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35b5ed41dab721a844be1103b04f8b8b48347430
|
4
|
+
data.tar.gz: 6ff5867e9511f73cf5dcac14e0dfabe07da6144c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa0cdb5fafba9b4cf4d1df4008a5b2461faa4e18cd9773bfdaced7a2478ab81ef333fe5f013e888ef5d5ef423c4c50bfe0622b0fbada6aa82a167d2e028d00e1
|
7
|
+
data.tar.gz: 6de696ccd1f1170b0664a77c5438bb4a1d7606ec81e0191bdba0a9f5c0868fb01c1d3cc36b67175dfba05772cab605be74106985895629eba8031bbd69875fad
|
data/bin/pbs_job
CHANGED
@@ -37,6 +37,57 @@ module PbsJob
|
|
37
37
|
:aliases => 'w'
|
38
38
|
}
|
39
39
|
)
|
40
|
+
|
41
|
+
class_option(
|
42
|
+
:walltime,
|
43
|
+
{
|
44
|
+
:desc => '#PBS -l walltime=72:00:00
|
45
|
+
This is the maximum elapsed time that the job will be allowed to run, specified as hours, minutes and seconds in the form HH:MM:SS. If a job exceeds its walltime limit, it is killed by the system. It is best to overestimate the walltime to avoid a run being spoiled by early termination, however, an accurate walltime estimate will allow your job to be scheduled more effectively. It is best to design your code with a capability to write checkpoint data to a file periodically and to be able to restart from the time of the most recent checkpoint by reading that data. That way if the run reaches its walltime limit (or fails for some other reason), only a small fraction of the total computation will have to be redone in a subsequent run. (https://www.westgrid.ca/support/running_jobs)',
|
46
|
+
:default => nil
|
47
|
+
}
|
48
|
+
)
|
49
|
+
class_option(
|
50
|
+
:mem,
|
51
|
+
{
|
52
|
+
:desc => '#PBS -l mem=2000mb
|
53
|
+
The mem parameter should be an estimate of the total amount of memory required by the job. For parallel jobs, multiply the memory per process by the number of processes. Append units of MB or GB as appropriate. The value given must be an integer, so, for example, use mem=3584MB instead of mem=3.5GB (1 GB = 1024 MB) .
|
54
|
+
Note: the mem parameter is not used on the large shared-memory machines. . . . (https://www.westgrid.ca/support/running_jobs)',
|
55
|
+
:default => nil
|
56
|
+
}
|
57
|
+
)
|
58
|
+
class_option(
|
59
|
+
:nodes,
|
60
|
+
{
|
61
|
+
:desc => '#PBS -l nodes=4:ppn=2
|
62
|
+
Use a combination of nodes and processors per node (ppn) to request the total number of processors needed. (https://www.westgrid.ca/support/running_jobs)',
|
63
|
+
:default => nil
|
64
|
+
}
|
65
|
+
)
|
66
|
+
class_option(
|
67
|
+
:ppn,
|
68
|
+
{
|
69
|
+
:desc => '#PBS -l nodes=4:ppn=2
|
70
|
+
Use a combination of nodes and processors per node (ppn) to request the total number of processors needed. (https://www.westgrid.ca/support/running_jobs)',
|
71
|
+
:default => 1
|
72
|
+
}
|
73
|
+
)
|
74
|
+
class_option(
|
75
|
+
:pmem,
|
76
|
+
{
|
77
|
+
:desc => '#PBS -l pmem=2000mb
|
78
|
+
Instead of specifying the total memory requirement of your job with the mem parameter . . ., you can specify a per process memory limit, pmem. Note however, that mem and pmem are independent parameters, so, on some systems it may be necessary to specify both mem and pmem. (https://www.westgrid.ca/support/running_jobs)',
|
79
|
+
:default => nil
|
80
|
+
}
|
81
|
+
)
|
82
|
+
class_option(
|
83
|
+
:procs,
|
84
|
+
{
|
85
|
+
:desc => '#PBS -l procs=8
|
86
|
+
The procs resource request allows the scheduler to distribute the requested number of processors among any available nodes on the cluster. This can reduce the waiting time in the input queue. . . .
|
87
|
+
In using this resource request format, you are not guaranteed any specific number of processors per node. As such, it is not appropriate for OpenMP programs or other multi-threaded programs, with rare exception. For example, if you have a mixed MPI-OpenMP program in which you limit the number of threads per process to just one (OMP_NUM_THREADS=1) you could use procs. In other cases, you may also have to combine procs with pmem to make sure that the scheduler does not assign too many of your processes to the same node. (https://www.westgrid.ca/support/running_jobs)',
|
88
|
+
:default => nil
|
89
|
+
}
|
90
|
+
)
|
40
91
|
|
41
92
|
def self.source_root
|
42
93
|
File.expand_path('../../', __FILE__)
|
data/lib/pbs_job/version.rb
CHANGED
data/spec/pbs_job_spec.rb
CHANGED
@@ -45,7 +45,7 @@ OUT
|
|
45
45
|
describe 'new' do
|
46
46
|
it 'prints help' do
|
47
47
|
pbs_job 'help new'
|
48
|
-
|
48
|
+
gen_help = <<-GEN_HELP
|
49
49
|
Usage:
|
50
50
|
pbs_job new NAME EMAIL_ADDRESS [OPTIONS]
|
51
51
|
|
@@ -54,10 +54,9 @@ Options:
|
|
54
54
|
s, [--script=SCRIPT] # Type of script to make the task script
|
55
55
|
# Default: bash
|
56
56
|
w, [--task-working-dir=TASK_WORKING_DIR] # Working directory in which to run task
|
57
|
-
# Default: /home/vagrant
|
58
|
-
|
59
|
-
Creates a new PBS job with the name NAME and arranges for PBS alerts to be sent to EMAIL_ADDRESS, customized by OPTIONS
|
60
57
|
GEN_HELP
|
58
|
+
|
59
|
+
stdout[0..gen_help.length-1].must_equal gen_help
|
61
60
|
end
|
62
61
|
it 'requires name argument' do
|
63
62
|
pbs_job 'new'
|
@@ -125,4 +124,4 @@ GEN_HELP
|
|
125
124
|
File.file?(script_path).must_equal true
|
126
125
|
File.executable?(script_path).must_equal true
|
127
126
|
end
|
128
|
-
end
|
127
|
+
end
|
data/templates/job.pbs.tt
CHANGED
@@ -1,4 +1,14 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
|
+
#PBS -N <%= name %>
|
2
3
|
#PBS -m abe -M <%= email_address %>
|
4
|
+
#PBS -o <%= abs_stream_prefix %>.o
|
5
|
+
#PBS -e <%= abs_stream_prefix %>.e
|
6
|
+
<%= if options[:walltime] then "#PBS -l walltime=#{options[:walltime]}" else "" end %>
|
7
|
+
<%= if options[:mem] then "#PBS -l mem=#{options[:mem]}" else "" end %>
|
8
|
+
<%= if options[:nodes] && options[:ppn] then "#PBS -l nodes=#{options[:nodes]}:ppn=#{options[:ppn]}" else "" end %>
|
9
|
+
<%= if options[:pmem] then "#PBS -l pmem=#{options[:pmem]}" else "" end %>
|
10
|
+
<%= if options[:procs] then "#PBS -l procs=#{options[:procs]}" else "" end %>
|
11
|
+
|
3
12
|
cd <%= options[:task_working_dir] %>
|
4
13
|
"<%= abs_job_root %>/task" > "<%= abs_stream_prefix %>.out" 2> "<%= abs_stream_prefix %>.err"
|
14
|
+
|
data/templates/job.qsub.tt
CHANGED
data/templates/task.tt
CHANGED