Commit 70208ba2 authored by Sebastian Eibl's avatar Sebastian Eibl

introduce mesa_pd module to official waLBerla

parent c4101e63
......@@ -1752,19 +1752,19 @@ conda-py36-linux:
- cd $CI_PROJECT_DIR/build
- cmake .. -DWALBERLA_BUFFER_DEBUG=OFF -DWALBERLA_BUILD_TESTS=OFF -DWALBERLA_BUILD_BENCHMARKS=ON -DWALBERLA_BUILD_TUTORIALS=OFF -DWALBERLA_BUILD_TOOLS=OFF -DWALBERLA_BUILD_WITH_MPI=ON -DWALBERLA_BUILD_WITH_CUDA=OFF -DWALBERLA_BUILD_WITH_PYTHON=OFF -DWALBERLA_BUILD_WITH_OPENMP=OFF -DCMAKE_BUILD_TYPE=RELEASE -DMPIEXEC_PREFLAGS=$MPIEXEC_PREFLAGS -DWALBERLA_DOUBLE_ACCURACY=ON -DWARNING_ERROR=ON -DWALBERLA_BUILD_WITH_METIS=OFF -DWALBERLA_BUILD_WITH_PARMETIS=OFF -DWALBERLA_OPTIMIZE_FOR_LOCALHOST=ON -DWALBERLA_BUILD_WITH_FASTMATH=ON -DWALBERLA_BUILD_WITH_LTO=ON
- cmake . -LAH
- cd apps/benchmarks/PeriodicGranularGas
- cd apps/benchmarks/GranularGas
- make -j 20
- export PATH=$PATH:/usr/local/likwid/bin
- likwid-setFrequencies -t 0
- likwid-setFrequencies -g performance
- likwid-setFrequencies -f 3.3 # set frequency to 3.3
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PeriodicGranularGas PeriodicGranularGas.cfg --DEM --syncNextNeighbor | tee PeriodicGranularGas_DEM_NN.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PeriodicGranularGas PeriodicGranularGas.cfg --DEM --syncShadowOwners | tee PeriodicGranularGas_DEM_SO.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PeriodicGranularGas PeriodicGranularGas.cfg --HCSITS --syncNextNeighbor --InelasticFrictionlessContact | tee PeriodicGranularGas_HCSITS_NN_IFC.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PeriodicGranularGas PeriodicGranularGas.cfg --HCSITS --syncNextNeighbor --ApproximateInelasticCoulombContactByDecoupling | tee PeriodicGranularGas_HCSITS_NN_AICCBD.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PeriodicGranularGas PeriodicGranularGas.cfg --HCSITS --syncNextNeighbor --InelasticCoulombContactByDecoupling | tee PeriodicGranularGas_HCSITS_NN_ICCBD.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PeriodicGranularGas PeriodicGranularGas.cfg --HCSITS --syncNextNeighbor --InelasticGeneralizedMaximumDissipationContact | tee PeriodicGranularGas_HCSITS_NN_IGMDC.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PeriodicGranularGas PeriodicGranularGas.cfg --HCSITS --syncShadowOwners --InelasticFrictionlessContact | tee PeriodicGranularGas_HCSITS_SO_IFC.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PE_GranularGas PE_Benchmark.cfg --DEM --syncNextNeighbor | tee GranularGas_DEM_NN.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PE_GranularGas PE_Benchmark.cfg --DEM --syncShadowOwners | tee GranularGas_DEM_SO.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PE_GranularGas PE_Benchmark.cfg --HCSITS --syncNextNeighbor --InelasticFrictionlessContact | tee GranularGas_HCSITS_NN_IFC.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PE_GranularGas PE_Benchmark.cfg --HCSITS --syncNextNeighbor --ApproximateInelasticCoulombContactByDecoupling | tee GranularGas_HCSITS_NN_AICCBD.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PE_GranularGas PE_Benchmark.cfg --HCSITS --syncNextNeighbor --InelasticCoulombContactByDecoupling | tee GranularGas_HCSITS_NN_ICCBD.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PE_GranularGas PE_Benchmark.cfg --HCSITS --syncNextNeighbor --InelasticGeneralizedMaximumDissipationContact | tee GranularGas_HCSITS_NN_IGMDC.txt
- mpirun --allow-run-as-root -np 8 --map-by core --bind-to core --report-bindings ./PE_GranularGas PE_Benchmark.cfg --HCSITS --syncShadowOwners --InelasticFrictionlessContact | tee GranularGas_HCSITS_SO_IFC.txt
- python3 upload.py
only:
variables:
......@@ -1773,22 +1773,17 @@ conda-py36-linux:
- docker-benchmark
artifacts:
paths:
- $CI_PROJECT_DIR/build/apps/benchmarks/PeriodicGranularGas/PeriodicGranularGas_DEM_NN.txt
- $CI_PROJECT_DIR/build/apps/benchmarks/PeriodicGranularGas/PeriodicGranularGas_DEM_SO.txt
- $CI_PROJECT_DIR/build/apps/benchmarks/PeriodicGranularGas/PeriodicGranularGas_HCSITS_NN_IFC.txt
- $CI_PROJECT_DIR/build/apps/benchmarks/PeriodicGranularGas/PeriodicGranularGas_HCSITS_NN_AICCBD.txt
- $CI_PROJECT_DIR/build/apps/benchmarks/PeriodicGranularGas/PeriodicGranularGas_HCSITS_NN_ICCBD.txt
- $CI_PROJECT_DIR/build/apps/benchmarks/PeriodicGranularGas/PeriodicGranularGas_HCSITS_NN_IGMDC.txt
- $CI_PROJECT_DIR/build/apps/benchmarks/PeriodicGranularGas/PeriodicGranularGas_HCSITS_SO_IFC.txt
- $CI_PROJECT_DIR/build/apps/benchmarks/GranularGas/*.txt
- $CI_PROJECT_DIR/build/apps/benchmarks/GranularGas/benchmark.sqlite
benchmark_intel19:
<<: *benchmark_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/intel:19
benchmark_gcc7:
benchmark_gcc8:
<<: *benchmark_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:7
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8
benchmark_clang7:
benchmark_clang8:
<<: *benchmark_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:7.0
\ No newline at end of file
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:8.0
......@@ -4,9 +4,10 @@ add_subdirectory( DEM )
add_subdirectory( MeshDistance )
add_subdirectory( CouetteFlow )
add_subdirectory( ForcesOnSphereNearPlaneInShearFlow )
add_subdirectory( GranularGas )
add_subdirectory( LennardJones )
add_subdirectory( NonUniformGrid )
add_subdirectory( MotionSingleHeavySphere )
add_subdirectory( PeriodicGranularGas )
add_subdirectory( PoiseuilleChannel )
add_subdirectory( ProbeVsExtraMessage )
add_subdirectory( SchaeferTurek )
......
waLBerla_link_files_to_builddir( *.cfg )
waLBerla_link_files_to_builddir( *.py )
waLBerla_add_executable ( NAME PE_GranularGas
FILES PE_GranularGas.cpp
DEPENDS blockforest core pe postprocessing )
waLBerla_add_executable ( NAME MESA_PD_GranularGas
FILES MESA_PD_GranularGas.cpp
DEPENDS blockforest core pe mesa_pd postprocessing vtk )
waLBerla_add_executable ( NAME MESA_PD_KernelBenchmark
FILES MESA_PD_KernelBenchmark.cpp
DEPENDS blockforest core pe mesa_pd postprocessing vtk )
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
from mesa_pd.accessor import Accessor
import mesa_pd.data as data
import mesa_pd.kernel as kernel
import mesa_pd.mpi as mpi
import argparse
import numpy as np
import os
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Generate all necessary files for the waLBerla mesa_pd module.')
parser.add_argument('path', help='Where should the files be created?')
parser.add_argument("-f", "--force", help="Generate the files even if not inside a waLBerla directory.",
action="store_true")
args = parser.parse_args()
if ((not os.path.isfile(args.path + "/src/walberla.h")) and (not args.force)):
raise RuntimeError(args.path + " is not the path to a waLBerla root directory! Specify -f to generate the files anyway.")
os.makedirs(args.path + "/src/mesa_pd/common", exist_ok = True)
os.makedirs(args.path + "/src/mesa_pd/data", exist_ok = True)
os.makedirs(args.path + "/src/mesa_pd/domain", exist_ok = True)
os.makedirs(args.path + "/src/mesa_pd/kernel", exist_ok = True)
os.makedirs(args.path + "/src/mesa_pd/mpi/notifications", exist_ok = True)
os.makedirs(args.path + "/src/mesa_pd/vtk", exist_ok = True)
shapes = ["Sphere", "HalfSpace"]
ps = data.ParticleStorage()
ch = data.ContactHistory()
lc = data.LinkedCells()
ss = data.ShapeStorage(ps, shapes)
ps.addProperty("position", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="ALWAYS")
ps.addProperty("linearVelocity", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="ALWAYS")
ps.addProperty("invMass", "walberla::real_t", defValue="real_t(1)", syncMode="COPY")
ps.addProperty("force", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="NEVER")
ps.addProperty("shapeID", "size_t", defValue="", syncMode="COPY")
ps.addProperty("rotation", "walberla::mesa_pd::Rot3", defValue="", syncMode="ALWAYS")
ps.addProperty("angularVelocity", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="ALWAYS")
ps.addProperty("torque", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="NEVER")
ps.addProperty("type", "uint_t", defValue="0", syncMode="COPY")
ps.addProperty("flags", "walberla::mesa_pd::data::particle_flags::FlagT", defValue="", syncMode="COPY")
ps.addProperty("nextParticle", "int", defValue="-1", syncMode="NEVER")
kernels = []
kernels.append( kernel.DoubleCast(shapes) )
kernels.append( kernel.ExplicitEuler() )
kernels.append( kernel.ExplicitEulerWithShape() )
kernels.append( kernel.ForceLJ() )
kernels.append( kernel.HeatConduction() )
kernels.append( kernel.InsertParticleIntoLinkedCells() )
kernels.append( kernel.LinearSpringDashpot() )
kernels.append( kernel.NonLinearSpringDashpot() )
kernels.append( kernel.SingleCast(shapes) )
kernels.append( kernel.SpringDashpot() )
kernels.append( kernel.TemperatureIntegration() )
kernels.append( kernel.VelocityVerlet() )
kernels.append( kernel.VelocityVerletWithShape() )
ac = Accessor()
for k in kernels:
ac.mergeRequirements(k.getRequirements())
ac.printSummary()
comm = []
comm.append(mpi.BroadcastProperty())
comm.append(mpi.ClearNextNeighborSync())
comm.append(mpi.ReduceContactHistory())
comm.append(mpi.ReduceProperty())
comm.append(mpi.SyncNextNeighbors(ps))
ps.generate(args.path + "/src/mesa_pd/")
ch.generate(args.path + "/src/mesa_pd/")
lc.generate(args.path + "/src/mesa_pd/")
ss.generate(args.path + "/src/mesa_pd/")
for k in kernels:
k.generate(args.path + "/src/mesa_pd/")
for c in comm:
c.generate(args.path + "/src/mesa_pd/")
GranularGas
{
simulationCorner < 0, 0, 0 >;
simulationDomain < 6, 6, 6 >;
blocks < 2,2,2 >;
isPeriodic < 1, 1, 1 >;
radius 0.6;
spacing 1.0;
vMax 0.0;
dt 0.0001;
simulationSteps 500;
visSpacing 100;
HCSITSmaxIterations 10;
HCSITSRelaxationParameter 0.7;
HCSITSErrorReductionParameter 0.8;
HCSITSRelaxationModelStr ApproximateInelasticCoulombContactByDecoupling;
globalLinearAcceleration < 0, 0, 0 >;
}
This diff is collapsed.
This diff is collapsed.
PeriodicGranularGas
GranularGas
{
simulationCorner < 0, 0, 0 >;
simulationDomain < 30, 30, 30 >;
......
import os
import time
import math
import random
import re
from influxdb import InfluxDBClient
from git import Repo
class Upload:
def __init__(self):
try:
self.write_user_pw = os.environ["INFLUXDB_WRITE_USER"]
except KeyError:
import sys
print('Password for the InfluxDB write_user was not set.\n',
'See https://docs.gitlab.com/ee/ci/variables/#secret-variables', file=sys.stderr)
exc_info = sys.exc_info()
raise exc_info[0].with_traceback(exc_info[1], exc_info[2])
self.client = InfluxDBClient('i10grafana.informatik.uni-erlangen.de', 8086,
'pe', self.write_user_pw, 'pe')
def process(self, filename, model, friction, sync, parallelization):
with open(filename) as f:
s = f.read()
m = re.search('PUpS: (\S*)', s)
json_body = [
{
'measurement': 'pe_benchmark',
'tags': {
'host' : os.uname()[1],
'image' : os.environ["DOCKER_IMAGE_NAME"],
'model' : model,
'friction' : friction,
'sync' : sync,
'parallelization' : parallelization
},
'time': int(time.time()),
'fields': {'PUpS': float(m.group(1))}
}
]
print(float(m.group(1)))
self.client.write_points(json_body, time_precision='s')
if __name__ == "__main__":
up = Upload()
up.process("GranularGas_DEM_NN.txt", "DEM", "Coulomb", "next neighbors", "8P1T")
up.process("GranularGas_DEM_SO.txt", "DEM", "Coulomb", "shadow owners", "8P1T")
up.process("GranularGas_HCSITS_NN_IFC.txt", "HCSITS", "InelasticFrictionlessContact", "next neighbors", "8P1T")
up.process("GranularGas_HCSITS_NN_AICCBD.txt", "HCSITS", "ApproximateInelasticCoulombContactByDecoupling", "next neighbors", "8P1T")
up.process("GranularGas_HCSITS_NN_ICCBD.txt", "HCSITS", "InelasticCoulombContactByDecoupling", "next neighbors", "8P1T")
up.process("GranularGas_HCSITS_NN_IGMDC.txt", "HCSITS", "InelasticGeneralizedMaximumDissipationContact", "next neighbors", "8P1T")
up.process("GranularGas_HCSITS_SO_IFC.txt", "HCSITS", "InelasticFrictionlessContact", "shadow owners", "8P1T")
waLBerla_link_files_to_builddir( *.cfg )
waLBerla_link_files_to_builddir( *.py )
waLBerla_add_executable ( NAME PeriodicGranularGas
FILES PeriodicGranularGas.cpp
waLBerla_add_executable ( NAME LennardJones
FILES LennardJones.cpp
DEPENDS blockforest core pe )
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file LennardJones.cpp
//! \author Sebastian Eibl <sebastian.eibl@fau.de>
//
//======================================================================================================================
#include <pe/basic.h>
#include <pe/vtk/SphereVtkOutput.h>
#include <blockforest/Initialization.h>
#include <core/Abort.h>
#include <core/Environment.h>
#include <core/grid_generator/SCIterator.h>
#include <core/logging/Logging.h>
#include <core/math/Random.h>
#include <core/waLBerlaBuildInfo.h>
#include <vtk/VTKOutput.h>
#include <functional>
#include <memory>
#include <tuple>
namespace walberla {
using namespace walberla::pe;
using namespace walberla::timing;
using BodyTuple = std::tuple<Sphere> ;
inline
void LJ(RigidBody& bd1, RigidBody& bd2)
{
if (bd1.getSystemID() != bd2.getSystemID())
{
Vec3 dir = bd1.getPosition() - bd2.getPosition();
const real_t inv_d = real_t(1) / length(dir);
dir *= inv_d;
WALBERLA_ASSERT_FLOAT_EQUAL(length(dir),
real_t(1),
"direction not normalized: " << dir);
const real_t sr = real_t(1.21) * inv_d;
const real_t sr6 = (sr*sr*sr)*(sr*sr*sr);
const real_t force = real_t(4) * real_t(2.12) * sr6 * ( sr6 - 1 );
bd1.addForce(force * dir);
}
}
inline
void integrate(RigidBody& bd)
{
bd.setLinearVel( bd.getForce() * real_t(0.01) + bd.getLinearVel() );
bd.setPosition( bd.getLinearVel() * real_t(0.01) + bd.getPosition() );
bd.setForce( Vec3( real_t(0) ) );
}
int main( int argc, char ** argv )
{
Environment env(argc, argv);
logging::Logging::instance()->setStreamLogLevel(logging::Logging::INFO);
logging::Logging::instance()->setFileLogLevel(logging::Logging::INFO);
WALBERLA_LOG_INFO_ON_ROOT( "config file: " << argv[1] )
WALBERLA_LOG_INFO_ON_ROOT( "waLBerla Revision: " << WALBERLA_GIT_SHA1 );
math::seedRandomGenerator( static_cast<unsigned int>(1337 * mpi::MPIManager::instance()->worldRank()) );
WALBERLA_LOG_INFO_ON_ROOT("*** GLOBALBODYSTORAGE ***");
shared_ptr<BodyStorage> globalBodyStorage = make_shared<BodyStorage>();
WALBERLA_LOG_INFO_ON_ROOT("*** BLOCKFOREST ***");
//domain setup
const real_t spacing = real_t(1.0);
math::AABB domain( Vec3(real_t(-0.5), real_t(-0.5), real_t(-0.5)),
Vec3(real_t(+0.5), real_t(+0.5), real_t(+0.5)));
domain.scale(real_t(20));
// create forest
auto forest = blockforest::createBlockForest(domain,
Vector3<uint_t>(1,1,1),
Vector3<bool>(false, false, false));
if (!forest)
{
WALBERLA_LOG_INFO_ON_ROOT( "No BlockForest created ... exiting!");
return EXIT_SUCCESS;
}
WALBERLA_LOG_INFO_ON_ROOT("simulationDomain: " << forest->getDomain());
WALBERLA_LOG_INFO_ON_ROOT("blocks: " << Vector3<uint_t>(forest->getXSize(), forest->getYSize(), forest->getZSize()) );
WALBERLA_LOG_INFO_ON_ROOT("*** BODYTUPLE ***");
// initialize body type ids
SetBodyTypeIDs<BodyTuple>::execute();
WALBERLA_LOG_INFO_ON_ROOT("*** STORAGEDATAHANDLING ***");
// add block data
auto storageID = forest->addBlockData(createStorageDataHandling<BodyTuple>(), "Storage");
auto ccdID = forest->addBlockData(ccd::createHashGridsDataHandling( globalBodyStorage, storageID ), "CCD");
auto fcdID = forest->addBlockData(fcd::createGenericFCDDataHandling<BodyTuple, fcd::AnalyticCollideFunctor>(), "FCD");
WALBERLA_UNUSED(ccdID);
WALBERLA_UNUSED(fcdID);
WALBERLA_LOG_INFO_ON_ROOT("*** SYNCCALL ***");
std::function<void(void)> syncCallWithoutTT;
syncCallWithoutTT = std::bind( pe::syncNextNeighbors<BodyTuple>, std::ref(*forest), storageID, static_cast<WcTimingTree*>(nullptr), real_c(0.1), false );
WALBERLA_LOG_INFO_ON_ROOT("Using NextNeighbor sync!");
WALBERLA_LOG_INFO_ON_ROOT("*** VTK ***");
auto vtkDomainOutput = vtk::createVTKOutput_DomainDecomposition( forest, "domain_decomposition", 1, "vtk_out", "simulation_step" );
auto vtkSphereHelper = make_shared<SphereVtkOutput>(storageID, *forest) ;
auto vtkSphereOutput = vtk::createVTKOutput_PointData(vtkSphereHelper, "Bodies", 1, "vtk_out", "simulation_step", false, false);
WALBERLA_LOG_INFO_ON_ROOT("*** SETUP - START ***");
auto simulationDomain = forest->getDomain();
const auto& generationDomain = simulationDomain; // simulationDomain.getExtended(-real_c(0.5) * spacing);
//initialize particles
uint_t numParticles(0);
for (auto it = grid_generator::SCIterator(generationDomain, Vec3(spacing, spacing, spacing) * real_c(0.5), spacing);
it != grid_generator::SCIterator();
++it)
{
SphereID sp = createSphere(*globalBodyStorage, *forest, storageID, 0, *it, real_t(1));
if (sp!=nullptr)
{
sp->setLinearVel( math::realRandom(real_t(-1), real_t(+1)),
math::realRandom(real_t(-1), real_t(+1)),
math::realRandom(real_t(-1), real_t(+1)));
++numParticles;
}
}
mpi::reduceInplace(numParticles, mpi::SUM);
WALBERLA_LOG_INFO_ON_ROOT("#particles created: " << numParticles);
WALBERLA_LOG_INFO_ON_ROOT("*** SETUP - END ***");
// synchronize particles
//syncCallWithoutTT();
//syncCallWithoutTT();
WALBERLA_LOG_INFO_ON_ROOT("*** SIMULATION - START ***");
WALBERLA_MPI_BARRIER();
WcTimer timer;
for (int i=0; i < 1000; ++i)
{
WALBERLA_LOG_DEVEL(i);
for (auto& blk : *forest)
{
Storage* storage = blk.getData< Storage >( storageID );
BodyStorage& localStorage = (*storage)[0];
for (auto& bd1 : localStorage)
{
for (auto& bd2 : localStorage)
{
LJ(bd1, bd2);
}
}
const real_t coeff = real_t(0.2);
for (auto& bd : localStorage)
{
bd.addForce( -coeff*bd.getPosition() );
}
}
for (auto& blk : *forest)
{
Storage* storage = blk.getData< Storage >( storageID );
BodyStorage& localStorage = (*storage)[0];
for (auto& bd : localStorage)
{
integrate(bd);
}
}
vtkSphereOutput->write( );
//syncCallWithoutTT();
}
WALBERLA_MPI_BARRIER();
timer.end();
WALBERLA_LOG_INFO_ON_ROOT("runtime: " << timer.average());
WALBERLA_LOG_INFO_ON_ROOT("*** SIMULATION - END ***");
return EXIT_SUCCESS;
}
} // namespace walberla
int main( int argc, char* argv[] )
{
return walberla::main( argc, argv );
}
import os
import time
import math
import random
import re
from influxdb import InfluxDBClient
from git import Repo
def main():
try:
write_user_pw = os.environ["INFLUXDB_WRITE_USER"]
except KeyError:
import sys
print('Password for the InfluxDB write_user was not set.\n',
'See https://docs.gitlab.com/ee/ci/variables/#secret-variables', file=sys.stderr)
exc_info = sys.exc_info()
raise exc_info[0].with_traceback(exc_info[1], exc_info[2])
client = InfluxDBClient('i10grafana.informatik.uni-erlangen.de', 8086,
'pe', write_user_pw, 'pe')
#repo = Repo(search_parent_directories=True)
#commit = repo.head.commit
with open("PeriodicGranularGas_DEM_NN.txt") as f:
s = f.read()
m = re.search('runtime: (\d*.\d*)', s)
json_body = [
{
'measurement': 'pe_benchmark',
'tags': {
'host' : os.uname()[1],
'image' : os.environ["DOCKER_IMAGE_NAME"],
'model' : 'DEM',
'friction': 'Coulomb',
'sync' : 'next neighbor'
},
'time': int(time.time()),
'fields': {'runtime': float(m.group(1))}
}
]
print(float(m.group(1)))
client.write_points(json_body, time_precision='s')
#*************************************************
with open("PeriodicGranularGas_DEM_SO.txt") as f:
s = f.read()
m = re.search('runtime: (\d*.\d*)', s)
json_body = [
{
'measurement': 'pe_benchmark',
'tags': {
'host' : os.uname()[1],
'image' : os.environ["DOCKER_IMAGE_NAME"],
'model' : 'DEM',
'friction': 'Coulomb',
'sync' : 'shadow owner'
},
'time': int(time.time()),
'fields': {'runtime': float(m.group(1))}
}
]
print(float(m.group(1)))
client.write_points(json_body, time_precision='s')
#*************************************************
with open("PeriodicGranularGas_HCSITS_NN_IFC.txt") as f:
s = f.read()
m = re.search('runtime: (\d*.\d*)', s)
json_body = [
{
'measurement': 'pe_benchmark',
'tags': {
'host' : os.uname()[1],
'image' : os.environ["DOCKER_IMAGE_NAME"],
'model' : 'HCSITS',
'friction': 'InelasticFrictionlessContact',
'sync' : 'next neighbor'
},
'time': int(time.time()),
'fields': {'runtime': float(m.group(1))}
}
]
print(float(m.group(1)))
client.write_points(json_body, time_precision='s')
#*************************************************
with open("PeriodicGranularGas_HCSITS_NN_AICCBD.txt") as f:
s = f.read()
m = re.search('runtime: (\d*.\d*)', s)
json_body = [
{
'measurement': 'pe_benchmark',
'tags': {
'host' : os.uname()[1],
'image' : os.environ["DOCKER_IMAGE_NAME"],
'model' : 'HCSITS',
'friction': 'ApproximateInelasticCoulombContactByDecoupling',
'sync' : 'next neighbor'
},
'time': int(time.time()),
'fields': {'runtime': float(m.group(1))}
}
]
print(float(m.group(1)))
client.write_points(json_body, time_precision='s')
#*************************************************
with open("PeriodicGranularGas_HCSITS_NN_ICCBD.txt") as f:
s = f.read()
m = re.search('runtime: (\d*.\d*)', s)