@@ -31,7 +31,7 @@ description = 'This tool helps you to find resources on ' + \
31
31
style .host ('max' ) + ' = find the time slot where the maximum number of nodes are available.\n \n ' + \
32
32
"""If no arguments is given, compile the planning of the whole platform and generate an
33
33
oargridsub command line with all available resources for 1 hour.
34
- Based on execo 2.2 , """ + style .emph ('http://execo.gforge.inria.fr/doc/' ) + \
34
+ Based on execo 2.4 , """ + style .emph ('http://execo.gforge.inria.fr/doc/' ) + \
35
35
'oar 2.5, ' + style .emph ('http://oar.imag.fr' ) + '.'
36
36
37
37
epilog = style .host ('Examples:' ) + \
@@ -60,7 +60,7 @@ optinout.add_argument("-h", "--help",
60
60
help = "show this help message and exit" )
61
61
optinout .add_argument ('--version' ,
62
62
action = 'version' ,
63
- version = '%(prog)s 1.2' )
63
+ version = '%(prog)s 1.2.1 ' )
64
64
optinout .add_argument ("-m" , "--mode" ,
65
65
dest = "mode" ,
66
66
default = 'date' ,
@@ -100,7 +100,8 @@ optreservation = parser.add_argument_group(style.host("Reservation"),
100
100
optreservation .add_argument ("-r" , "--resources" ,
101
101
dest = "resources" ,
102
102
default = "grid5000" ,
103
- help = "Comma separated list of Grid'5000 elements (grid5000, site or cluster)" +
103
+ help = "Comma separated list of Grid'5000 elements " +
104
+ " (grid5000, site or cluster)" +
104
105
"\n -r element1,element2 for date and max modes" +
105
106
"\n -r element1:n_nodes1,element2:n_nodes2 for free mode" +
106
107
"\n default = %(default)s" )
@@ -123,7 +124,7 @@ optreservation.add_argument("-k", "--kavlan",
123
124
help = "Ask for a KaVLAN" )
124
125
optreservation .add_argument ("-n" , "--subnet" ,
125
126
dest = "subnet" ,
126
- help = "Ask for subnets. slash_22=1 will retrieve a /22 subnet on every site of your requests, " + \
127
+ help = "Ask for subnets. slash_22=1 will retrieve a /22 subnet on every site of your requests, " + \
127
128
"\n but you can specify site1:slash_22=2,site2:slash_19=1" )
128
129
129
130
optreservation .add_argument ("-j" , "--job_name" ,
@@ -238,10 +239,10 @@ if args.virtual or args.green or args.infiniband:
238
239
if args .virtual and not cluster_attr ['supported_job_types' ]['virtual' ]:
239
240
feature_blacklist .append (cluster )
240
241
if args .infiniband and len (filter (lambda x : x ['interface' ] == 'InfiniBand' ,
241
- cluster_attr ['network_adapters' ])) == 0 :
242
+ cluster_attr ['network_adapters' ])) == 0 :
242
243
feature_blacklist .append (cluster )
243
- if args .green and (not 'sensors' in cluster_attr or \
244
- not cluster_attr ['sensors' ]['power' ]):
244
+ if args .green and ('sensors' not in cluster_attr or
245
+ not cluster_attr ['sensors' ]['power' ]):
245
246
feature_blacklist .append (cluster )
246
247
blacklisted = list (set (blacklisted + feature_blacklist ))
247
248
@@ -257,7 +258,8 @@ else:
257
258
sites .append (element )
258
259
259
260
260
- # Adding network elements, and blacklisting rennes and nantes if kavlan is used and multiple sites wanted
261
+ # Adding network elements, and blacklisting rennes and nantes if kavlan is used
262
+ # and multiple sites wanted
261
263
if args .kavlan :
262
264
resources_wanted ['kavlan' ] = 1
263
265
if len (sites ) > 1 :
@@ -268,16 +270,9 @@ if args.kavlan:
268
270
269
271
if args .subnet :
270
272
resources_wanted ['subnets' ] = args .subnet
271
- logger .warning ('subnet is not implemented in execo_g5k.planning, ' + \
272
- 'we cannot assure that the requested resources will be available' )
273
- #if args.storage:
274
- # resources_wanted['storage'] = args.storage
275
- # logger.warning('storage is not implemented in execo_g5k.planning, '+\
276
- # 'we cannot assure that the requested resources will be availables')
277
- # storage = True
278
- #else:
279
- # storage = False
280
-
273
+ logger .warning ('subnet is not implemented in execo_g5k.planning, ' +
274
+ 'we cannot assure that the requested subnets will ' +
275
+ 'be available' )
281
276
282
277
logger .info ('From %s to %s' , style .emph (format_date (args .startdate )),
283
278
style .emph (format_date (args .enddate )))
@@ -290,12 +285,12 @@ show_resources({resource: n_nodes for resource, n_nodes in resources_wanted.iter
290
285
# Computing the planning of the ressources wanted
291
286
logger .info ('Compiling planning' )
292
287
planning = get_planning (elements = resources_wanted .keys (),
293
- vlan = args .kavlan ,
294
- subnet = False ,
295
- storage = False ,
296
- out_of_chart = args .charter ,
297
- starttime = args .startdate ,
298
- endtime = args .enddate )
288
+ vlan = args .kavlan ,
289
+ subnet = False ,
290
+ storage = False ,
291
+ out_of_chart = args .charter ,
292
+ starttime = args .startdate ,
293
+ endtime = args .enddate )
299
294
300
295
# Determing the slots for the given walltime, i.e. finding the slice of time with constant resources
301
296
logger .info ('Calculating slots of %s ' , args .walltime )
@@ -308,11 +303,13 @@ if args.plots:
308
303
draw_gantt (planning , outfile = "funk_gantt.png" )
309
304
310
305
if MPL .__version__ < '1.2.0' :
311
- logger .warning ('Slots drawing use stackplot that requires matlplotlib >= 1.2.0' )
306
+ logger .warning ('Slots drawing use stackplot that ' +
307
+ 'requires matlplotlib >= 1.2.0' )
312
308
else :
313
309
draw_slots (slots , outfile = "funk_slots.png" )
314
310
except :
315
- logger .warning ('No matplotlib package detected, plots cannot be created' )
311
+ logger .warning ('No matplotlib package detected, ' +
312
+ 'plots cannot be created' )
316
313
pass
317
314
318
315
# Determine the slot to use
@@ -340,7 +337,7 @@ resources = distribute_hosts(resources, resources_wanted, blacklisted,
340
337
args .ratio )
341
338
show_resources (resources , 'Resources selected' )
342
339
343
- logger .info (style .log_header ('Chosen slot ' ) + format_date (startdate ) + \
340
+ logger .info (style .log_header ('Chosen slot ' ) + format_date (startdate ) +
344
341
' -> ' + format_date (enddate ))
345
342
346
343
jobs_specs = get_jobs_specs (resources , excluded_elements = blacklisted ,
0 commit comments