Commit a8506442 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

updated mlmc_mppy

parent d2dad773
Pipeline #71421 canceled with stage
......@@ -6,9 +6,9 @@ import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from mpp.python.mppy import *
from mpp.python.mppy import Mpp, PROJECT_ROOT_DIR, PROJECT_PY_DATA_DIR
SPRNG5_DIR = PROJECT_ROOT_DIR + '/sprng5'
SPRNG5_DIR = os.path.abspath(os.path.join(PROJECT_ROOT_DIR, 'sprng5'))
class MLMCMpp(Mpp):
......@@ -23,27 +23,13 @@ class MLMCMpp(Mpp):
super().__init__()
self.executable = 'MLMC-M++'
def setup_cluster(self, silent=False):
super().setup_cluster()
stdout = subprocess.Popen(['module', 'add', 'FFTW'], cwd=PROJECT_ROOT_DIR,
stdout=subprocess.PIPE)
self.print_stdout(stdout, silent)
def build_sprng5(self, silent=False):
print('\n================ build sprng5 ================\n')
if not os.path.exists(SPRNG5_DIR + '/lib/libsprng.a'):
stdout = subprocess.Popen(['tar', 'xjf', 'sprng5.tar.bz2'],
cwd=PROJECT_ROOT_DIR,
stdout=subprocess.PIPE)
self.print_stdout(stdout, silent)
stdout = subprocess.Popen(['./configure', '--with-mpi=yes',
'--with-fortran=no'],
cwd=SPRNG5_DIR,
stdout=subprocess.PIPE)
self.print_stdout(stdout, silent)
stdout = subprocess.Popen(['make', '-j'], cwd=SPRNG5_DIR,
stdout=subprocess.PIPE)
self.print_stdout(stdout, silent)
self.run_subprocess(['tar', 'xjf', 'sprng5.tar.bz2'], cwd=PROJECT_ROOT_DIR)
self.run_subprocess(['./configure', '--with-mpi=yes', '--with-fortran=no'],
cwd=SPRNG5_DIR)
self.run_subprocess(['make', '-j'], cwd=SPRNG5_DIR)
def build(self, silent=False):
self.build_sprng5(silent)
......@@ -209,7 +195,8 @@ class MLMCMpp(Mpp):
self.plot_convergence_table(df, axes, label)
if plot_name is not None:
path = PROJECT_PY_DATA_DIR + 'Convergence_{}_{}.png'.format(plot_name, self.now)
path = PROJECT_PY_DATA_DIR + 'Convergence_{}_{}.png'.format(plot_name,
self.now)
plt.savefig(path)
else:
plt.show()
......
Supports Markdown
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