-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculate_pi.cpp
47 lines (37 loc) · 1.69 KB
/
calculate_pi.cpp
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
//========================================================================================
// (C) (or copyright) 2020. Triad National Security, LLC. All rights reserved.
//
// This program was produced under U.S. Government contract 89233218CNA000001 for Los
// Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC
// for the U.S. Department of Energy/National Nuclear Security Administration. All rights
// in the program are reserved by Triad National Security, LLC, and the U.S. Department
// of Energy/National Nuclear Security Administration. The Government is granted for
// itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide
// license in this material to reproduce, prepare derivative works, distribute copies to
// the public, perform publicly and display publicly, and to permit others to do so.
//========================================================================================
#include "parthenon_manager.hpp"
#include "pi.hpp"
int main(int argc, char *argv[]) {
using parthenon::ParthenonManager;
using parthenon::ParthenonStatus;
ParthenonManager pman;
auto manager_status = pman.ParthenonInit(argc, argv);
if (manager_status == ParthenonStatus::complete) {
pman.ParthenonFinalize();
return 0;
}
if (manager_status == ParthenonStatus::error) {
pman.ParthenonFinalize();
return 1;
}
CalculatePi driver(pman.pinput.get(), pman.pmesh.get(), pman.pouts.get());
// start a timer
pman.PreDriver();
auto driver_status = driver.Execute();
// Make final outputs, print diagnostics
pman.PostDriver(driver_status);
// call MPI_Finalize if necessary
pman.ParthenonFinalize();
return (0);
}