forked from Green-Phys/green-mbpt
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
55 lines (47 loc) · 1.96 KB
/
main.cpp
File metadata and controls
55 lines (47 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Copyright (c) 2023 University of Michigan
*
*/
#include <green/mbpt/dyson.h>
#include <green/mbpt/mbpt_run.h>
#include <green/sc/sc_loop.h>
#include <mpi.h>
template <typename A>
auto init_solver(const green::params::params p) {}
int main(int argc, char** argv) {
MPI_Init(&argc, &argv);
green::utils::context;
std::string hashes = std::string(GIT_HASHES);
int pos;
while ((pos = hashes.find("**")) != std::string::npos) hashes.replace(pos, 2, "\n");
std::string name = R"(
█▀▀█ █▀▀█ █▀▀ █▀▀ █▀▀▄
█ ▄▄ █▄▄▀ █▀▀ █▀▀ █ █
█▄▄█ ▀ ▀▀ ▀▀▀ ▀▀▀ ▀ ▀
█ █ █▀▀ █▀▀█ █ █ █▀▀█ █▀▀█ █ █ █▀▀█ █ ▀ █▀▀▄ █▀▀▀
█ █ █ █▀▀ █▄▄█ █▀▄ ▀▀ █ █ █ █ █ █ █ █ ▀█▀ █ █ █ ▀█
█▄▀▄█ ▀▀▀ ▀ ▀ ▀ ▀ █▄▄█ ▀▀▀▀ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀▀▀▀)";
auto p = green::params::params(
name + "\n\nMichigan Weak-Coupling Many-Body perturbation solver.\n\n=====================================\nGit hashes:\n" +
hashes + "\n=====================================");
green::sc::define_parameters(p);
green::symmetry::define_parameters(p);
green::grids::define_parameters(p);
green::mbpt::define_parameters(p);
if (!p.parse(argc, argv)) {
if (!green::utils::context.global_rank) p.help();
MPI_Finalize();
return -1;
}
if (!green::utils::context.global_rank) p.print();
try {
green::mbpt::check_input(p);
green::sc::sc_loop<green::mbpt::shared_mem_dyson> sc(MPI_COMM_WORLD, p);
green::mbpt::run(sc, p);
} catch (std::exception& e) {
std::cerr << "Error on node " << green::utils::context.global_rank << ": " << e.what() << std::endl;
MPI_Abort(green::utils::context.global, -1);
}
MPI_Finalize();
return 0;
}