Commit 9a338469 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Use commutt from starpu if enabled

parent 5fe2360e
......@@ -277,16 +277,18 @@ endif()
##################################################################
#
if( ScalFMM_USE_STARPU )
SET(STARPU_LIBRARIES " -L$ENV{STARPU_LIB}; -lstarpu-1.1") # CACHE STRING "Set your STARPU flags"
SET(STARPU_LIBRARIES " -L$ENV{STARPU_LIB}; -lstarpu-$ENV{STARPU_VERSION}") # CACHE STRING "Set your STARPU flags"
if(ScalFMM_USE_MPI)
SET(STARPU_LIBRARIES "${STARPU_LIBRARIES} -lstarpumpi-1.1")
SET(STARPU_LIBRARIES "${STARPU_LIBRARIES} -lstarpumpi-$ENV{STARPU_VERSION}")
endif()
SET(STARPU_INCLUDES "$ENV{STARPU_INC}" ) # CACHE STRING "Set your STARPU flags"
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}; ${STARPU_LIBRARIES}")
# SET(SCALFMM_INCLUDES "${SCALFMM_INCLUDES}; ${STARPU_INCLUDES}")
include_directories(${STARPU_INCLUDES})
MESSAGE(STATUS " STARPU_LIBRARIES = ${STARPU_LIBRARIES}")
MESSAGE(STATUS " STARPU_INCLUDES = ${STARPU_INCLUDES}")
endif(ScalFMM_USE_STARPU)
list(APPEND FUSE_LIST "STARPU")
#
......
......@@ -157,7 +157,7 @@ protected:
m2m_cl[idx].cpu_funcs[0] = StarPUCpuWrapperClass::upwardPassCallback;
m2m_cl[idx].nbuffers = idx+2;
m2m_cl[idx].dyn_modes = (starpu_data_access_mode*)malloc((idx+2)*sizeof(starpu_data_access_mode));
m2m_cl[idx].dyn_modes[0] = STARPU_RW;
m2m_cl[idx].dyn_modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
l2l_cl[idx].where = STARPU_CPU;
l2l_cl[idx].cpu_funcs[0] = StarPUCpuWrapperClass::downardPassCallback;
......@@ -167,7 +167,7 @@ protected:
for(int idxBuffer = 0 ; idxBuffer <= idx ; ++idxBuffer){
m2m_cl[idx].dyn_modes[idxBuffer+1] = STARPU_R;
l2l_cl[idx].dyn_modes[idxBuffer+1] = STARPU_RW;
l2l_cl[idx].dyn_modes[idxBuffer+1] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
}
}
......@@ -176,32 +176,32 @@ protected:
l2p_cl.cpu_funcs[0] = StarPUCpuWrapperClass::mergePassCallback;
l2p_cl.nbuffers = 2;
l2p_cl.modes[0] = STARPU_R;
l2p_cl.modes[1] = STARPU_RW;
l2p_cl.modes[1] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
memset(&p2p_cl_in, 0, sizeof(p2p_cl_in));
p2p_cl_in.where = STARPU_CPU;
p2p_cl_in.cpu_funcs[0] = StarPUCpuWrapperClass::directInPassCallback;
p2p_cl_in.nbuffers = 1;
p2p_cl_in.modes[0] = STARPU_RW;
p2p_cl_in.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
memset(&p2p_cl_inout, 0, sizeof(p2p_cl_inout));
p2p_cl_inout.where = STARPU_CPU;
p2p_cl_inout.cpu_funcs[0] = StarPUCpuWrapperClass::directInoutPassCallback;
p2p_cl_inout.nbuffers = 2;
p2p_cl_inout.modes[0] = STARPU_RW;
p2p_cl_inout.modes[1] = STARPU_RW;
p2p_cl_inout.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
p2p_cl_inout.modes[1] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
memset(&m2l_cl_in, 0, sizeof(m2l_cl_in));
m2l_cl_in.where = STARPU_CPU;
m2l_cl_in.cpu_funcs[0] = StarPUCpuWrapperClass::transferInPassCallback;
m2l_cl_in.nbuffers = 2;
m2l_cl_in.modes[0] = STARPU_RW;
m2l_cl_in.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
m2l_cl_in.modes[1] = STARPU_R;
memset(&m2l_cl_inout, 0, sizeof(m2l_cl_inout));
m2l_cl_inout.where = STARPU_CPU;
m2l_cl_inout.cpu_funcs[0] = StarPUCpuWrapperClass::transferInoutPassCallback;
m2l_cl_inout.nbuffers = 4;
m2l_cl_inout.modes[0] = STARPU_RW;
m2l_cl_inout.modes[1] = STARPU_RW;
m2l_cl_inout.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
m2l_cl_inout.modes[1] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
m2l_cl_inout.modes[2] = STARPU_R;
m2l_cl_inout.modes[3] = STARPU_R;
}
......@@ -523,7 +523,7 @@ protected:
starpu_insert_task(&m2l_cl_in,
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_RW, handles_down[idxLevel][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[idxLevel][idxGroup],
STARPU_R, handles_up[idxLevel][idxGroup],
0);
}
......@@ -539,8 +539,8 @@ protected:
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_RW, handles_down[idxLevel][idxGroup],
STARPU_RW, handles_down[idxLevel][interactionid],
(STARPU_RW|STARPU_COMMUTE), handles_down[idxLevel][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[idxLevel][interactionid],
STARPU_R, handles_up[idxLevel][idxGroup],
STARPU_R, handles_up[idxLevel][interactionid],
0);
......@@ -618,7 +618,7 @@ protected:
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
starpu_insert_task(&p2p_cl_in,
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_RW, handles_down[tree->getHeight()][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[tree->getHeight()][idxGroup],
0);
}
FLOG( timerInBlock.tac() );
......@@ -630,8 +630,8 @@ protected:
starpu_insert_task(&p2p_cl_inout,
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_RW, handles_down[tree->getHeight()][idxGroup],
STARPU_RW, handles_down[tree->getHeight()][interactionid],
(STARPU_RW|STARPU_COMMUTE), handles_down[tree->getHeight()][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[tree->getHeight()][interactionid],
0);
}
}
......@@ -652,7 +652,7 @@ protected:
starpu_insert_task(&l2p_cl,
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_R, handles_down[tree->getHeight()-1][idxGroup],
STARPU_RW, handles_down[tree->getHeight()][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[tree->getHeight()][idxGroup],
0);
}
......
......@@ -184,7 +184,7 @@ protected:
m2m_cl[idx].cpu_funcs[0] = StarPUCpuWrapperClass::upwardPassCallback;
m2m_cl[idx].nbuffers = idx+2;
m2m_cl[idx].dyn_modes = (starpu_data_access_mode*)malloc((idx+2)*sizeof(starpu_data_access_mode));
m2m_cl[idx].dyn_modes[0] = STARPU_RW;
m2m_cl[idx].dyn_modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
l2l_cl[idx].where = STARPU_CPU;
l2l_cl[idx].cpu_funcs[0] = StarPUCpuWrapperClass::downardPassCallback;
......@@ -194,7 +194,7 @@ protected:
for(int idxBuffer = 0 ; idxBuffer <= idx ; ++idxBuffer){
m2m_cl[idx].dyn_modes[idxBuffer+1] = STARPU_R;
l2l_cl[idx].dyn_modes[idxBuffer+1] = STARPU_RW;
l2l_cl[idx].dyn_modes[idxBuffer+1] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
}
}
......@@ -203,32 +203,32 @@ protected:
l2p_cl.cpu_funcs[0] = StarPUCpuWrapperClass::mergePassCallback;
l2p_cl.nbuffers = 2;
l2p_cl.modes[0] = STARPU_R;
l2p_cl.modes[1] = STARPU_RW;
l2p_cl.modes[1] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
memset(&p2p_cl_in, 0, sizeof(p2p_cl_in));
p2p_cl_in.where = STARPU_CPU;
p2p_cl_in.cpu_funcs[0] = StarPUCpuWrapperClass::directInPassCallback;
p2p_cl_in.nbuffers = 1;
p2p_cl_in.modes[0] = STARPU_RW;
p2p_cl_in.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
memset(&p2p_cl_inout, 0, sizeof(p2p_cl_inout));
p2p_cl_inout.where = STARPU_CPU;
p2p_cl_inout.cpu_funcs[0] = StarPUCpuWrapperClass::directInoutPassCallback;
p2p_cl_inout.nbuffers = 2;
p2p_cl_inout.modes[0] = STARPU_RW;
p2p_cl_inout.modes[1] = STARPU_RW;
p2p_cl_inout.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
p2p_cl_inout.modes[1] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
memset(&m2l_cl_in, 0, sizeof(m2l_cl_in));
m2l_cl_in.where = STARPU_CPU;
m2l_cl_in.cpu_funcs[0] = StarPUCpuWrapperClass::transferInPassCallback;
m2l_cl_in.nbuffers = 2;
m2l_cl_in.modes[0] = STARPU_RW;
m2l_cl_in.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
m2l_cl_in.modes[1] = STARPU_R;
memset(&m2l_cl_inout, 0, sizeof(m2l_cl_inout));
m2l_cl_inout.where = STARPU_CPU;
m2l_cl_inout.cpu_funcs[0] = StarPUCpuWrapperClass::transferInoutPassCallback;
m2l_cl_inout.nbuffers = 4;
m2l_cl_inout.modes[0] = STARPU_RW;
m2l_cl_inout.modes[1] = STARPU_RW;
m2l_cl_inout.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
m2l_cl_inout.modes[1] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
m2l_cl_inout.modes[2] = STARPU_R;
m2l_cl_inout.modes[3] = STARPU_R;
}
......@@ -265,14 +265,14 @@ protected:
p2p_cl_inout_mpi.where = STARPU_CPU;
p2p_cl_inout_mpi.cpu_funcs[0] = StarPUCpuWrapperClass::directInoutPassCallbackMpi;
p2p_cl_inout_mpi.nbuffers = 2;
p2p_cl_inout_mpi.modes[0] = STARPU_RW;
p2p_cl_inout_mpi.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
p2p_cl_inout_mpi.modes[1] = STARPU_R;
memset(&m2l_cl_inout_mpi, 0, sizeof(m2l_cl_inout_mpi));
m2l_cl_inout_mpi.where = STARPU_CPU;
m2l_cl_inout_mpi.cpu_funcs[0] = StarPUCpuWrapperClass::transferInoutPassCallbackMpi;
m2l_cl_inout_mpi.nbuffers = 2;
m2l_cl_inout_mpi.modes[0] = STARPU_RW;
m2l_cl_inout_mpi.modes[0] = starpu_data_access_mode(STARPU_RW|STARPU_COMMUTE);
m2l_cl_inout_mpi.modes[1] = STARPU_R;
}
......@@ -1135,7 +1135,7 @@ protected:
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_RW, handles_down[idxLevel][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[idxLevel][idxGroup],
STARPU_R, remoteCellGroups[idxLevel][interactionid].handle,
0);
}
......@@ -1157,7 +1157,7 @@ protected:
starpu_insert_task(&m2l_cl_in,
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_RW, handles_down[idxLevel][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[idxLevel][idxGroup],
STARPU_R, handles_up[idxLevel][idxGroup],
0);
}
......@@ -1173,8 +1173,8 @@ protected:
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_VALUE, &idxLevel, sizeof(idxLevel),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_RW, handles_down[idxLevel][idxGroup],
STARPU_RW, handles_down[idxLevel][interactionid],
(STARPU_RW|STARPU_COMMUTE), handles_down[idxLevel][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[idxLevel][interactionid],
STARPU_R, handles_up[idxLevel][idxGroup],
STARPU_R, handles_up[idxLevel][interactionid],
0);
......@@ -1367,7 +1367,7 @@ protected:
starpu_insert_task(&p2p_cl_inout_mpi,
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_RW, handles_down[tree->getHeight()][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[tree->getHeight()][idxGroup],
STARPU_R, remoteParticleGroupss[interactionid].handle,
0);
}
......@@ -1388,7 +1388,7 @@ protected:
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
starpu_insert_task(&p2p_cl_in,
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_RW, handles_down[tree->getHeight()][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[tree->getHeight()][idxGroup],
0);
}
FLOG( timerInBlock.tac() );
......@@ -1400,8 +1400,8 @@ protected:
starpu_insert_task(&p2p_cl_inout,
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_VALUE, &outsideInteractions, sizeof(outsideInteractions),
STARPU_RW, handles_down[tree->getHeight()][idxGroup],
STARPU_RW, handles_down[tree->getHeight()][interactionid],
(STARPU_RW|STARPU_COMMUTE), handles_down[tree->getHeight()][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[tree->getHeight()][interactionid],
0);
}
}
......@@ -1423,7 +1423,7 @@ protected:
starpu_insert_task(&l2p_cl,
STARPU_VALUE, &wrapperptr, sizeof(StarPUCpuWrapperClass*),
STARPU_R, handles_down[tree->getHeight()-1][idxGroup],
STARPU_RW, handles_down[tree->getHeight()][idxGroup],
(STARPU_RW|STARPU_COMMUTE), handles_down[tree->getHeight()][idxGroup],
0);
}
......
#ifndef FSTARPUUTILS_HPP
#define FSTARPUUTILS_HPP
/////////////////////////////////////////////////////
extern "C"{
#include <starpu.h>
}
#include <functional>
/////////////////////////////////////////////////////
#if (STARPU_MAJOR_VERSION >= 1) && (STARPU_MINOR_VERSION >= 2)
#define STARPU_SUPPORT_COMMUTE
#endif
/////////////////////////////////////////////////////
#include <functional>
class FStarPUUtils{
protected:
......@@ -21,5 +31,11 @@ public:
}
};
/////////////////////////////////////////////////////
#ifndef STARPU_SUPPORT_COMMUTE
#define STARPU_COMMUTE STARPU_NONE
#endif
#endif // FSTARPUUTILS_HPP
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