00001
00023 #ifndef LONESTAR_BOILERPLATE_H
00024 #define LONESTAR_BOILERPLATE_H
00025
00026 #include "Galois/Galois.h"
00027 #include "Galois/Version.h"
00028 #include "Galois/Runtime/ll/gio.h"
00029 #include "llvm/Support/CommandLine.h"
00030
00031 #include <sstream>
00032
00034 static llvm::cl::opt<bool> skipVerify("noverify", llvm::cl::desc("Skip verification step"), llvm::cl::init(false));
00035 static llvm::cl::opt<int> numThreads("t", llvm::cl::desc("Number of threads"), llvm::cl::init(1));
00036
00038 static void LonestarStart(int argc, char** argv, const char* app, const char* desc = 0, const char* url = 0) {
00039 using namespace Galois::Runtime::LL;
00040
00041
00042 gPrint("Galois Benchmark Suite v", GALOIS_VERSION_STRING, " (r", GALOIS_SVNVERSION, ")\n");
00043 gPrint("Copyright (C) ", GALOIS_COPYRIGHT_YEAR_STRING, " The University of Texas at Austin\n");
00044 gPrint("http://iss.ices.utexas.edu/galois/\n\n");
00045 gPrint("application: ", app ? app : "unspecified", "\n");
00046 if (desc)
00047 gPrint(desc, "\n");
00048 if (url)
00049 gPrint("http://iss.ices.utexas.edu/?p=projects/galois/benchmarks/", url, "\n");
00050 gPrint("\n");
00051
00052 std::ostringstream cmdout;
00053 for (int i = 0; i < argc; ++i) {
00054 cmdout << argv[i];
00055 if (i != argc - 1)
00056 cmdout << " ";
00057 }
00058 gInfo("CommandLine ", cmdout.str().c_str());
00059
00060 char name[256];
00061 gethostname(name, 256);
00062 gInfo("Hostname ", name);
00063 gFlush();
00064
00065 llvm::cl::ParseCommandLineOptions(argc, argv);
00066 numThreads = Galois::setActiveThreads(numThreads);
00067
00068
00069 Galois::Runtime::reportStat(0, "Threads", numThreads);
00070 }
00071
00072 #endif