Commit 168247bb authored by Swann Perarnau's avatar Swann Perarnau

[feature] Add config option for pmpi library

Add a config option to specify the location of the PMPI LD_PRELOAD
library available in libnrm. This should make it easier to use this
library.
parent e43c491a
...@@ -33,7 +33,9 @@ def main(argv=None): ...@@ -33,7 +33,9 @@ def main(argv=None):
"hwloc": "hwloc", "hwloc": "hwloc",
"perf": "perf", "perf": "perf",
"argo_perf_wrapper": "argo-perf-wrapper", "argo_perf_wrapper": "argo-perf-wrapper",
"argo_nodeos_config": "argo_nodeos_config"} "argo_nodeos_config": "argo_nodeos_config",
"pmpi_lib": "/usr/lib/libnrm-pmpi.so",
}
if args.print_defaults: if args.print_defaults:
print defaults print defaults
...@@ -74,6 +76,11 @@ def main(argv=None): ...@@ -74,6 +76,11 @@ def main(argv=None):
"variable.", "variable.",
default=os.environ.get('PERF', default=os.environ.get('PERF',
'perf')) 'perf'))
parser.add_argument(
'--pmpi_lib',
help="Path to the libnrm PMPI library used for the power policy"
"Override default with the PMPI environment variable.",
default=os.environ.get('PMPI', defaults['pmpi_lib']))
parser.add_argument( parser.add_argument(
'--argo_perf_wrapper', '--argo_perf_wrapper',
help="Path to the linux perf tool to use. This path can" help="Path to the linux perf tool to use. This path can"
......
...@@ -19,7 +19,8 @@ class ContainerManager(object): ...@@ -19,7 +19,8 @@ class ContainerManager(object):
def __init__(self, rm, def __init__(self, rm,
perfwrapper="argo-perf-wrapper", perfwrapper="argo-perf-wrapper",
linuxperf="perf", linuxperf="perf",
argo_nodeos_config="argo_nodeos_config"): argo_nodeos_config="argo_nodeos_config",
pmpi_lib="/usr/lib/libnrm-pmpi.so"):
self.linuxperf = linuxperf self.linuxperf = linuxperf
self.perfwrapper = perfwrapper self.perfwrapper = perfwrapper
self.nodeos = NodeOSClient(argo_nodeos_config=argo_nodeos_config) self.nodeos = NodeOSClient(argo_nodeos_config=argo_nodeos_config)
...@@ -27,6 +28,7 @@ class ContainerManager(object): ...@@ -27,6 +28,7 @@ class ContainerManager(object):
self.pids = dict() self.pids = dict()
self.resourcemanager = rm self.resourcemanager = rm
self.chrt = ChrtClient() self.chrt = ChrtClient()
self.pmpi_lib = pmpi_lib
def create(self, request): def create(self, request):
"""Create a container according to the request. """Create a container according to the request.
...@@ -49,7 +51,7 @@ class ContainerManager(object): ...@@ -49,7 +51,7 @@ class ContainerManager(object):
logger.info("run: ucontainername: %s", ucontainername) logger.info("run: ucontainername: %s", ucontainername)
# TODO: Application library to load must be set during configuration # TODO: Application library to load must be set during configuration
apppreloadlibrary = '' apppreloadlibrary = self.pmpi_lib
manifest = ImageManifest() manifest = ImageManifest()
if not manifest.load(manifestfile): if not manifest.load(manifestfile):
......
...@@ -300,7 +300,8 @@ class Daemon(object): ...@@ -300,7 +300,8 @@ class Daemon(object):
self.resource_manager, self.resource_manager,
perfwrapper=self.config.argo_perf_wrapper, perfwrapper=self.config.argo_perf_wrapper,
linuxperf=self.config.perf, linuxperf=self.config.perf,
argo_nodeos_config=self.config.argo_nodeos_config argo_nodeos_config=self.config.argo_nodeos_config,
pmpi_lib=self.config.pmpi_lib,
) )
self.application_manager = ApplicationManager() self.application_manager = ApplicationManager()
self.sensor_manager = SensorManager() self.sensor_manager = SensorManager()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment