main.cpp File Reference
#include "mainapp.h"
#include <string>
#include "dealbase.h"
#include "configfile.h"
#include "transportbase.h"
#include "dynamicbase.h"
#include "orthomesh.h"
#include "flashbase.h"
#include "conservativemethodforsystem.h"
#include "diffusivestep.h"
#include <fstream>
#include "globals.h"
#include "facefluxfunction.h"
#include "co2gridgenerator.h"
#include "constvelocitymodule.h"
#include "opointer.h"
#include "linearsolver.h"
#include "fixedvaluecondition.h"
#include "stringhashfun.h"
#include "doubleporositydiff.h"
#include "blockmatrixmodule.h"
#include "monitorwells.h"
#include <stdlib.h>
#include <signal.h>
#include <fenv.h>
#include <limits.h>
#include "hdf5orthowriter.h"
#include "flashco2brine.h"
#include <sys/time.h>
#include <time.h>
Go to the source code of this file.
Function Documentation
void closeFiles |
( |
int |
sig_num |
) |
|
void fpehandler |
( |
int |
sig_num |
) |
|
Definition at line 41 of file main.cpp.
00042 {
00043 signal(SIGFPE, fpehandler);
00044 printf("SIGFPE %d: FLOATING POINT EXCEPTION OCCURRED\n",sig_num);
00045 printf("Segmentation Fault signal will be sent to cause\n");
00046 printf("production of a core file\n");
00047 closeFiles(0);
00048 kill(getpid(),SIGSEGV);
00049 abort();
00050 }
int main |
( |
int |
argc, |
|
|
char ** |
argv | |
|
) |
| | |
Definition at line 57 of file main.cpp.
00058 {
00059
00060
00061
00062 char errorMessage[1000];
00063
00064
00065
00066
00067
00068
00069 feenableexcept(FE_DIVBYZERO|FE_INVALID);
00070 signal(SIGFPE,fpehandler);
00071 signal(SIGKILL,closeFiles);
00072 signal(SIGABRT,closeFiles);
00073 signal(SIGTERM,closeFiles);
00074
00075 sprintf(errorMessage,"Invalid arguments passed\n\
00076 Usage: %s [Options] <CONFILE FILE NAME>\n\
00077 Options:\n\
00078 -g\tActivate unit tests mode\n",argv[0]);
00079
00080
00081 if (argc != 3 && argc!= 2)
00082 {
00083 printf("%s",errorMessage);
00084 return 0;
00085 }
00086
00087
00088
00089 std::string configFile;
00090 bool bunit_test=false;
00091
00092
00093
00094
00095 if (argc == 3)
00096 {
00097 std::string option = argv[1];
00098 if (option == "-g")
00099 bunit_test=true;
00100 else
00101 {
00102 printf("%s",errorMessage);
00103 return 0;
00104 }
00105 configFile=argv[2];
00106 }
00107 else if (argc == 2)
00108 configFile=argv[1];
00109
00110
00111
00112
00113
00114
00115
00116 #ifndef USE_MPI
00117 Timer t1(PROCESSOR_TIME);
00118 t1.start();
00119
00120
00121 MainApp app;
00122 global_app = &app;
00123 app.execute(configFile,bunit_test);
00124
00125 t1.end();
00126 std::cout << "Total Exec Time: " << t1.printTime() << std::endl;
00127 return 0;
00128
00129 #else
00130
00131
00132 MPI_Init(&argc,&argv);
00133 if (argc != 2)
00134 {
00135 printf("%s",errorMessage);
00136 return 0;
00137 }
00138 system("echo $HOSTNAME $SSH_HOST $SSH_CONNECTION");
00139 MainAppMPI app;
00140 app.execute(argv[1]);
00141
00142 MPI_Finalize();
00143 return 0;
00144
00145 #endif
00146
00147
00148
00149
00150 }
Variable Documentation