Commit 62b893fe authored by Luka Stanisic's avatar Luka Stanisic

cleanup and additional comments

parent e4bd4faa
......@@ -77,6 +77,7 @@ void Autotuner::AlgoSimple(double compTime)
workload -= 5;
}
void Autotuner::AlgoRatio(double compTime)
{
if (best_time == 0.)
......
......@@ -99,12 +99,6 @@ bioem::bioem()
DebugOutput = getenv("BIOEM_DEBUG_OUTPUT") == NULL ? 2 : atoi(getenv("BIOEM_DEBUG_OUTPUT"));
nProjectionsAtOnce = getenv("BIOEM_PROJECTIONS_AT_ONCE") == NULL ? 1 : atoi(getenv("BIOEM_PROJECTIONS_AT_ONCE"));
Autotuning = false;
if (getenv("GPU") && atoi(getenv("GPU")))
if (!getenv("GPUWORKLOAD") || (atoi(getenv("GPUWORKLOAD")) == -1))
if (!getenv("BIOEM_DEBUG_BREAK") || (atoi(getenv("BIOEM_DEBUG_BREAK")) > FIRST_STABLE))
{
Autotuning = true;
}
}
bioem::~bioem()
......@@ -372,6 +366,18 @@ int bioem::configure(int ac, char* av[])
timer.ResetStart();
}
// ****************** For autotuning **********************
if ((getenv("GPU") && atoi(getenv("GPU"))) && ((!getenv("GPUWORKLOAD") || (atoi(getenv("GPUWORKLOAD")) == -1))) && (!getenv("BIOEM_DEBUG_BREAK") || (atoi(getenv("BIOEM_DEBUG_BREAK")) > FIRST_STABLE)))
{
Autotuning = true;
if (mpi_rank == 0) printf("Autotuning of GPUWorkload enabled:\n\tAlgorithm %d\n\tRecalibration at every %d projections\n\tComparisons are considered stable after first %d comparisons\n", AUTOTUNING_ALGORITHM, RECALIB_FACTOR, FIRST_STABLE);
}
else
{
Autotuning = false;
if (mpi_rank == 0) printf("Autotuning of GPUWorkload disabled\n");
}
// ****************** Initializing pointers *********************
deviceInit();
......@@ -1431,7 +1437,7 @@ int bioem::deviceInit()
}
int bioem::deviceStartRun()
{ deviceInit();
{
return(0);
}
......
......@@ -42,7 +42,7 @@ public:
virtual void* malloc_device_host(size_t size);
virtual void free_device_host(void* ptr);
virtual void rebalance(int workload);
virtual void rebalance(int workload); //Rebalance GPUWorkload
int createProjection(int iMap, mycomplex_t* map);
int calcross_cor(myfloat_t* localmap, myfloat_t& sum, myfloat_t& sumsquare);
......
......@@ -33,7 +33,7 @@ public:
virtual int compareRefMaps(int iOrient, int iConv, myfloat_t amp, myfloat_t pha, myfloat_t env, const myfloat_t* conv_map, mycomplex_t* localmultFFT, myfloat_t sumC, myfloat_t sumsquareC, const int startMap = 0);
virtual void* malloc_device_host(size_t size);
virtual void free_device_host(void* ptr);
virtual void rebalance(int workload);
virtual void rebalance(int workload); //Rebalance GPUWorkload
protected:
virtual int deviceInit();
......
......@@ -98,7 +98,7 @@ struct myfloat3_t
3. AlgoBisection = 3; Based on bisection, multiple workload values are tested until the optimal one is found.
*/
#define AUTOTUNING_ALGORITHM 3
/* Recalibrate every X projections */
/* Recalibrate every X projections. Put to a very high value, i.e., 99999, to de facto disable recalibration */
#define RECALIB_FACTOR 200
/* After how many comparison iterations, comparison duration becomes stable */
#define FIRST_STABLE 7
......
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