The part of OAR that is usually responsible for setting up and cleaning up the operating system of resources
given to a job is the job resource manager.
This is a Perl script that is part of the OAR configuration files:
located on the OAR server in /etc/oar (see oar.conf). The default one provided with the OAR is named: /etc/oar/job_resource_manager_cgroup.pl.
This Perl script is broadcasted (thanks to TakTuk) to be executed on all the nodes of a job to initialize
the resources at the beginning (creating the job cgroups and more), and to clean-up the resources at the end (killing the remaining processes of the job, removing the job cgroups, and more).
This script can be modified or just augmented by admins: it is meant for that, despite exposing a good part of the complexity of OAR.
Notes:
prologue/epilogue which executes only on the head node of the job and contrary to the job server prologue/server epilogue which executes on the OAR server, the job resource manager executes on all the nodes of the job hosting resources of type default.job resource manager, but this is not usual (no cgroup used) and has not been tested recently.job resource manager does not execute on the deploy frontend (for jobs of type deploy) nor on the cosystem frontend (for jobs of type cosystem): indeed OAR does not set up cgroups on frontends unlike on nodes. deploy or cosystem, the job prologue/epilogue however executes on the deploy/cosystem frontend, and server prologue/server epilogue on the OAR server.noop, the job prologue/epilogue do not execute, but the server prologue/server epilogue do execute on the OAR server, as well as the job resource manager on all nodes hosting resources of type default.