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:managing_resources_cpu_gpu [2019/06/25 14:25] – [Second scenario, more complexe] neyronwiki:managing_resources_cpu_gpu [2019/11/19 17:56] – [Second scenario, more complex] neyron
Line 167: Line 167:
  
 When reserving 1 GPU, the user obviously gets the 3 cores associated to the GPUs. When reserving 1 GPU, the user obviously gets the 3 cores associated to the GPUs.
 +
 +GPU job can be tied to GPU resources (where ''gpu > 0'') with the following admission rule (see ''oaradmissionrules''), so that users don't have to set ''-p "gpu > 0"'' in their command lines:
 +<code perl>
 +foreach my $mold (@{$ref_resource_list}){
 +  foreach my $r (@{$mold->[0]}){
 +    my $gpu_request = 0;
 +    foreach my $resource (@{$r->{resources}}) {
 +      if ($resource->{resource} eq "gpu") {
 +        $gpu_request = 1;
 +      }
 +    }
 +    if ($gpu_request) {
 +      if ($r->{property} ne ""){
 +        $r->{property} = "($r->{property}) AND gpu > 0";
 +      }else{
 +        $r->{property} = "gpu > 0";
 +      }
 +      print("[ADMISSION RULE] Tie job resource request for GPU to resources with GPU\n");
 +    }
 +  }
 +}
 +</code>
  
 Warning: make sure to look at lstopo output in order to correctly associate cpuset and gpudevices, e.g. not associating cores and GPUs not attached to a same CPU. Warning: make sure to look at lstopo output in order to correctly associate cpuset and gpudevices, e.g. not associating cores and GPUs not attached to a same CPU.
wiki/managing_resources_cpu_gpu.txt · Last modified: 2020/03/03 14:10 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