Commit a4c1678c authored by Uldis Locans's avatar Uldis Locans
Browse files

add --use-dks command line argument and DKSEnabled option to IpplInfo

parent 476b69b7
......@@ -49,6 +49,8 @@ Inform *IpplInfo::Error = new Inform("Error", std::cerr, INFORM_ALL_NODES);
Inform *IpplInfo::Debug = new Inform("**DEBUG**", std::cerr, INFORM_ALL_NODES);
//dks base member of IpplInfo initialized to default values
bool IpplInfo::DKSEnabled = false;
#ifdef IPPL_DKS
#ifdef IPPL_DKS_CUDA
......@@ -332,6 +334,19 @@ IpplInfo::IpplInfo(int& argc, char**& argv, int removeargs, MPI_Comm mpicomm) {
param_error(argv[i],
"Please specify an output level from 0 to 5", 0);
} else if ( ( strcmp(argv[i], "--use-dks") == 0 ) ) {
// Set DKSEnabled to true if OPAL is compiled with DKS.
#ifdef IPPL_DKS
DKSEnabled = true;
INFOMSG("DKS enabled OPAL will use GPU where possible");
INFOMSG(endl);
//TODO: check if any device is available and disable DKS if there isn't
#else
DKSEnabled = false;
INFOMSG("OPAL compiled without DKS, " << argv[i] << " flag has no effect");
INFOMSG(endl);
#endif
} else if ( ( strcmp(argv[i], "--warn") == 0 ) ) {
// Set the output level for warning messages.
if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) >= 0 )
......
......@@ -99,6 +99,7 @@ public:
// the statistics collection object
static IpplStats *Stats;
#ifdef IPPL_DKS
static DKSBase *DKS;
#endif
......@@ -283,6 +284,9 @@ public:
// library (from IpplVersions.h)
static const char *compileUser();
//Static flag telling wheteher to use DKS when runnign OPAL
static bool DKSEnabled;
// Static flag telling whether to use optimization for reducing
// communication by deferring guard cell fills.
static bool deferGuardCellFills;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment