-
Notifications
You must be signed in to change notification settings - Fork 0
/
SIRC.cpp
70 lines (55 loc) · 2.73 KB
/
SIRC.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//----------------------------------------------------------------------------------||
//------------------- SIRC.cpp -------------------||
//----------------------------------------------------------------------------------||
// ____ ___ ____ ____ ||
// / ___|_ _| _ \ / ___| ||
// \___ \| || |_) | | ||
// ___) | || _ <| |___ ||
// |____/___|_| \_\\____| ||
// ||
//----------------------------------------------------------------------------------||
//-- (S)imple (I)ncoherent (R)adiation (C)alculation -||
//----------------------------------------------------------------------------------||
//---Author----------- : Tianhong Wang --------------------||
//---Starting--------- : Feb-16-2022 --------------------||
//---Email------------ : tw474@cornell.edu --------------------||
//---Group------------ : Dr. Gennady Shvets' Group --------------------||
//---Copyright-------- : (C) 2022 by Tianhong Wang --------------------||
//----------------------------------------------------------------------------------||
//----------------------------------------------------------------------------------||
#include "SIRC.h"
int GlobalVars::Rank=0;
FILE* GlobalVars::LogFile=NULL;
int main(int argc, char** argv)
{
int N_processor;
int Rank;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD, &N_processor);
MPI_Comm_rank(MPI_COMM_WORLD, &Rank);
GlobalVars::Rank=Rank;
#ifdef _DEBUG
char sFile[128];
sprintf(sFile, "log_r_%d.dat", Rank);
GlobalVars::LogFile = fopen(sFile, "w");
DLog("Log file created.");
#endif
Log("=============================================");
Log(" ____ ___ ____ ____ ");
Log(" / ___|_ _| _ \\ / ___| ");
Log(" \\___ \\| || |_) | | ");
Log(" ___) | || _ <| |___ ");
Log(" |____/___|_| \\_\\\\____|\n");
Log("=============================================");
Log("==== Starting Program: SIRC.");
Log("==== Copyright: (C) 2022 by Tianhong Wang.");
Log("==== Number of Total Ranks: [%d].",N_processor);
Log("=============================================\n");
Domain *domain = new Domain((char*)"SIRC.ini",Rank);
domain-> Run();
// Log("%f" ,domain->tmpCounter*1.0/domain->tmpCounter2);
delete domain;
Log("==== SIRC: Bye!");
MPI_Finalize();
return 0;
}