From 56f3f5b7d05f05b8a1e5c18dcb4d6275d1209f27 Mon Sep 17 00:00:00 2001
From: Kepa Cantero <cantero@fortiss.org>
Date: Tue, 10 Mar 2020 08:59:31 +0000
Subject: [PATCH] Merged in NRPJP-95 (pull request #12)

[NRPJP-95] Add profiler Flags in the distributed experiment

* [NRPJP-95] Add profiler Flags in the distributed experiment

* [NRPJP-95] profiler option as integer

Approved-by: Ugo Albanese <ugo.albanese@santannapisa.it>
Approved-by: Omer Yilmaz <yilmazo@in.tum.de>
---
 .../hbp_nrp_distributed_nest/launch/DistributedCLEProcess.py | 5 ++++-
 .../hbp_nrp_distributed_nest/launch/NestLauncher.py          | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/DistributedCLEProcess.py b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/DistributedCLEProcess.py
index 9267a67..2025f35 100644
--- a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/DistributedCLEProcess.py
+++ b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/DistributedCLEProcess.py
@@ -70,6 +70,8 @@ def launch_cle(argv): # pragma: no cover
                             help='specify the user Token', required=True)
         parser.add_argument('--experiment_id', dest='experiment_id',
                             help='specify the experiment id', required=True)
+        parser.add_argument('--profiler', dest='profiler',
+                            help='enabling the profiler in the CLE', required=True)
 
         args = parser.parse_args(argv)
 
@@ -107,7 +109,8 @@ def launch_cle(argv): # pragma: no cover
                                token=args.token,
                                experiment_id=args.experiment_id,
                                brain_processes=None,
-                               rng_seed=int(args.rng_seed))
+                               rng_seed=int(args.rng_seed),
+                               profiler=int(args.profiler))
 
         # construct the simulation with given assembly class
         from main import simulation
diff --git a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestLauncher.py b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestLauncher.py
index f799874..e6ed45a 100644
--- a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestLauncher.py
+++ b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestLauncher.py
@@ -104,7 +104,8 @@ class NestLauncher(object):
                 '--timeout={}'.format(timeout_str),
                 '--rng-seed={}'.format(rng_str),
                 '--token={}'.format(self._sim_config._token),
-                '--experiment_id={}'.format(self._sim_config.experiment_id)]
+                '--experiment_id={}'.format(self._sim_config.experiment_id),
+                '--profiler={}'.format(self._sim_config.profiler)]
 
         exe = '{python} -u -m hbp_nrp_distributed_nest.launch.main {args}'\
               .format(python=sys.executable, args=' '.join(args))
-- 
GitLab