=encoding UTF-8

=head1 NAME

oar_resource_add - Yet another helper script to define OAR resources 

=head1 SYNOPSIS

B<oar_resource_add> -H <# of hosts> [options]

=head1 DESCRIPTION

This tool generates the oarproperty and oarnodesetting commands to create OAR resources following the host / cpu / core (/ thread) hierarchy, possibly with GPU alongside.

REMINDER: Each physical element (each cpu, each core, each thread, each gpu) must have a unique identifier in the OAR resources database. If some resources already exists in the database (e.g. from a previously installed cluster), offsets can be given in the command line or guessed with the auto-offset option, so that identifiers for newly created resources are unique.

This tool is also a good example of how one can create OAR resources using script loops and the oarnodesetting command. If it does not exactly fit your needs, feel free to read the script code and adapt it.

=head1 OPTIONS

=over 

=item B<-T>, B<--use-threads>

Use (create) the thread property.

=item B<-H>, B<--hosts> <#>

# of hosts.

=item B<-C>, B<--cpus> <#>

# of cpu per host.

=item B<-c>, B<--cores> <#>

# of core per cpu.

=item B<-t>, B<--threads> <#>

# of threads per core.

=item B<-g>, B<--gpus> <#>

# of gpus per host.

WARNING, not all hardware configurations are supported: For multi-GPU configurations, the # of cores per cpu must be a multiple of the # of gpus per cpu.

If not set, no gpu resources is handled.

=item B<--host-prefix> <str>

Hostname prefix (default: "node-").

=item B<--host-suffix> <str>

Hostname suffix (e.g. ".domain").

=item B<--host0> <#>

First host id to use.

=item B<--cpu0> <#>

First cpu id to use.

=item B<--core0> <#>

First core id to use.

=item B<--thread0> <#>

First thread id to use.

=item B<--gpu0> <#>

First gpu id to use.

=item B<--cpusets> <#>

# of cpusets on host (mainly useful for development purposes when one wants to emulate more cores than systems really have).

=item B<--cputopo> <list|RR>

Provide the topology for the CPUs/cores/threads affinity (see hwloc), given a ordered list of the Linux CPU ids (as used in cpuset.cpus).

Or, given the RR value, try to match a round-robin distribution of the core ids, with optionally HyperThreads as well.

=item B<--gpudevices> <#>

# of gpudevices on host (mainly useful for development purposes when one wants to emulate more GPUs than systems really have).

=item B<--gpudevice-prefix> <str>

Path prefix to use for the path of the device file of the GPU (e.g.: /dev/nvidia).

=item B<--gputopo> <list>

Provide the topology for the CPUs/GPUs affinity (see hwloc), given a ordered list of the Linux GPU device ids.

=item B<-A>, B<--append> <str>

Append a text string (extra properties).

=item B<-o>, B<--write-to> <file>

Write commands to file.

=item B<-p>, B<--no-create-properties>

Do not generate oarproperty commands.

=item B<-a>, B<--auto-offset>

Guess the next host/cpu/core/thread/gpu ids to use from the OAR database (unless host0/cpu0/core0/thread0/gpu0 is set).

WARNING: properties must already exist in your database or you will get errors.

=item B<-Y>, B<--yaml>

Generate YAML output.

=item B<-h>, B<--help>

Display usage.

=back

=head1 WARNING

The oar_resource_add tool does not look at the actual hardware topology of the target machines. Core and GPU device affinity to CPU may not be correct. See the B<hwloc> commands for instance to find out the correct topology and affinity, and use the --cputopo and --gputopo options accordingly.

=head1 SEE ALSO

oarnodesetting(8), oarproperty(8), oar_resources_init(8)

=head1 COPYRIGHTS

 Copyright 2003-2018 Laboratoire d'Informatique de Grenoble (http://www.liglab.fr). This software is licensed under the GNU General Public License Version 2 or above. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

=cut


