[mareframe] View of /trunk/paramin-beta/paramin.cc
View of /trunk/paramin-beta/paramin.cc
Parent Directory
| Revision Log
Revision 1 -
( download)
( annotate)
Mon Feb 10 17:09:07 2014 UTC
(10 years, 5 months ago)
by agomez
File size: 1588 byte(s)
Initial version based on Gadget 2.2.00
#include "mpi.h"
#include "paramin.h"
#include "optimizer.h"
#include "errorhandler.h"
ErrorHandler handle;
int main(int argc, char* argv[]) {
// Tékka hvort viðföng séu í lagi þegar mpirun er notað.
//cout << "argc = " << argc << endl;
// for(int i = 0; i < argc; i++)
// cout << "argv[" << i << "] = " << argv[i] << endl;
time_t startExec;
startExec = time(NULL);
cout << "Starting Paramin version " << PARAMINVERSION << " at " << ctime(&startExec) << endl;
int i;
NetCommunication* net;
Optimizer* optimize;
NetInterface* netInt;
ProcessManager* processM;
CommandLineInfo* commandline;
commandline = new CommandLineInfo();
// Find out options given on command line
commandline->read(argc, argv);
net = new MasterCommunication(commandline);
processM = new WorkLoadScheduler(commandline);
netInt = new NetInterface(net, processM, commandline);
optimize = new Optimizer(commandline, netInt);
optimize->OptimizeFunc();
optimize->printResult();
// clean up
delete netInt;
delete processM;
delete net;
delete optimize;
time_t stopExec;
stopExec = time(NULL);
cout << "\nParamin finished at " << ctime(&stopExec) << "The time taken for this Paramin run was "
<< difftime(stopExec, startExec) << " seconds\n\n";
// Write time to outputfile specified G.E.
ofstream outfile;
outfile.open(commandline->getOutputFilename(),ios::out | ios::app);
delete commandline;
outfile << "; Time taken for Paramin was: " << difftime(stopExec, startExec) << " seconds\n\n";
outfile.close();
return EXIT_SUCCESS;
}
|