24#include <fmt/format.h>
26int main(
int argc,
char *argv[]) {
31 util::io::print(fmt::format(
"Initialized MPI. MPI size = {}, MPI rank = {}\n", mpiSize, mpiRank));
38 std::cout <<
"Syntax to run PeriDEM: PeriDEM -i <input file> -nThreads <number of threads>" << std::endl;
39 std::cout <<
"Example: PeriDEM -i input.yaml -nThreads 4" << std::endl;
43 unsigned int nThreads;
46 nThreads = std::thread::hardware_concurrency();
47 util::io::print(fmt::format(
"Running test with default number of threads = {}\n", nThreads));
54 std::cout <<
"PeriDEM"
59 auto begin = steady_clock::now();
66 if (deck->isPeriDEM()) {
70 std::cout <<
"PeriDEM model not found in input file.\n";
74 auto end = steady_clock::now();
76 std::cout <<
"Total simulation time (s) = "
size_t const MINOR_VERSION
size_t const UPDATE_VERSION
size_t const MAJOR_VERSION
A class for discrete element particle simulation with peridynamic model
virtual void run(inp::Input *deck)
Main driver to simulate.
void print(const T &msg, int nt=print_default_tab, int printMpiRank=print_default_mpi_rank)
Prints formatted information.
float timeDiff(std::chrono::steady_clock::time_point begin, std::chrono::steady_clock::time_point end, std::string unit="microseconds")
Returns difference between two times.
unsigned int getNThreads()
Get number of threads to be used by taskflow.
void initNThreads(unsigned int nThreads=std::thread::hardware_concurrency())
Initializes MpiStatus struct.
const MpiStatus * getMpiStatus()
Returns pointer to MpiStatus struct.
void initMpi(int argc=0, char *argv[]=nullptr)
Initializes MPI and also creates MpiStatus struct.
int mpiSize()
Get size (number) of processors.
int mpiRank()
get rank (id) of this processor