forked from TUM-I5/MolSim
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from ManuelLerchner/performance_cluster
Performance cluster
- Loading branch information
Showing
24 changed files
with
269 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0"?> | ||
<!-- just a sanity check: body collision rewritten to xml --> | ||
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../simulation_schema.xsd"> | ||
|
||
<settings> | ||
<delta_t>0.01</delta_t> | ||
<end_time>5.0</end_time> | ||
<third_dimension>false</third_dimension> | ||
<particle_container> | ||
<directsum_container /> | ||
</particle_container> | ||
<forces> | ||
<LennardJones /> | ||
</forces> | ||
<interceptors> | ||
<ParticleUpdatesPerSecond /> | ||
</interceptors> | ||
</settings> | ||
|
||
|
||
<particle_source> | ||
</particle_source> | ||
|
||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include <array> | ||
#include <memory> | ||
|
||
#include "io/logger/Logger.h" | ||
#include "io/output/FileOutputHandler.h" | ||
#include "particles/containers/ParticleContainer.h" | ||
#include "particles/containers/directsum/DirectSumContainer.h" | ||
#include "particles/containers/linkedcells/LinkedCellsContainer.h" | ||
#include "particles/spawners/cuboid/CuboidSpawner.h" | ||
#include "physics/pairwiseforces/GravitationalForce.h" | ||
#include "physics/pairwiseforces/LennardJonesForce.h" | ||
#include "simulation/Simulation.h" | ||
#include "utils/ArrayUtils.h" | ||
|
||
void execute2DRectBenchmark(int rect_width, int rect_height, double spacing, double lc_cutoff) { | ||
Logger::logger->set_level(spdlog::level::info); | ||
Logger::logger->info("Starting 2DRect-benchmark. Dimensions {}x{}...", rect_width, rect_height); | ||
|
||
// Settings for the Linked Cells Container simulation | ||
std::array<double, 3> domain_size = {300, 300, 3}; | ||
std::array<LinkedCellsContainer::BoundaryCondition, 6> boundary_conditions = { | ||
LinkedCellsContainer::BoundaryCondition::REFLECTIVE, LinkedCellsContainer::BoundaryCondition::REFLECTIVE, | ||
LinkedCellsContainer::BoundaryCondition::REFLECTIVE, LinkedCellsContainer::BoundaryCondition::REFLECTIVE, | ||
LinkedCellsContainer::BoundaryCondition::REFLECTIVE, LinkedCellsContainer::BoundaryCondition::REFLECTIVE}; | ||
|
||
// Settings for the Cuboid spawner | ||
std::array<double, 3> center_offset = {domain_size[0] / 2, domain_size[1] / 2, domain_size[2] / 2}; | ||
CuboidSpawner spawner(center_offset - std::array<double, 3>{rect_width * spacing / 2, rect_height * spacing / 2, 0}, | ||
{rect_width, rect_height, 1}, spacing, 1, {0, 0, 0}, 0); | ||
|
||
std::vector<std::shared_ptr<PairwiseForceSource>> forces; | ||
forces.push_back(std::make_shared<LennardJonesForce>()); | ||
|
||
std::vector<Particle> particles_lc; | ||
spawner.spawnParticles(particles_lc); | ||
// Instantiation of the Linked Cells Container simulation | ||
SimulationParams params_lc{"2DParticleRect.xml", | ||
0.01, | ||
5, | ||
SimulationParams::LinkedCellsType{domain_size, lc_cutoff, boundary_conditions}, | ||
{}, | ||
{}, | ||
forces, | ||
true}; | ||
params_lc.num_particles = particles_lc.size(); | ||
Simulation simulation_lc(particles_lc, params_lc); | ||
// Simulating with Linked Cells Container | ||
params_lc.logSummary(); | ||
SimulationOverview linked_cells_data = simulation_lc.runSimulation(); | ||
linked_cells_data.logSummary(); | ||
linked_cells_data.savePerformanceDataCSV("Task4" + std::to_string(rect_width) + "x" + std::to_string(rect_height)); | ||
} | ||
|
||
int main() { | ||
execute2DRectBenchmark(100, 100, 1.1225, 3); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <io/logger/Logger.h> | ||
|
||
#include <filesystem> | ||
#include <string> | ||
|
||
#pragma once | ||
|
||
class FileLoader { | ||
public: | ||
/** | ||
* @brief Gets the path to the data directory | ||
* | ||
* Uses the cmake target_compile_definitions PRIVATE BENCHMARK_DATA_DIR to define the path to the data directory. | ||
*/ | ||
static std::string get_benchmark_data_dir() { | ||
#ifdef BENCHMARK_DATA_DIR | ||
return BENCHMARK_DATA_DIR; | ||
#else | ||
throw std::runtime_error("Error: BENCHMARK_DATA_DIR not defined"); | ||
#endif | ||
} | ||
|
||
/** | ||
* @brief Gets the path to a file in the input directory | ||
* | ||
* @param file_name The name of the file | ||
* @return std::filesystem::path The path to the file | ||
*/ | ||
static std::filesystem::path get_input_file_path(const std::string& file_name) { return {get_benchmark_data_dir() + "/" + file_name}; } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
#include <array> | ||
#include <memory> | ||
|
||
#include "io/logger/Logger.h" | ||
#include "io/output/FileOutputHandler.h" | ||
#include "particles/containers/ParticleContainer.h" | ||
#include "particles/containers/directsum/DirectSumContainer.h" | ||
#include "particles/containers/linkedcells/LinkedCellsContainer.h" | ||
#include "particles/spawners/cuboid/CuboidSpawner.h" | ||
#include "physics/pairwiseforces/GravitationalForce.h" | ||
#include "physics/pairwiseforces/LennardJonesForce.h" | ||
#include "physics/simpleforces/GlobalDownwardsGravity.h" | ||
#include "physics/thermostats/Thermostat.cpp" | ||
#include "simulation/Simulation.h" | ||
#include "simulation/interceptors/thermostat/ThermostatInterceptor.h" | ||
#include "utils/ArrayUtils.h" | ||
|
||
void execute2DRectBenchmark() { | ||
Logger::logger->set_level(spdlog::level::info); | ||
|
||
// Settings for the Linked Cells Container simulation | ||
std::array<double, 3> domain_size = {300, 54, 3}; | ||
std::array<LinkedCellsContainer::BoundaryCondition, 6> boundary_conditions = { | ||
LinkedCellsContainer::BoundaryCondition::PERIODIC, LinkedCellsContainer::BoundaryCondition::PERIODIC, | ||
LinkedCellsContainer::BoundaryCondition::REFLECTIVE, LinkedCellsContainer::BoundaryCondition::REFLECTIVE, | ||
LinkedCellsContainer::BoundaryCondition::OUTFLOW, LinkedCellsContainer::BoundaryCondition::OUTFLOW}; | ||
|
||
// Settings for the Cuboid spawner of task 2 | ||
CuboidSpawner spawner1({0.6, 2.0, 0.5}, {250, 20, 1}, 1.2, 1.0, {0.0, 0.0, 0.0}, static_cast<int>(0), 1.0, 1.2, false, 40); | ||
CuboidSpawner spawner2({0.6, 27.0, 0.5}, {250, 20, 1}, 1.2, 2.0, {0.0, 0.0, 0.0}, static_cast<int>(1), 1.0, 1.1, false, 40); | ||
|
||
std::vector<std::shared_ptr<PairwiseForceSource>> pairwise_forces; | ||
std::vector<std::shared_ptr<SimpleForceSource>> simple_force_sources; | ||
pairwise_forces.push_back(std::make_shared<LennardJonesForce>()); | ||
simple_force_sources.push_back(std::make_shared<GlobalDownwardsGravity>(12.44)); | ||
|
||
// Set the thermostat: | ||
Thermostat thermostat{40, std::numeric_limits<double>::infinity(), static_cast<size_t>(1000), false}; | ||
std::vector<std::shared_ptr<SimulationInterceptor>> simulation_interceptors; | ||
simulation_interceptors.push_back(std::make_shared<ThermostatInterceptor>(thermostat)); | ||
|
||
std::vector<Particle> particles_lc; | ||
spawner1.spawnParticles(particles_lc); | ||
spawner2.spawnParticles(particles_lc); | ||
// Instantiation of the Linked Cells Container simulation | ||
SimulationParams params_lc{"2DParticleRect.xml", | ||
0.0005, | ||
0.5, | ||
SimulationParams::LinkedCellsType{domain_size, 2.5, boundary_conditions}, | ||
simulation_interceptors, | ||
simple_force_sources, | ||
pairwise_forces, | ||
false, | ||
"./output"}; | ||
params_lc.num_particles = particles_lc.size(); | ||
Simulation simulation_lc(particles_lc, params_lc); | ||
// Simulating with Linked Cells Container | ||
params_lc.logSummary(); | ||
SimulationOverview linked_cells_data = simulation_lc.runSimulation(); | ||
linked_cells_data.logSummary(); | ||
linked_cells_data.savePerformanceDataCSV("Contest"); | ||
} | ||
|
||
int main() { | ||
execute2DRectBenchmark(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../src/io/xml_schemas/simulation_input/simulation_input_schema.xsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.