45 lines
1.1 KiB
C++
Executable File
45 lines
1.1 KiB
C++
Executable File
#include <iostream>
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "IO/hdf5_writer.h"
|
|
#include "simulation/errors.h"
|
|
#include "simulation/homebase.h"
|
|
#include "simulation/mpi_communication.h"
|
|
#include "simulation/parameter.h"
|
|
#include "simulation/simulation.h"
|
|
#include "tools/simulation_time.h"
|
|
|
|
int main(int argc, char* argv[]) {
|
|
SimulationTimer::eventStartPoint(std::string("Simulation"));
|
|
|
|
MpiCommunication::init(argc, argv);
|
|
|
|
std::string parameter_filename;
|
|
std::string homebase_folder;
|
|
|
|
for (int arg = 1; arg < argc; arg++) {
|
|
if (std::string(argv[arg]) == "--parameter_file") {
|
|
parameter_filename = std::string(argv[arg + 1]);
|
|
SIM_INFO("Using parameter file: " + parameter_filename);
|
|
}
|
|
}
|
|
|
|
if (parameter_filename.empty()) {
|
|
ERROR("Parameter filename not given.");
|
|
}
|
|
|
|
Simulation simulation(parameter_filename);
|
|
simulation.start();
|
|
simulation.finalize();
|
|
|
|
SimulationTimer::eventStopPoint(std::string("Simulation"));
|
|
if (MpiCommunication::mpiRank() == 0) {
|
|
SimulationTimer::printDurations();
|
|
}
|
|
|
|
MpiCommunication::finalize();
|
|
|
|
return 0;
|
|
}
|