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

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 >;
......
......@@ -13,7 +13,7 @@
// 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 PeriodicGranularGas.cpp
//! \file PE_GranularGas.cpp
//! \author Sebastian Eibl <sebastian.eibl@fau.de>
//
//======================================================================================================================
......@@ -27,8 +27,10 @@
#include <core/math/Random.h>
#include <core/grid_generator/SCIterator.h>
#include <core/logging/Logging.h>
#include <core/OpenMP.h>
#include <core/timing/TimingTree.h>
#include <core/waLBerlaBuildInfo.h>
#include <postprocessing/sqlite/SQLite.h>
#include <vtk/VTKOutput.h>
#include <functional>
......@@ -39,7 +41,7 @@ namespace walberla {
using namespace walberla::pe;
using namespace walberla::timing;
using BodyTuple = std::tuple<Sphere> ;
using BodyTuple = std::tuple<Sphere, Plane> ;
int main( int argc, char ** argv )
{
......@@ -83,9 +85,27 @@ int main( int argc, char ** argv )
WALBERLA_LOG_INFO_ON_ROOT("*** READING CONFIG FILE ***");
auto cfg = env.config();
if (cfg == nullptr) WALBERLA_ABORT("No config specified!");
const Config::BlockHandle mainConf = cfg->getBlock( "PeriodicGranularGas" );
const Config::BlockHandle mainConf = cfg->getBlock( "GranularGas" );
int simulationSteps = mainConf.getParameter<int>("simulationSteps", 10 );
const std::string host = mainConf.getParameter<std::string>("host", "none" );
WALBERLA_LOG_INFO_ON_ROOT("host: " << host);
const int jobid = mainConf.getParameter<int>("jobid", 0 );
WALBERLA_LOG_INFO_ON_ROOT("jobid: " << jobid);
const real_t spacing = mainConf.getParameter<real_t>("spacing", real_t(1.0) );
WALBERLA_LOG_INFO_ON_ROOT("spacing: " << spacing);
const real_t radius = mainConf.getParameter<real_t>("radius", real_t(0.5) );
WALBERLA_LOG_INFO_ON_ROOT("radius: " << radius);
bool bBarrier = false;
WALBERLA_LOG_INFO_ON_ROOT("bBarrier: " << bBarrier);
int64_t numOuterIterations = mainConf.getParameter<int64_t>("numOuterIterations", 10 );
WALBERLA_LOG_INFO_ON_ROOT("numOuterIterations: " << numOuterIterations);
int64_t simulationSteps = mainConf.getParameter<int64_t>("simulationSteps", 10 );
WALBERLA_LOG_INFO_ON_ROOT("simulationSteps: " << simulationSteps);
real_t dt = mainConf.getParameter<real_t>("dt", real_c(0.01) );
......@@ -96,6 +116,9 @@ int main( int argc, char ** argv )
const std::string path = mainConf.getParameter<std::string>("path", "vtk_out" );
WALBERLA_LOG_INFO_ON_ROOT("path: " << path);
const std::string sqlFile = mainConf.getParameter<std::string>("sqlFile", "benchmark.sqlite" );
WALBERLA_LOG_INFO_ON_ROOT("sqlFile: " << sqlFile);
WALBERLA_LOG_INFO_ON_ROOT("*** GLOBALBODYSTORAGE ***");
shared_ptr<BodyStorage> globalBodyStorage = make_shared<BodyStorage>();
......@@ -182,16 +205,13 @@ int main( int argc, char ** argv )
auto vtkSphereOutput = vtk::createVTKOutput_PointData(vtkSphereHelper, "Bodies", 1, "vtk_out", "simulation_step", false, false);
WALBERLA_LOG_INFO_ON_ROOT("*** SETUP - START ***");
const real_t static_cof ( real_c(0.1) / 2 ); // Coefficient of static friction. Note: pe doubles the input coefficient of friction for material-material contacts.
const real_t dynamic_cof ( static_cof ); // Coefficient of dynamic friction. Similar to static friction for low speed friction.
MaterialID material = createMaterial( "granular", real_t( 1.0 ), 0, static_cof, dynamic_cof, real_t( 0.5 ), 1, 1, 0, 0 );
//const real_t static_cof ( real_c(0.1) / 2 ); // Coefficient of static friction. Note: pe doubles the input coefficient of friction for material-material contacts.
//const real_t dynamic_cof ( static_cof ); // Coefficient of dynamic friction. Similar to static friction for low speed friction.
MaterialID material = createMaterial( "granular", real_t( 1.0 ), 0, 0, 0, real_t( 0.5 ), 1, real_t(1e-6), 0, 0 );
auto simulationDomain = forest->getDomain();
const auto& generationDomain = simulationDomain; // simulationDomain.getExtended(-real_c(0.5) * spacing);
const real_t spacing(1.0);
const real_t radius(0.5);
uint_t numParticles = uint_c(0);
int64_t numParticles = 0;
for (auto& currentBlock : *forest)
{
......@@ -204,6 +224,22 @@ int main( int argc, char ** argv )
mpi::reduceInplace(numParticles, mpi::SUM);
WALBERLA_LOG_INFO_ON_ROOT("#particles created: " << numParticles);
if (!forest->isPeriodic(0))
{
createPlane(*globalBodyStorage, 0, Vec3(+1,0,0), forest->getDomain().minCorner());
createPlane(*globalBodyStorage, 0, Vec3(-1,0,0), forest->getDomain().maxCorner());
}
if (!forest->isPeriodic(1))
{
createPlane(*globalBodyStorage, 0, Vec3(0,+1,0), forest->getDomain().minCorner());
createPlane(*globalBodyStorage, 0, Vec3(0,-1,0), forest->getDomain().maxCorner());
}
if (!forest->isPeriodic(2))
{
createPlane(*globalBodyStorage, 0, Vec3(0,0,+1), forest->getDomain().minCorner());
createPlane(*globalBodyStorage, 0, Vec3(0,0,-1), forest->getDomain().maxCorner());
}
WALBERLA_LOG_INFO_ON_ROOT("*** SETUP - END ***");
// synchronize particles
......@@ -211,51 +247,103 @@ int main( int argc, char ** argv )
syncCallWithoutTT();
WALBERLA_LOG_INFO_ON_ROOT("*** SIMULATION - START ***");
WALBERLA_MPI_BARRIER();
WcTimer timer;
for (int i=0; i < simulationSteps; ++i)
for (int64_t outerIteration = 0; outerIteration < numOuterIterations; ++outerIteration)
{
if( i % 200 == 0 )
WALBERLA_LOG_INFO_ON_ROOT("*** RUNNING OUTER ITERATION " << outerIteration << " ***");
WALBERLA_MPI_BARRIER();
WcTimer timer;
WcTimingPool tp;
for (int64_t i=0; i < simulationSteps; ++i)
{
WALBERLA_LOG_DEVEL_ON_ROOT( "Timestep " << i << " / " << simulationSteps );
if( i % 200 == 0 )
{
WALBERLA_LOG_DEVEL_ON_ROOT( "Timestep " << i << " / " << simulationSteps );
}
tp["CR"].start();
cr->timestep( real_c(dt) );
tp["CR"].end();
tp["Sync"].start();
syncCallWithoutTT();
tp["Sync"].end();
//if( i % visSpacing == 0 )
//{
// vtkDomainOutput->write( );
// vtkSphereOutput->write( );
//}
}
WALBERLA_MPI_BARRIER();
timer.end();
WALBERLA_LOG_INFO_ON_ROOT("runtime: " << timer.average());
auto PUpS = real_c(numParticles) * real_c(simulationSteps) / timer.average();
WALBERLA_LOG_INFO_ON_ROOT("PUpS: " << PUpS);
auto tp_reduced = tp.getReduced();
WALBERLA_LOG_INFO_ON_ROOT(*tp_reduced);
WALBERLA_LOG_INFO_ON_ROOT("*** SIMULATION - END ***");
auto temp = tt.getReduced( );
WALBERLA_ROOT_SECTION()
{
std::cout << temp;
}
cr->timestep( real_c(dt) );
syncCallWithoutTT();
// if( i % visSpacing == 0 )
// {
// vtkDomainOutput->write( );
// vtkSphereOutput->write( );
// }
}
WALBERLA_MPI_BARRIER();
timer.end();
WALBERLA_LOG_INFO_ON_ROOT("runtime: " << timer.average());
WALBERLA_LOG_INFO_ON_ROOT("*** SIMULATION - END ***");
auto temp = tt.getReduced( );
WALBERLA_ROOT_SECTION()
{
std::cout << temp;
}
WALBERLA_LOG_INFO_ON_ROOT("*** CHECKING RESULT - START ***");
for (auto& currentBlock : *forest)
{
Storage * storage = currentBlock.getData< Storage >( storageID );
BodyStorage& localStorage = (*storage)[0];
WALBERLA_LOG_INFO_ON_ROOT("*** CHECKING RESULT - START ***");
numParticles = 0;
int64_t numGhostParticles = 0;
for (auto& currentBlock : *forest)
{
Storage * storage = currentBlock.getData< Storage >( storageID );
BodyStorage& localStorage = (*storage)[0];
BodyStorage& shadowStorage = (*storage)[1];
numParticles += localStorage.size();
numGhostParticles += shadowStorage.size();
auto bodyIt = localStorage.begin();
for (auto it = grid_generator::SCIterator(currentBlock.getAABB().getIntersection(generationDomain), Vector3<real_t>(spacing, spacing, spacing) * real_c(0.5), spacing);
it != grid_generator::SCIterator();
++it, ++bodyIt)
{
WALBERLA_CHECK_UNEQUAL(bodyIt, localStorage.end());
WALBERLA_CHECK_FLOAT_EQUAL(bodyIt->getPosition(), *it);
}
}
mpi::reduceInplace(numParticles, mpi::SUM);
mpi::reduceInplace(numGhostParticles, mpi::SUM);
WALBERLA_LOG_INFO_ON_ROOT("*** CHECKING RESULT - END ***");
auto bodyIt = localStorage.begin();
for (auto it = grid_generator::SCIterator(currentBlock.getAABB().getIntersection(generationDomain), Vector3<real_t>(spacing, spacing, spacing) * real_c(0.5), spacing);
it != grid_generator::SCIterator();
++it, ++bodyIt)
WALBERLA_ROOT_SECTION()
{
WALBERLA_CHECK_UNEQUAL(bodyIt, localStorage.end());
WALBERLA_CHECK_FLOAT_EQUAL(bodyIt->getPosition(), *it);
std::map< std::string, walberla::int64_t > integerProperties;
std::map< std::string, double > realProperties;
std::map< std::string, std::string > stringProperties;
stringProperties["walberla_git"] = WALBERLA_GIT_SHA1;
stringProperties["tag"] = "pe";
stringProperties["host"] = host;
integerProperties["jobid"] = jobid;
integerProperties["bDEM"] = bDEM;
integerProperties["bNN"] = bNN;
integerProperties["mpi_num_processes"] = mpi::MPIManager::instance()->numProcesses();
integerProperties["omp_max_threads"] = omp_get_max_threads();
integerProperties["numOuterIterations"] = numOuterIterations;
integerProperties["simulationSteps"] = simulationSteps;
integerProperties["bBarrier"] = int64_c(bBarrier);
realProperties["PUpS"] = double_c(PUpS);
integerProperties["num_particles"] = numParticles;
integerProperties["num_ghost_particles"] = numGhostParticles;
integerProperties["blocks_x"] = int64_c(forest->getXSize());
integerProperties["blocks_y"] = int64_c(forest->getXSize());
integerProperties["blocks_z"] = int64_c(forest->getXSize());
realProperties["domain_x"] = double_c(forest->getDomain().xSize());
realProperties["domain_y"] = double_c(forest->getDomain().ySize());
realProperties["domain_z"] = double_c(forest->getDomain().zSize());
auto runId = postprocessing::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *tp_reduced, "Timeloop" );
}
WALBERLA_LOG_INFO_ON_ROOT("*** SQL OUTPUT - END ***");
}
WALBERLA_LOG_INFO_ON_ROOT("*** CHECKING RESULT - END ***");
return EXIT_SUCCESS;
}
......@@ -263,5 +351,5 @@ int main( int argc, char ** argv )
int main( int argc, char* argv[] )
{
return walberla::main( argc, argv );
return walberla::main( argc, argv );
}
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;