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:managing_resources_cpu_gpu [2019/06/25 14:25] – [Second scenario, more complexe] neyronwiki:managing_resources_cpu_gpu [2020/03/03 13:31] – [Managing processing unit topologies] neyron
Line 11: Line 11:
 In database these 4 kinds of resource properties are all stored as **columns** of the ''resources'' table. A rows then gives the set of properties for one resource. In database these 4 kinds of resource properties are all stored as **columns** of the ''resources'' table. A rows then gives the set of properties for one resource.
  
-**Given a hierarchy** (chosen by the administrator for its cluster setup, for instance cluster/switch/host/cpu/core, but thread could be added, or other customizations), one row in the table gives information for the **lowest level of resources of the hierarchy** (e.g. core). Then **groups of lines** define higher levels, like Russian dolls (e.g. ''#C'' rows for CPUs, ''#H*#C'' rows for hosts, ...).+**Given a hierarchy** (chosen by the administrator for his cluster setup, for instance cluster/switch/host/cpu/core, but thread could be added, or other customizations), one row in the table gives information for the **lowest level of resources of the hierarchy** (e.g. core). Then **groups of lines** define higher levels, like Russian dolls (e.g. ''#C'' rows for CPUs, ''#H*#C'' rows for hosts, ...).
      
 One rule must be kept in mind: **any unique object in the resources hierarchy must have a unique id among its set of object**. For example: One rule must be kept in mind: **any unique object in the resources hierarchy must have a unique id among its set of object**. For example:
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.
 +
 +Finally, GPU jobs 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