|
3 | 3 | * DESCR: Main. All the work moved to other modules. |
4 | 4 | * |
5 | 5 | * Previous versions were developed by Alfons Hoekstra. |
6 | | - * Sequential version, Michel Grimminck January 1995 |
| 6 | + * Sequential version, Michel Grimminck Jan 1995 |
7 | 7 | * |
8 | 8 | * Copyright (C) 2006-2008 University of Amsterdam |
9 | 9 | * This code is covered by the GNU General Public License. |
|
15 | 15 | #include "debug.h" |
16 | 16 | #include "io.h" |
17 | 17 |
|
18 | | -// EXTERNAL FUNCTIONS |
| 18 | +/* EXTERNAL FUNCTIONS */ |
19 | 19 |
|
20 | | -// calculator.c |
| 20 | +/* calculator.c */ |
21 | 21 | void Calculator(void); |
22 | | -// make_particle.c |
| 22 | +/* make_particle.c */ |
23 | 23 | void InitShape(void); |
24 | 24 | int MakeParticle(void); |
25 | | -// param.c |
| 25 | +/* param.c */ |
26 | 26 | void InitVariables(void); |
27 | 27 | void ParseParameters(int argc,char **argv); |
28 | 28 | void VariablesInterconnect(void); |
29 | 29 | void DirectoryLog(int argc,char **argv); |
30 | 30 | void PrintInfo(void); |
31 | 31 |
|
32 | | -//============================================================ |
| 32 | +/*============================================================*/ |
33 | 33 |
|
34 | 34 | int main(int argc,char **argv) |
35 | 35 | { |
36 | | - // Initialize error handling and line wrapping |
37 | | - logfile=NULL; |
38 | | - term_width=DEF_TERM_WIDTH; |
39 | | - // Start global time |
40 | | - StartTime(); |
41 | | - // Initialize communications |
42 | | - InitComm(&argc,&argv); |
43 | | - // Initialize and parse input parameters |
44 | | - InitVariables(); |
45 | | - ParseParameters(argc,argv); |
46 | | - D("Reading command line finished"); |
47 | | - VariablesInterconnect(); // also initializes beam |
48 | | - // Initialize symmetries and box's; get number of dipoles; set some variables |
49 | | - InitShape(); |
50 | | - // !!! before this line errors should be printed in simple format, after - in advanced one |
51 | | - // Create directory and start logfile (print command line) |
52 | | - DirectoryLog(argc,argv); |
53 | | - // Initialize FFT grid and its subdivision over processors |
54 | | - ParSetup(); |
55 | | - // MakeParticle; initialize dpl and nlocalRows |
56 | | - MakeParticle(); |
57 | | - // Print info to stdout and logfile |
58 | | - PrintInfo(); |
59 | | - // Main calculation part |
60 | | - D("Calculator started"); |
61 | | - Calculator(); |
62 | | - D("Calculator finished"); |
63 | | - // Print timing and statistics; close logfile |
64 | | - FinalStatistics(); |
65 | | - // check error on stdout |
66 | | - if (ferror(stdout)) LogError(EC_WARN,ALL_POS, |
67 | | - "Some errors occurred while writing to stdout during the execution of ADDA"); |
68 | | - // finish execution normally |
69 | | - Stop(0); |
70 | | - // never actually reached; just to make the compiler happy |
71 | | - return 0; |
| 36 | + /* initialize error handling and line wrapping */ |
| 37 | + logfile=NULL; |
| 38 | + term_width=DEF_TERM_WIDTH; |
| 39 | + /* start global time */ |
| 40 | + StartTime(); |
| 41 | + /* initialize communications */ |
| 42 | + InitComm(&argc,&argv); |
| 43 | + /* initialize and parse input parameters */ |
| 44 | + InitVariables(); |
| 45 | + ParseParameters(argc,argv); |
| 46 | + D("Reading command line finished"); |
| 47 | + VariablesInterconnect(); /* also initializes beam */ |
| 48 | + /* initialize symmetries and box's; get number of dipoles; set some variables */ |
| 49 | + InitShape(); |
| 50 | + /* !!! before errorrs should be printed in simple format, after in more advanced one !!! */ |
| 51 | + /* Create directory and start logfile (print command line) */ |
| 52 | + DirectoryLog(argc,argv); |
| 53 | + /* initialize FFT grid and its subdivision over processors */ |
| 54 | + ParSetup(); |
| 55 | + /* MakeParticle; initialize dpl and nlocalRows */ |
| 56 | + MakeParticle(); |
| 57 | + /* print info to stdout and logfile */ |
| 58 | + PrintInfo(); |
| 59 | + /* initialize times and counters */ |
| 60 | + /* Main calculation part */ |
| 61 | + D("Calculator started"); |
| 62 | + Calculator(); |
| 63 | + D("Calculator finished"); |
| 64 | + /* print timing and statistics; close logfile */ |
| 65 | + FinalStatistics(); |
| 66 | + /* check error on stdout */ |
| 67 | + if (ferror(stdout)) LogError(EC_WARN,ALL_POS, |
| 68 | + "Some errors occured while writing to stdout during the execution of ADDA"); |
| 69 | + /* finish execution normally */ |
| 70 | + Stop(0); |
| 71 | + /* never actually reached; just to make the compiler happy */ |
| 72 | + return 0; |
72 | 73 | } |
0 commit comments