Skip to content
Snippets Groups Projects
Commit d9592438 authored by Georges Da Costa's avatar Georges Da Costa
Browse files

Merge branch 'devel' into 'master'

Devel

See merge request !1
parents 1fcdd4f3 4eb56dda
Branches
No related tags found
1 merge request!1Devel
...@@ -184,8 +184,8 @@ int main(int argc, char** argv) { ...@@ -184,8 +184,8 @@ int main(int argc, char** argv) {
// -c 1200 // -c 1200
// -m 35000 // -m 35000
/* time mpirun --machinefile /dev/shm/m ./a.out -m 35000 -n 1 -c 1200 /* time mpirun --machinefile m ./a.out -m 35000 -n 1 -c 1200
/dev/shm/m : 32 == cores m : 32 == cores
real 2m26.163s real 2m26.163s
user 32m6.416s user 32m6.416s
sys 5m27.728s sys 5m27.728s
...@@ -196,8 +196,8 @@ sys 5m27.728s ...@@ -196,8 +196,8 @@ sys 5m27.728s
/* /*
/* time mpirun --machinefile /dev/shm/m2 ./a.out -m 35000 -n 1 -c 1200 /* time mpirun --machinefile m2 ./a.out -m 35000 -n 1 -c 1200
/dev/shm/m2 : 64 == hyperthread m2 : 64 == hyperthread
real 3m38.990s real 3m38.990s
user 101m59.836s user 101m59.836s
sys 12m21.300s sys 12m21.300s
...@@ -209,12 +209,12 @@ sys 12m21.300s ...@@ -209,12 +209,12 @@ sys 12m21.300s
/* RQ: avec mpirun --mca btl ^openib /* RQ: avec mpirun --mca btl ^openib
time mpirun --mca btl ^openib --machinefile /dev/shm/m ./a.out -n 1 time mpirun --mca btl ^openib --machinefile m ./a.out -n 1
real 0m53.827s real 0m53.827s
user 6m38.412s user 6m38.412s
sys 6m46.088s sys 6m46.088s
time mpirun --machinefile /dev/shm/m ./a.out -n 1 time mpirun --machinefile m ./a.out -n 1
real 0m53.990s real 0m53.990s
user 6m43.392s user 6m43.392s
sys 6m53.344s sys 6m53.344s
......
...@@ -8,6 +8,7 @@ import random ...@@ -8,6 +8,7 @@ import random
import time import time
import itertools import itertools
from pathlib import Path from pathlib import Path
import tempfile
from functools import reduce from functools import reduce
from execo import Process from execo import Process
...@@ -15,8 +16,14 @@ from execo import Process ...@@ -15,8 +16,14 @@ from execo import Process
class Executor: class Executor:
'Allow access to the platform' 'Allow access to the platform'
def __init__(self): def __init__(self):
self.mpi_host_file = '/dev/shm/mpi_host_file' self.tmp_dir = ''
self.mpi_core_file = '/dev/shm/mpi_core_file' if os.path.isdir('/dev/shm'):
self.tmp_dir = tempfile.mkdtemp(prefix="/dev/shm/")
else:
self.tmp_dir = tempfile.mkdtemp(prefix="/tmp/executor/")
self.mpi_host_file = '%s/mpi_host_file' % self.tmp_dir
self.mpi_core_file = '%s/mpi_core_file' % self.tmp_dir
self.mpi_options = '' self.mpi_options = ''
self.hostnames = ['localhost'] self.hostnames = ['localhost']
self.nbhosts = 1 self.nbhosts = 1
...@@ -44,6 +51,8 @@ class Executor: ...@@ -44,6 +51,8 @@ class Executor:
for host in self.hostnames: for host in self.hostnames:
file_id.write(host+" slots=%s\n" % (self.nbcores//self.nbhosts)) file_id.write(host+" slots=%s\n" % (self.nbcores//self.nbhosts))
self.hosts(f'mkdir -p {self.tmp_dir}')
def local(self, cmd, shell=True, root=False): def local(self, cmd, shell=True, root=False):
"""Executes the cmd command and returns stdout after cmd exits""" """Executes the cmd command and returns stdout after cmd exits"""
if root: if root:
......
...@@ -18,7 +18,7 @@ if __name__ == '__main__': ...@@ -18,7 +18,7 @@ if __name__ == '__main__':
stay=True stay=True
with open('/dev/shm/power_measures','w') as power_file: with open('/tmp/expetator_power_measures','w') as power_file:
power_file.write('#timestamp power\n') power_file.write('#timestamp power\n')
try: try:
...@@ -30,7 +30,7 @@ if __name__ == '__main__': ...@@ -30,7 +30,7 @@ if __name__ == '__main__':
current_time=time.time() current_time=time.time()
int_current_time=int(current_time) int_current_time=int(current_time)
with open('/dev/shm/power_measures','a') as power_file: with open('/tmp/expetator_power_measures','a') as power_file:
power_file.write(str(int_current_time)+' '+str(watt)+'\n') power_file.write(str(int_current_time)+' '+str(watt)+'\n')
time.sleep(1-(current_time-int_current_time)) time.sleep(1-(current_time-int_current_time))
except: except:
......
...@@ -31,7 +31,7 @@ class Lperf: ...@@ -31,7 +31,7 @@ class Lperf:
self.executor = executor self.executor = executor
self.cmdline = '/tmp/bin/lperf stat -x "!" -I %s -a -A -e %s' % (self.interval, ','.join(self.names)) self.cmdline = '/tmp/bin/lperf stat -x "!" -I %s -a -A -e %s' % (self.interval, ','.join(self.names))
self.cmdline += ' -o /dev/shm/lperf_monitoring &' self.cmdline += ' -o %s/lperf_monitoring &' % executor.tmp_dir
def start(self): def start(self):
'Starts the monitoring right before the benchmark' 'Starts the monitoring right before the benchmark'
...@@ -47,8 +47,8 @@ class Lperf: ...@@ -47,8 +47,8 @@ class Lperf:
os.makedirs(filename_moj, exist_ok=True) os.makedirs(filename_moj, exist_ok=True)
if len(self.executor.hostnames) > 1: if len(self.executor.hostnames) > 1:
for hostname in self.executor.hostnames: for hostname in self.executor.hostnames:
self.executor.local('oarcp %s:/dev/shm/lperf_monitoring %s/%s_%s_%s' % self.executor.local('oarcp %s:%s/lperf_monitoring %s/%s_%s_%s' %
(hostname, filename_moj, hostname, benchname, beg_time)) (hostname, self.executor.tmp_dir, filename_moj, hostname, benchname, beg_time))
else: else:
self.executor.local('cp /dev/shm/lperf_monitoring %s/%s_%s_%s' % self.executor.local('cp %s/lperf_monitoring %s/%s_%s_%s' %
(filename_moj, 'localhost', benchname, beg_time)) (self.executor.tmp_dir, filename_moj, 'localhost', benchname, beg_time))
...@@ -58,21 +58,22 @@ class Mojitos: ...@@ -58,21 +58,22 @@ class Mojitos:
def build(self, executor): def build(self, executor):
"""Installs the mojito/s monitoring framework and add the permissions""" """Installs the mojito/s monitoring framework and add the permissions"""
if True or self.rapl: #if True or self.rapl:
# should work but do not work currently as to compile mojitos it # should work but do not work currently as to compile mojitos it
# is always necessary to have rapl. Todo: update mojitos # is always necessary to have rapl. Todo: update mojitos
if False in [os.path.exists(filename) for filename in # if False in [os.path.exists(filename) for filename in
['/usr/share/doc/powercap-utils', # ['/usr/share/doc/powercap-utils',
'/usr/share/doc/libpowercap-dev', # '/usr/share/doc/libpowercap-dev',
'/usr/share/doc/libpowercap0']]: # '/usr/share/doc/libpowercap0']]:
executor.hosts('apt install -y libpowercap0 libpowercap-dev powercap-utils', root=True) # executor.hosts('apt install -y libpowercap0 libpowercap-dev powercap-utils', root=True)
if not os.path.exists('/tmp/mojitos'): if not os.path.exists('/tmp/mojitos'):
executor.local('cd /tmp; git clone https://gitlab.irit.fr/sepia-pub/mojitos.git') executor.local('cd /tmp; git clone https://gitlab.irit.fr/sepia-pub/mojitos.git')
else: else:
executor.local('cd /tmp/mojitos; git pull') executor.local('cd /tmp/mojitos; git pull')
executor.local('cd /tmp/mojitos; make') executor.local('cd /tmp/mojitos; ./configure.sh; make')
executor.local('cp /tmp/mojitos/mojitos /tmp/bin/') executor.local('cp /tmp/mojitos/bin/mojitos /tmp/bin/')
if True or self.rapl: if True or self.rapl or self.perf:
executor.hosts('sudo-g5k modprobe msr', root=True)
if read_int('/proc/sys/kernel/perf_event_paranoid') != 0: if read_int('/proc/sys/kernel/perf_event_paranoid') != 0:
executor.hosts("sh -c 'echo 0 >/proc/sys/kernel/perf_event_paranoid'", root=True) executor.hosts("sh -c 'echo 0 >/proc/sys/kernel/perf_event_paranoid'", root=True)
mode = os.stat('/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_max_power_uw') mode = os.stat('/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_max_power_uw')
...@@ -93,7 +94,8 @@ class Mojitos: ...@@ -93,7 +94,8 @@ class Mojitos:
self.cmdline += ' -r' self.cmdline += ' -r'
if self.load: if self.load:
self.cmdline += ' -u' self.cmdline += ' -u'
self.cmdline += ' -o /dev/shm/monitoring_moj &' self.monitoring_file = '%s/monitoring_moj' % executor.tmp_dir
self.cmdline += ' -o %s &' % self.monitoring_file
def start(self): def start(self):
...@@ -110,8 +112,8 @@ class Mojitos: ...@@ -110,8 +112,8 @@ class Mojitos:
os.makedirs(filename_moj, exist_ok=True) os.makedirs(filename_moj, exist_ok=True)
if len(self.executor.hostnames) > 1: if len(self.executor.hostnames) > 1:
for hostname in self.executor.hostnames: for hostname in self.executor.hostnames:
self.executor.local('oarcp %s:/dev/shm/monitoring_moj %s/%s_%s_%s' % self.executor.local('oarcp %s:%s %s/%s_%s_%s' %
(hostname, filename_moj, hostname, benchname, beg_time)) (hostname, self.monitoring_file, filename_moj, hostname, benchname, beg_time))
else: else:
self.executor.local('cp /dev/shm/monitoring_moj %s/%s_%s_%s' % self.executor.local('cp %s %s/%s_%s_%s' %
(filename_moj, 'localhost', benchname, beg_time)) (self.monitoring_file, filename_moj, 'localhost', benchname, beg_time))
...@@ -57,8 +57,8 @@ class Power: ...@@ -57,8 +57,8 @@ class Power:
result = [(raw['uid'], raw['timestamps'],raw['values']) for raw in raws] result = [(raw['uid'], raw['timestamps'],raw['values']) for raw in raws]
else: else:
self.executor.local('cp /dev/shm/power_measures %s' % target) self.executor.local('cp /tmp/expetator_power_measures %s' % target)
with open('/dev/shm/power_measures') as file_id: with open('/tmp/expetator_power_measures') as file_id:
content = [line.split() for line in file_id.readlines()[1:]] content = [line.split() for line in file_id.readlines()[1:]]
content = [(int(t), float(p)) for t,p in content] content = [(int(t), float(p)) for t,p in content]
result = [('localhost',)+tuple(zip(*content))] result = [('localhost',)+tuple(zip(*content))]
......
...@@ -5,7 +5,7 @@ with open("README.md", "r") as fh: ...@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup( setuptools.setup(
name="expetator", name="expetator",
version="0.3.20", version="0.3.23",
author="Georges Da Costa", author="Georges Da Costa",
author_email="georges.da-costa@irit.fr", author_email="georges.da-costa@irit.fr",
description="A framework for monitoring HPC applications using DVFS", description="A framework for monitoring HPC applications using DVFS",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment