Commit 5d95ac2d authored by BRAMAS Berenger's avatar BRAMAS Berenger

Add a priority system based on heteroprio

parent 9f516fbf
......@@ -20,6 +20,7 @@
#include <starpu.h>
#include "../StarPUUtils/FStarPUUtils.hpp"
#include "../StarPUUtils/FStarPUFmmPriorities.hpp"
#ifdef STARPU_USE_CPU
#include "../StarPUUtils/FStarPUCpuWrapper.hpp"
......@@ -130,7 +131,7 @@ public:
struct starpu_conf conf;
FAssertLF(starpu_conf_init(&conf) == 0);
// conf.ncpus = MaxThreads;
FStarPUFmmPriorities::Controller().init(&conf, tree->getHeight(), inKernels);
FAssertLF(starpu_init(&conf) == 0);
starpu_pthread_mutex_t initMutex;
......@@ -694,6 +695,7 @@ protected:
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
starpu_insert_task(&p2m_cl,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioP2M(),
STARPU_R, cellHandles[tree->getHeight()-1][idxGroup].symb,
STARPU_RW, cellHandles[tree->getHeight()-1][idxGroup].up,
STARPU_R, particleHandles[idxGroup].symb,
......@@ -755,6 +757,7 @@ protected:
0);
task->cl_arg = arg_buffer;
task->cl_arg_size = arg_buffer_size;
task->priority = FStarPUFmmPriorities::Controller().getPrioM2M(idxLevel);
FAssertLF(starpu_task_submit(task) == 0);
}
}
......@@ -774,6 +777,7 @@ protected:
starpu_insert_task(&m2l_cl_in,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioM2L(idxLevel),
STARPU_R, cellHandles[idxLevel][idxGroup].symb,
STARPU_R, cellHandles[idxLevel][idxGroup].up,
(STARPU_RW|STARPU_COMMUTE), cellHandles[idxLevel][idxGroup].down,
......@@ -791,6 +795,7 @@ protected:
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioM2LExtern(idxLevel),
STARPU_R, cellHandles[idxLevel][idxGroup].symb,
STARPU_R, cellHandles[idxLevel][idxGroup].up,
(STARPU_RW|STARPU_COMMUTE), cellHandles[idxLevel][idxGroup].down,
......@@ -857,6 +862,7 @@ protected:
0);
task->cl_arg = arg_buffer;
task->cl_arg_size = arg_buffer_size;
task->priority = FStarPUFmmPriorities::Controller().getPrioL2L(idxLevel);
FAssertLF(starpu_task_submit(task) == 0);
}
}
......@@ -875,6 +881,7 @@ protected:
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
starpu_insert_task(&p2p_cl_in,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioP2P(),
STARPU_R, particleHandles[idxGroup].symb,
(STARPU_RW|STARPU_COMMUTE), particleHandles[idxGroup].down,
0);
......@@ -888,6 +895,7 @@ protected:
starpu_insert_task(&p2p_cl_inout,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioP2PExtern(),
STARPU_R, particleHandles[idxGroup].symb,
(STARPU_RW|STARPU_COMMUTE), particleHandles[idxGroup].down,
STARPU_R, particleHandles[interactionid].symb,
......@@ -911,6 +919,7 @@ protected:
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
starpu_insert_task(&l2p_cl,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioL2P(),
STARPU_R, cellHandles[tree->getHeight()-1][idxGroup].symb,
STARPU_R, cellHandles[tree->getHeight()-1][idxGroup].down,
STARPU_R, particleHandles[idxGroup].symb,
......
......@@ -25,6 +25,7 @@
#include <starpu.h>
#include <starpu_mpi.h>
#include "../StarPUUtils/FStarPUUtils.hpp"
#include "../StarPUUtils/FStarPUFmmPriorities.hpp"
#ifdef STARPU_USE_CPU
#include "../StarPUUtils/FStarPUCpuWrapper.hpp"
......@@ -147,7 +148,7 @@ public:
struct starpu_conf conf;
FAssertLF(starpu_conf_init(&conf) == 0);
//conf.ncpus = MaxThreads;
FStarPUFmmPriorities::Controller().init(&conf, tree->getHeight(), inKernels);
FAssertLF(starpu_init(&conf) == 0);
FAssertLF(starpu_mpi_init ( 0, 0, 0 ) == 0);
......@@ -1281,6 +1282,7 @@ protected:
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
starpu_insert_task(&p2m_cl,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioP2M(),
STARPU_R, cellHandles[tree->getHeight()-1][idxGroup].symb,
STARPU_RW, cellHandles[tree->getHeight()-1][idxGroup].up,
STARPU_R, particleHandles[idxGroup].symb,
......@@ -1343,6 +1345,7 @@ protected:
0);
task->cl_arg = arg_buffer;
task->cl_arg_size = arg_buffer_size;
task->priority = FStarPUFmmPriorities::Controller().getPrioM2M(idxLevel);
FAssertLF(starpu_task_submit(task) == 0);
}
......@@ -1422,6 +1425,7 @@ protected:
0);
task->cl_arg = arg_buffer;
task->cl_arg_size = arg_buffer_size;
task->priority = FStarPUFmmPriorities::Controller().getPrioM2M(idxLevel);
FAssertLF(starpu_task_submit(task) == 0);
}
}
......@@ -1481,6 +1485,7 @@ protected:
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioM2LMpi(idxLevel),
STARPU_R, cellHandles[idxLevel][idxGroup].symb,
(STARPU_RW|STARPU_COMMUTE), cellHandles[idxLevel][idxGroup].down,
STARPU_R, remoteCellGroups[idxLevel][interactionid].handleSymb,
......@@ -1505,6 +1510,7 @@ protected:
starpu_insert_task(&m2l_cl_in,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioM2L(idxLevel),
STARPU_R, cellHandles[idxLevel][idxGroup].symb,
STARPU_R, cellHandles[idxLevel][idxGroup].up,
(STARPU_RW|STARPU_COMMUTE), cellHandles[idxLevel][idxGroup].down,
......@@ -1522,6 +1528,7 @@ protected:
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioM2LExtern(idxLevel),
STARPU_R, cellHandles[idxLevel][idxGroup].symb,
STARPU_R, cellHandles[idxLevel][idxGroup].up,
(STARPU_RW|STARPU_COMMUTE), cellHandles[idxLevel][idxGroup].down,
......@@ -1682,6 +1689,7 @@ protected:
0);
task->cl_arg = arg_buffer;
task->cl_arg_size = arg_buffer_size;
task->priority = FStarPUFmmPriorities::Controller().getPrioL2L(idxLevel);
FAssertLF(starpu_task_submit(task) == 0);
}
}
......@@ -1734,6 +1742,7 @@ protected:
0);
task->cl_arg = arg_buffer;
task->cl_arg_size = arg_buffer_size;
task->priority = FStarPUFmmPriorities::Controller().getPrioL2L(idxLevel);
FAssertLF(starpu_task_submit(task) == 0);
}
}
......@@ -1753,6 +1762,7 @@ protected:
starpu_insert_task(&p2p_cl_inout_mpi,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioP2PMpi(),
STARPU_R, particleHandles[idxGroup].symb,
(STARPU_RW|STARPU_COMMUTE), particleHandles[idxGroup].down,
STARPU_R, remoteParticleGroupss[interactionid].handleSymb,
......@@ -1775,6 +1785,7 @@ protected:
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
starpu_insert_task(&p2p_cl_in,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioP2P(),
STARPU_R, particleHandles[idxGroup].symb,
(STARPU_RW|STARPU_COMMUTE), particleHandles[idxGroup].down,
0);
......@@ -1788,6 +1799,7 @@ protected:
starpu_insert_task(&p2p_cl_inout,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioP2PExtern(),
STARPU_R, particleHandles[idxGroup].symb,
(STARPU_RW|STARPU_COMMUTE), particleHandles[idxGroup].down,
STARPU_R, particleHandles[interactionid].symb,
......@@ -1801,7 +1813,6 @@ protected:
FLOG( FLog::Controller << "\t\t\t inblock in " << timerInBlock.elapsed() << "s\n" );
FLOG( FLog::Controller << "\t\t\t outblock in " << timerOutBlock.elapsed() << "s\n" );
}
/////////////////////////////////////////////////////////////////////////////////////
/// Merge Pass
/////////////////////////////////////////////////////////////////////////////////////
......@@ -1812,6 +1823,7 @@ protected:
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
starpu_insert_task(&l2p_cl,
STARPU_VALUE, &wrapperptr, sizeof(wrapperptr),
STARPU_PRIORITY, FStarPUFmmPriorities::Controller().getPrioL2P(),
STARPU_R, cellHandles[tree->getHeight()-1][idxGroup].symb,
STARPU_R, cellHandles[tree->getHeight()-1][idxGroup].down,
STARPU_R, particleHandles[idxGroup].symb,
......
// @SCALFMM_PRIVATE
#ifndef FSTARPUFMMPRIORITIES_HPP
#define FSTARPUFMMPRIORITIES_HPP
#include "../../Utils/FGlobal.hpp"
#include "FStarPUHeteoprio.hpp"
#include "FStarPUKernelCapacities.hpp"
/**
* @brief The FStarPUFmmPriorities class
* This class should have an static method to be called by hetero getPrio.
*/
class FStarPUFmmPriorities{
int prioP2M;
int prioM2M;
int prioP2MSend;
int prioM2MSend;
int prioM2L;
int prioM2LExtern;
int prioL2L;
int prioL2P;
int prioP2P;
int prioP2PExtern;
int prioM2LMpi;
int prioP2PMpi;
int treeHeight;
FStarPUKernelCapacities* capacities;
static FStarPUFmmPriorities controller;
FStarPUFmmPriorities(){
}
public:
static FStarPUFmmPriorities& Controller(){
return controller;
}
static void InitSchedulerCallback(unsigned sched_ctx_id,
struct _starpu_heteroprio_center_policy_heteroprio *heteroprio){
Controller().initSchedulerCallback(sched_ctx_id, heteroprio);
}
void init(struct starpu_conf* conf, const int inTreeHeight,
FStarPUKernelCapacities* inCapacities){
capacities = inCapacities;
conf->sched_policy = &_starpu_sched_heteroprio_policy,
initialize_heteroprio_center_policy_callback = &InitSchedulerCallback;
treeHeight = inTreeHeight;
prioP2MSend = 0;
prioP2M = prioP2MSend+1;
prioM2MSend = prioP2M+1;
prioM2M = prioM2MSend+1;
prioM2L = prioM2M+1;
prioM2LExtern = prioM2L;
prioM2LMpi = prioM2L;
prioL2L = prioM2L+1;
prioP2P = prioL2L + (treeHeight-3)*2+1 +1;
prioP2PExtern = prioP2P;
prioP2PMpi = prioP2P;
prioL2P = prioP2PMpi+1;
}
void initSchedulerCallback(unsigned /*sched_ctx_id*/,
struct _starpu_heteroprio_center_policy_heteroprio *heteroprio){
#ifdef STARPU_USE_CPU
// CPU follows the real prio
{
int cpuCountPrio = 0;
//prioP2MSend = 0;
//prioP2M = prioP2MSend+1;
if(capacities->supportP2M(FSTARPU_CPU_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_CPU_IDX][cpuCountPrio++] = prioP2MSend;
heteroprio->buckets[prioP2MSend].valide_archs |= STARPU_CPU;
heteroprio->prio_mapping_per_arch_index[FSTARPU_CPU_IDX][cpuCountPrio++] = prioP2M;
heteroprio->buckets[prioP2M].valide_archs |= STARPU_CPU;
}
//prioM2MSend = prioP2M+1;
//prioM2M = prioM2MSend+1;
assert(cpuCountPrio == prioM2MSend); // True if CPU support all TODO
if(capacities->supportM2M(FSTARPU_CPU_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_CPU_IDX][cpuCountPrio++] = prioM2MSend;
heteroprio->buckets[prioM2MSend].valide_archs |= STARPU_CPU;
heteroprio->prio_mapping_per_arch_index[FSTARPU_CPU_IDX][cpuCountPrio++] = prioM2M;
heteroprio->buckets[prioM2M].valide_archs |= STARPU_CPU;
}
// prioM2L = prioM2M+1;
// prioM2LExtern = prioM2L;
// prioM2LMpi = prioM2L;
// prioL2L = prioM2L+1;
assert(cpuCountPrio == prioM2L); // True if CPU support all TODO
for(int idxLevel = 2 ; idxLevel < treeHeight ; ++idxLevel){
if(capacities->supportM2L(FSTARPU_CPU_IDX)){
const int prioM2LAtLevel = getPrioM2L(idxLevel);
heteroprio->prio_mapping_per_arch_index[FSTARPU_CPU_IDX][cpuCountPrio++] = prioM2LAtLevel;
heteroprio->buckets[prioM2LAtLevel].valide_archs |= STARPU_CPU;
}
if(idxLevel != treeHeight-1 && capacities->supportL2L(FSTARPU_CPU_IDX)){
const int prioL2LAtLevel = getPrioL2L(idxLevel);
heteroprio->prio_mapping_per_arch_index[FSTARPU_CPU_IDX][cpuCountPrio++] = prioL2LAtLevel;
heteroprio->buckets[prioL2LAtLevel].valide_archs |= STARPU_CPU;
}
}
assert(cpuCountPrio == prioP2P); // True if CPU support all TODO
//prioP2P = prioL2L + (treeHeight-3)*2+1 +1;
//prioP2PExtern = prioP2P;
//prioP2PMpi = prioP2P;
if(capacities->supportP2P(FSTARPU_CPU_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_CPU_IDX][cpuCountPrio++] = prioP2P;
heteroprio->buckets[prioP2P].valide_archs |= STARPU_CPU;
}
assert(cpuCountPrio == prioL2P); // True if CPU support all TODO
//prioL2P = prioP2PMpi+1;
if(capacities->supportL2P(FSTARPU_CPU_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_CPU_IDX][cpuCountPrio++] = prioL2P;
heteroprio->buckets[prioL2P].valide_archs |= STARPU_CPU;
}
heteroprio->nb_prio_per_arch_index[FSTARPU_CPU_IDX] = unsigned(cpuCountPrio);
}
#endif
#ifdef STARPU_USE_OPENCL
{
int openclCountPrio = 0;
//prioP2P = prioL2L + (treeHeight-3)*2+1 +1;
//prioP2PExtern = prioP2P;
//prioP2PMpi = prioP2P;
if(capacities->supportP2P(FSTARPU_OPENCL_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_OPENCL_IDX][openclCountPrio++] = prioP2P;
heteroprio->buckets[prioP2P].factor_base_arch_index = FSTARPU_OPENCL_IDX;
heteroprio->buckets[prioP2P].valide_archs |= STARPU_OPENCL;
#ifdef STARPU_USE_CPU
heteroprio->buckets[prioP2P].slow_factors_per_index[FSTARPU_CPU_IDX] = 40.0f;
#endif
}
// prioM2L = prioM2M+1;
// prioM2LExtern = prioM2L;
// prioM2LMpi = prioM2L;
for(int idxLevel = 2 ; idxLevel < treeHeight ; ++idxLevel){
if(capacities->supportM2L(FSTARPU_OPENCL_IDX)){
const int prioM2LAtLevel = getPrioM2L(idxLevel);
heteroprio->prio_mapping_per_arch_index[FSTARPU_OPENCL_IDX][openclCountPrio++] = prioM2LAtLevel;
heteroprio->buckets[prioM2LAtLevel].factor_base_arch_index = FSTARPU_OPENCL_IDX;
heteroprio->buckets[prioM2LAtLevel].valide_archs |= STARPU_OPENCL;
#ifdef STARPU_USE_CPU
heteroprio->buckets[prioM2LAtLevel].slow_factors_per_index[FSTARPU_CPU_IDX] = 40.0f;
#endif
}
}
//prioP2MSend = 0;
//prioP2M = prioP2MSend+1;
if(capacities->supportP2M(FSTARPU_OPENCL_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_OPENCL_IDX][openclCountPrio++] = prioP2MSend;
heteroprio->buckets[prioP2MSend].valide_archs |= STARPU_OPENCL;
heteroprio->prio_mapping_per_arch_index[FSTARPU_OPENCL_IDX][openclCountPrio++] = prioP2M;
heteroprio->buckets[prioP2M].valide_archs |= STARPU_OPENCL;
}
//prioM2MSend = prioP2M+1;
//prioM2M = prioM2MSend+1;
if(capacities->supportM2M(FSTARPU_OPENCL_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_OPENCL_IDX][openclCountPrio++] = prioM2MSend;
heteroprio->buckets[prioM2MSend].valide_archs |= STARPU_OPENCL;
heteroprio->prio_mapping_per_arch_index[FSTARPU_OPENCL_IDX][openclCountPrio++] = prioM2M;
heteroprio->buckets[prioM2M].valide_archs |= STARPU_OPENCL;
}
// prioL2L = prioM2L+1;
for(int idxLevel = 2 ; idxLevel < treeHeight ; ++idxLevel){
if(idxLevel != treeHeight-1 && capacities->supportL2L(FSTARPU_OPENCL_IDX)){
const int prioL2LAtLevel = getPrioL2L(idxLevel);
heteroprio->prio_mapping_per_arch_index[FSTARPU_OPENCL_IDX][openclCountPrio++] = prioL2LAtLevel;
heteroprio->buckets[prioL2LAtLevel].valide_archs |= STARPU_OPENCL;
}
}
//prioL2P = prioP2PMpi+1;
if(capacities->supportL2P(FSTARPU_OPENCL_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_OPENCL_IDX][openclCountPrio++] = prioL2P;
heteroprio->buckets[prioL2P].valide_archs |= STARPU_OPENCL;
}
heteroprio->nb_prio_per_arch_index[FSTARPU_OPENCL_IDX] = unsigned(openclCountPrio);
}
#endif
#ifdef STARPU_USE_CUDA
{
int openclCountPrio = 0;
//prioP2P = prioL2L + (treeHeight-3)*2+1 +1;
//prioP2PExtern = prioP2P;
//prioP2PMpi = prioP2P;
if(capacities->supportP2P(FSTARPU_CUDA_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_CUDA_IDX][openclCountPrio++] = prioP2P;
heteroprio->buckets[prioP2P].valide_archs |= STARPU_CUDA;
heteroprio->buckets[prioP2P].factor_base_arch_index = FSTARPU_CUDA_IDX;
#ifdef STARPU_USE_CPU
heteroprio->buckets[prioP2P].slow_factors_per_index[FSTARPU_CPU_IDX] = 40.0f;
#endif
}
// prioM2L = prioM2M+1;
// prioM2LExtern = prioM2L;
// prioM2LMpi = prioM2L;
for(int idxLevel = 2 ; idxLevel < treeHeight ; ++idxLevel){
if(capacities->supportM2L(FSTARPU_CUDA_IDX)){
const int prioM2LAtLevel = getPrioM2L(idxLevel);
heteroprio->prio_mapping_per_arch_index[FSTARPU_CUDA_IDX][openclCountPrio++] = prioM2LAtLevel;
heteroprio->buckets[prioM2LAtLevel].valide_archs |= STARPU_CUDA;
heteroprio->buckets[prioM2LAtLevel].factor_base_arch_index = FSTARPU_CUDA_IDX;
#ifdef STARPU_USE_CPU
heteroprio->buckets[prioM2LAtLevel].slow_factors_per_index[FSTARPU_CPU_IDX] = 40.0f;
#endif
}
}
//prioP2MSend = 0;
//prioP2M = prioP2MSend+1;
if(capacities->supportP2M(FSTARPU_CUDA_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_CUDA_IDX][openclCountPrio++] = prioP2MSend;
heteroprio->buckets[prioP2MSend].valide_archs |= STARPU_CUDA;
heteroprio->prio_mapping_per_arch_index[FSTARPU_CUDA_IDX][openclCountPrio++] = prioP2M;
heteroprio->buckets[prioP2M].valide_archs |= STARPU_CUDA;
}
//prioM2MSend = prioP2M+1;
//prioM2M = prioM2MSend+1;
if(capacities->supportM2M(FSTARPU_CUDA_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_CUDA_IDX][openclCountPrio++] = prioM2MSend;
heteroprio->buckets[prioM2MSend].valide_archs |= STARPU_CUDA;
heteroprio->prio_mapping_per_arch_index[FSTARPU_CUDA_IDX][openclCountPrio++] = prioM2M;
heteroprio->buckets[prioM2M].valide_archs |= STARPU_CUDA;
}
// prioL2L = prioM2L+1;
for(int idxLevel = 2 ; idxLevel < treeHeight ; ++idxLevel){
if(idxLevel != treeHeight-1 && capacities->supportL2L(FSTARPU_CUDA_IDX)){
const int prioL2LAtLevel = getPrioL2L(idxLevel);
heteroprio->prio_mapping_per_arch_index[FSTARPU_CUDA_IDX][openclCountPrio++] = prioL2LAtLevel;
heteroprio->buckets[prioL2LAtLevel].valide_archs |= STARPU_CUDA;
}
}
//prioL2P = prioP2PMpi+1;
if(capacities->supportL2P(FSTARPU_CUDA_IDX)){
heteroprio->prio_mapping_per_arch_index[FSTARPU_CUDA_IDX][openclCountPrio++] = prioL2P;
heteroprio->buckets[prioL2P].valide_archs |= STARPU_CUDA;
}
heteroprio->nb_prio_per_arch_index[FSTARPU_CUDA_IDX] = int(openclCountPrio);
}
#endif
}
int getPrioP2M() const {
return prioP2M;
}
int getPrioM2M(const int /*inLevel*/) const {
return prioM2M;
}
int getPrioP2M(bool willBeSend) const {
return willBeSend?prioP2MSend:prioP2M;
}
int getPrioM2M(const int /*inLevel*/, bool willBeSend) const {
return willBeSend?prioM2MSend:prioM2M;
}
int getPrioM2L(const int inLevel) const {
return prioM2L + (inLevel - 2)*2;
}
int getPrioM2LExtern(const int inLevel) const {
return prioM2LExtern + (inLevel - 2)*2;
}
int getPrioL2L(const int inLevel) const {
return prioL2L + (inLevel - 2)*2 + 1;
}
int getPrioL2P() const {
return prioL2P;
}
int getPrioP2P() const {
return prioP2P;
}
int getPrioP2PExtern() const {
return prioP2PExtern;
}
int getPrioM2LMpi(const int inLevel) const {
return prioM2LMpi + inLevel - 2;
}
int getPrioP2PMpi() const {
return prioP2PMpi;
}
};
FStarPUFmmPriorities FStarPUFmmPriorities::controller;
#endif // FSTARPUFMMPRIORITIES_HPP
......@@ -421,7 +421,7 @@ static struct starpu_task *pop_task_heteroprio_policy(unsigned sched_ctx_id)
assert(bucket->valide_archs & worker->arch_type);
/* Take nb_tasks_to_prefetch tasks if possible */
while(_starpu_fifo_empty(bucket->tasks_queue) == 0 && nb_tasks_to_prefetch
&& (worker->arch_index == bucket->factor_base_arch_index
&& (bucket->factor_base_arch_index == 0 || worker->arch_index == bucket->factor_base_arch_index
|| (float(_starpu_fifo_size(bucket->tasks_queue))/float(heteroprio->nb_workers_per_arch_index[bucket->factor_base_arch_index])
>= bucket->slow_factors_per_index[worker->arch_index]))){
struct starpu_task* task = _starpu_fifo_pop_local_task(bucket->tasks_queue);
......
......@@ -18,10 +18,10 @@ public:
virtual bool supportL2P(const FStarPUTypes inPu) const = 0;
virtual bool supportP2P(const FStarPUTypes inPu) const = 0;
virtual bool supportP2PExtern(const FStarPUTypes inPu) const = 0;
#ifdef SCALFMM_USE_MPI
virtual bool supportM2LMpi(const FStarPUTypes inPu) const = 0;
virtual bool supportP2PMpi(const FStarPUTypes inPu) const = 0;
#endif
};
class FStarPUAbstractCapacities : public FStarPUKernelCapacities {
......
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