Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
wiki:customization_tips [2019/02/20 18:42] – [PROMPT BASH for Interactive jobs] neyronwiki:customization_tips [2019/02/20 18:50] – [Naming interactive jobs by default] neyron
Line 973: Line 973:
     $job_name = 'interactive unnamed job';     $job_name = 'interactive unnamed job';
  }  }
 +</code>
 +
 +===== Filter resources by job walltime =====
 +Description: with this admission rule the longer the job walltime is, the fewer resources are available for the job. This encourages a user to shorten the walltime, so that he can use more resources.
 +
 +First we define the ''max_walltime'' property and split nodes in several sets with different ''max_walltime'' values.
 +<code bash>
 +oarproperty -a max_walltime
 +for node in <set 1>; do
 +  oarnodesetting -h node -p max_walltime=<walltime of set 1>
 +done
 +for node in <set 2>; do
 +  oarnodesetting -h node -p max_walltime=<walltime of set 2>
 +done
 +...
 +</code>
 +
 +A node with the ''max_walltime'' property set to a lower value than the actual walltime requested by a job can not be used by that job, as enforced by the following admission rule:
 +<code perl>
 +if ((($jobType eq "PASSIVE") or ($jobType eq "INTERACTIVE")) and !(grep(/^besteffort/, @{$type_list})) and ($queue_name ne "admin")) {
 +  foreach my $mold (@{$ref_resource_list}) {
 +    if (defined($mold->[1])) {
 +      foreach my $r (@{$mold->[0]}){
 +        my $resource = $r->{resources}[0]->{resource};
 +        if ($resource =~ /(network_address|host|cpu|core)/){
 +          my $max_walltime = $mold->[1] / 60; # convert defined walltime in minutes;
 +          my $current_properties = $r->{property};
 +
 +          if ($current_properties ne ""){
 +            $r->{property} = "($current_properties) AND max_walltime >= $max_walltime";
 +          } else {
 +            $r->{property} = "max_walltime >= $max_walltime";
 +          }
 +        }
 +      }
 +    }
 +  }
 +}
 </code> </code>
  
wiki/customization_tips.txt · Last modified: 2020/03/25 15:24 by neyron
Recent changes RSS feed GNU Free Documentation License 1.3 Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki