Differences

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

Link to this comparison view

Both sides previous revision Previous revision
wiki:customization_tips [2019/02/20 18:42]
neyron [PROMPT BASH for Interactive jobs]
wiki:customization_tips [2019/02/20 18:50]
neyron [Naming interactive jobs by default]
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: 2019/02/20 18:50 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