Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
wiki:customization_tips [2016/03/31 11:05] – Page moved from wiki:old:customization_tips to wiki:customization_tips 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>
  
Line 1192: Line 1230:
  
 Then try oarsh <TAB> Then try oarsh <TAB>
-===== PROMPT BASH for Interactive jobs =====+===== OAR aware shell prompt for Interactive jobs =====
 If you want to have a bash prompt with your job id and the remaining walltime then you can add in your ~/.bashrc: If you want to have a bash prompt with your job id and the remaining walltime then you can add in your ~/.bashrc:
  
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