Commit 7d43b4a9 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Protect mpi methods if mpi is not enabled

parent ca5ba612
......@@ -382,19 +382,19 @@ protected:
p2p_cl_in.name = "p2p_cl_in";
memset(&p2p_cl_inout, 0, sizeof(p2p_cl_inout));
#ifdef STARPU_USE_CPU
if(originalCpuKernel->supportP2P(FSTARPU_CPU_IDX)){
if(originalCpuKernel->supportP2PExtern(FSTARPU_CPU_IDX)){
p2p_cl_inout.cpu_funcs[0] = StarPUCpuWrapperClass::directInoutPassCallback;
p2p_cl_inout.where |= STARPU_CPU;
}
#endif
#ifdef ScalFMM_ENABLE_CUDA_KERNEL
if(originalCpuKernel->supportP2P(FSTARPU_CUDA_IDX)){
if(originalCpuKernel->supportP2PExtern(FSTARPU_CUDA_IDX)){
p2p_cl_inout.cuda_funcs[0] = StarPUCudaWrapperClass::directInoutPassCallback;
p2p_cl_inout.where |= STARPU_CUDA;
}
#endif
#ifdef ScalFMM_ENABLE_OPENCL_KERNEL
if(originalCpuKernel->supportP2P(FSTARPU_OPENCL_IDX)){
if(originalCpuKernel->supportP2PExtern(FSTARPU_OPENCL_IDX)){
p2p_cl_inout.opencl_funcs[0] = StarPUOpenClWrapperClass::directInoutPassCallback;
p2p_cl_inout.where |= STARPU_OPENCL;
}
......@@ -432,19 +432,19 @@ protected:
m2l_cl_in.name = "m2l_cl_in";
memset(&m2l_cl_inout, 0, sizeof(m2l_cl_inout));
#ifdef STARPU_USE_CPU
if(originalCpuKernel->supportM2L(FSTARPU_CPU_IDX)){
if(originalCpuKernel->supportM2LExtern(FSTARPU_CPU_IDX)){
m2l_cl_inout.cpu_funcs[0] = StarPUCpuWrapperClass::transferInoutPassCallback;
m2l_cl_inout.where |= STARPU_CPU;
}
#endif
#ifdef ScalFMM_ENABLE_CUDA_KERNEL
if(originalCpuKernel->supportM2L(FSTARPU_CUDA_IDX)){
if(originalCpuKernel->supportM2LExtern(FSTARPU_CUDA_IDX)){
m2l_cl_inout.cuda_funcs[0] = StarPUCudaWrapperClass::transferInoutPassCallback;
m2l_cl_inout.where |= STARPU_CUDA;
}
#endif
#ifdef ScalFMM_ENABLE_OPENCL_KERNEL
if(originalCpuKernel->supportM2L(FSTARPU_OPENCL_IDX)){
if(originalCpuKernel->supportM2LExtern(FSTARPU_OPENCL_IDX)){
m2l_cl_inout.opencl_funcs[0] = StarPUOpenClWrapperClass::transferInoutPassCallback;
m2l_cl_inout.where |= STARPU_OPENCL;
}
......
......@@ -137,7 +137,7 @@ __host__ void FCuda__upwardPassCallback(unsigned char* currentCellsPtr, std::siz
/////////////////////////////////////////////////////////////////////////////////////
/// Transfer Pass Mpi
/////////////////////////////////////////////////////////////////////////////////////
#ifdef ScalFMM_USE_MPI
template <class SymboleCellClass, class PoleCellClass, class LocalCellClass,
class CellContainerClass, class ParticleContainerGroupClass, class ParticleGroupClass, class CudaKernelClass>
__global__ void FCuda__transferInoutPassPerformMpi(unsigned char* currentCellsPtr, std::size_t currentCellsSize, unsigned char* currentCellsDownPtr,
......@@ -185,7 +185,7 @@ __host__ void FCuda__transferInoutPassCallbackMpi(unsigned char* currentCellsPtr
FCudaCheck(cudaFree(cuOutsideInteractions));
}
#endif
/////////////////////////////////////////////////////////////////////////////////////
/// Transfer Pass
......@@ -382,7 +382,7 @@ __host__ void FCuda__downardPassCallback(unsigned char* currentCellsPtr, std::si
/////////////////////////////////////////////////////////////////////////////////////
/// Direct Pass MPI
/////////////////////////////////////////////////////////////////////////////////////
#ifdef ScalFMM_USE_MPI
template <class SymboleCellClass, class PoleCellClass, class LocalCellClass,
class CellContainerClass, class ParticleContainerGroupClass, class ParticleGroupClass, class CudaKernelClass>
__global__ void FCuda__directInoutPassPerformMpi(unsigned char* containersPtr, std::size_t containersSize, unsigned char* containersDownPtr,
......@@ -429,7 +429,7 @@ __host__ void FCuda__directInoutPassCallbackMpi(unsigned char* containersPtr, st
FCudaCheck(cudaFree(cuOutsideInteractions));
}
#endif
/////////////////////////////////////////////////////////////////////////////////////
/// Direct Pass
/////////////////////////////////////////////////////////////////////////////////////
......@@ -618,14 +618,14 @@ template void FCuda__upwardPassCallback<FCudaEmptyCellSymb, int, int, FCudaGroup
FCudaParams<unsigned char*,9> subCellGroupsPtr, FCudaParams<std::size_t, 9> subCellGroupsSize,
FCudaParams<unsigned char*,9> subCellGroupsUpPtr,
int nbSubCellGroups, int idxLevel, FCudaEmptyKernel* kernel, cudaStream_t currentStream);
#ifdef ScalFMM_USE_MPI
template void FCuda__transferInoutPassCallbackMpi<FCudaEmptyCellSymb, int, int, FCudaGroupOfCells<FCudaEmptyCellSymb, int, int>,
FCudaGroupOfParticles<0,0,int>, FCudaGroupAttachedLeaf<0,0,int>, FCudaEmptyKernel >
(unsigned char* currentCellsPtr, std::size_t currentCellsSize, unsigned char* currentCellsDownPtr,
unsigned char* externalCellsPtr, std::size_t externalCellsSize, unsigned char* externalCellsUpPtr,
int idxLevel, const OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, FCudaEmptyKernel* kernel, cudaStream_t currentStream);
#endif
template void FCuda__transferInPassCallback<FCudaEmptyCellSymb, int, int, FCudaGroupOfCells<FCudaEmptyCellSymb, int, int>,
FCudaGroupOfParticles<0,0,int>, FCudaGroupAttachedLeaf<0,0,int>, FCudaEmptyKernel >
(unsigned char* currentCellsPtr, std::size_t currentCellsSize,
......@@ -647,14 +647,14 @@ template void FCuda__downardPassCallback<FCudaEmptyCellSymb, int, int, FCudaGrou
FCudaParams<unsigned char*,9> subCellGroupsPtr, FCudaParams<std::size_t,9> subCellGroupsSize,
FCudaParams<unsigned char*,9> subCellGroupsDownPtr,
int nbSubCellGroups, int idxLevel, FCudaEmptyKernel* kernel, cudaStream_t currentStream);
#ifdef ScalFMM_USE_MPI
template void FCuda__directInoutPassCallbackMpi<FCudaEmptyCellSymb, int, int, FCudaGroupOfCells<FCudaEmptyCellSymb, int, int>,
FCudaGroupOfParticles<0,0,int>, FCudaGroupAttachedLeaf<0,0,int>, FCudaEmptyKernel >
(unsigned char* containersPtr, std::size_t containersSize, unsigned char* containersDownPtr,
unsigned char* externalContainersPtr, std::size_t externalContainersSize,
const OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, const int treeHeight, FCudaEmptyKernel* kernel, cudaStream_t currentStream);
#endif
template void FCuda__directInPassCallback<FCudaEmptyCellSymb, int, int, FCudaGroupOfCells<FCudaEmptyCellSymb, int, int>,
FCudaGroupOfParticles<0,0,int>, FCudaGroupAttachedLeaf<0,0,int>, FCudaEmptyKernel >
(unsigned char* containersPtr, std::size_t containersSize, unsigned char* containersDownPtr,
......@@ -695,14 +695,14 @@ template void FCuda__upwardPassCallback<FTestCellPODCore, FTestCellPODData, FTes
FCudaParams<unsigned char*,9> subCellGroupsPtr, FCudaParams<std::size_t, 9> subCellGroupsSize,
FCudaParams<unsigned char*,9> subCellGroupsUpPtr,
int nbSubCellGroups, int idxLevel, FTestCudaKernels* kernel, cudaStream_t currentStream);
#ifdef ScalFMM_USE_MPI
template void FCuda__transferInoutPassCallbackMpi<FTestCellPODCore, FTestCellPODData, FTestCellPODData, FCudaGroupOfCells<FTestCellPODCore, FTestCellPODData, FTestCellPODData>,
FCudaGroupOfParticles<0, 1, long long int>, FCudaGroupAttachedLeaf<0, 1, long long int>, FTestCudaKernels >
(unsigned char* currentCellsPtr, std::size_t currentCellsSize, unsigned char* currentCellsDownPtr,
unsigned char* externalCellsPtr, std::size_t externalCellsSize, unsigned char* externalCellsUpPtr,
int idxLevel, const OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, FTestCudaKernels* kernel, cudaStream_t currentStream);
#endif
template void FCuda__transferInPassCallback<FTestCellPODCore, FTestCellPODData, FTestCellPODData, FCudaGroupOfCells<FTestCellPODCore, FTestCellPODData, FTestCellPODData>,
FCudaGroupOfParticles<0, 1, long long int>, FCudaGroupAttachedLeaf<0, 1, long long int>, FTestCudaKernels >
(unsigned char* currentCellsPtr, std::size_t currentCellsSize,
......@@ -724,14 +724,14 @@ template void FCuda__downardPassCallback<FTestCellPODCore, FTestCellPODData, FTe
FCudaParams<unsigned char*,9> subCellGroupsPtr, FCudaParams<std::size_t,9> subCellGroupsSize,
FCudaParams<unsigned char*,9> subCellGroupsDownPtr,
int nbSubCellGroups, int idxLevel, FTestCudaKernels* kernel, cudaStream_t currentStream);
#ifdef ScalFMM_USE_MPI
template void FCuda__directInoutPassCallbackMpi<FTestCellPODCore, FTestCellPODData, FTestCellPODData, FCudaGroupOfCells<FTestCellPODCore, FTestCellPODData, FTestCellPODData>,
FCudaGroupOfParticles<0, 1, long long int>, FCudaGroupAttachedLeaf<0, 1, long long int>, FTestCudaKernels >
(unsigned char* containersPtr, std::size_t containersSize, unsigned char* containersDownPtr,
unsigned char* externalContainersPtr, std::size_t externalContainersSize,
const OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, const int treeHeight, FTestCudaKernels* kernel, cudaStream_t currentStream);
#endif
template void FCuda__directInPassCallback<FTestCellPODCore, FTestCellPODData, FTestCellPODData, FCudaGroupOfCells<FTestCellPODCore, FTestCellPODData, FTestCellPODData>,
FCudaGroupOfParticles<0, 1, long long int>, FCudaGroupAttachedLeaf<0, 1, long long int>, FTestCudaKernels >
(unsigned char* containersPtr, std::size_t containersSize, unsigned char* containersDownPtr,
......
......@@ -20,7 +20,7 @@ void FCuda__upwardPassCallback(
FCudaParams<unsigned char*,9> subCellGroupsPtr, FCudaParams<std::size_t, 9> subCellGroupsSize,
FCudaParams<unsigned char*,9> subCellGroupsUpPtr,
int nbSubCellGroups, int idxLevel, CudaKernelClass* kernel, cudaStream_t currentStream);
#ifdef ScalFMM_USE_MPI
template <class SymboleCellClass, class PoleCellClass, class LocalCellClass,
class CellContainerClass, class ParticleContainerGroupClass, class ParticleGroupClass, class CudaKernelClass>
void FCuda__transferInoutPassCallbackMpi(
......@@ -28,7 +28,7 @@ void FCuda__transferInoutPassCallbackMpi(
unsigned char* externalCellsPtr, std::size_t externalCellsSize, unsigned char* externalCellsUpPtr,
int idxLevel, const OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, CudaKernelClass* kernel, cudaStream_t currentStream);
#endif
template <class SymboleCellClass, class PoleCellClass, class LocalCellClass,
class CellContainerClass, class ParticleContainerGroupClass, class ParticleGroupClass, class CudaKernelClass>
void FCuda__transferInPassCallback(
......@@ -53,7 +53,7 @@ void FCuda__downardPassCallback(
FCudaParams<unsigned char*,9> subCellGroupsPtr, FCudaParams<std::size_t,9> subCellGroupsSize,
FCudaParams<unsigned char*,9> subCellGroupsDownPtr,
int nbSubCellGroups, int idxLevel, CudaKernelClass* kernel, cudaStream_t currentStream);
#ifdef ScalFMM_USE_MPI
template <class SymboleCellClass, class PoleCellClass, class LocalCellClass,
class CellContainerClass, class ParticleContainerGroupClass, class ParticleGroupClass, class CudaKernelClass>
void FCuda__directInoutPassCallbackMpi(
......@@ -61,7 +61,7 @@ void FCuda__directInoutPassCallbackMpi(
unsigned char* externalContainersPtr, std::size_t externalContainersSize,
const OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, const int treeHeight, CudaKernelClass* kernel, cudaStream_t currentStream);
#endif
template <class SymboleCellClass, class PoleCellClass, class LocalCellClass,
class CellContainerClass, class ParticleContainerGroupClass, class ParticleGroupClass, class CudaKernelClass>
void FCuda__directInPassCallback(
......
......@@ -53,10 +53,10 @@ protected:
cl_kernel kernel_upwardPassPerform;
cl_command_queue queue_upwardPassPerform;
#ifdef ScalFMM_USE_MPI
cl_kernel kernel_transferInoutPassPerformMpi;
cl_command_queue queue_transferInoutPassPerformMpi;
#endif
cl_kernel kernel_transferInPassPerform;
cl_command_queue queue_transferInPassPerform;
......@@ -65,10 +65,10 @@ protected:
cl_kernel kernel_downardPassPerform;
cl_command_queue queue_downardPassPerform;
#ifdef ScalFMM_USE_MPI
cl_kernel kernel_directInoutPassPerformMpi;
cl_command_queue queue_directInoutPassPerformMpi;
#endif
cl_kernel kernel_directInoutPassPerform;
cl_command_queue queue_directInoutPassPerform;
......@@ -98,11 +98,15 @@ public:
FAssertLF( starpu_opencl_load_kernel(&kernel_bottomPassPerform, &queue_bottomPassPerform, &opencl_code, "FOpenCL__bottomPassPerform", workerDevid) == CL_SUCCESS);
FAssertLF( starpu_opencl_load_kernel(&kernel_upwardPassPerform, &queue_upwardPassPerform, &opencl_code, "FOpenCL__upwardPassPerform", workerDevid) == CL_SUCCESS);
#ifdef ScalFMM_USE_MPI
FAssertLF( starpu_opencl_load_kernel(&kernel_transferInoutPassPerformMpi, &queue_transferInoutPassPerformMpi, &opencl_code, "FOpenCL__transferInoutPassPerformMpi", workerDevid) == CL_SUCCESS);
#endif
FAssertLF( starpu_opencl_load_kernel(&kernel_transferInPassPerform, &queue_transferInPassPerform, &opencl_code, "FOpenCL__transferInPassPerform", workerDevid) == CL_SUCCESS);
FAssertLF( starpu_opencl_load_kernel(&kernel_transferInoutPassPerform, &queue_transferInoutPassPerform, &opencl_code, "FOpenCL__transferInoutPassPerform", workerDevid) == CL_SUCCESS);
FAssertLF( starpu_opencl_load_kernel(&kernel_downardPassPerform, &queue_downardPassPerform, &opencl_code, "FOpenCL__downardPassPerform", workerDevid) == CL_SUCCESS);
#ifdef ScalFMM_USE_MPI
FAssertLF( starpu_opencl_load_kernel(&kernel_directInoutPassPerformMpi, &queue_directInoutPassPerformMpi, &opencl_code, "FOpenCL__directInoutPassPerformMpi", workerDevid) == CL_SUCCESS);
#endif
FAssertLF( starpu_opencl_load_kernel(&kernel_directInoutPassPerform, &queue_directInoutPassPerform, &opencl_code, "FOpenCL__directInoutPassPerform", workerDevid) == CL_SUCCESS);
FAssertLF( starpu_opencl_load_kernel(&kernel_directInPassPerform, &queue_directInPassPerform, &opencl_code, "FOpenCL__directInPassPerform", workerDevid) == CL_SUCCESS);
FAssertLF( starpu_opencl_load_kernel(&kernel_mergePassPerform, &queue_mergePassPerform, &opencl_code, "FOpenCL__mergePassPerform", workerDevid) == CL_SUCCESS);
......@@ -120,10 +124,10 @@ public:
err = starpu_opencl_release_kernel(kernel_upwardPassPerform);
if(err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
#ifdef ScalFMM_USE_MPI
err = starpu_opencl_release_kernel(kernel_transferInoutPassPerformMpi);
if(err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
#endif
err = starpu_opencl_release_kernel(kernel_transferInPassPerform);
if(err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
......@@ -132,10 +136,10 @@ public:
err = starpu_opencl_release_kernel(kernel_downardPassPerform);
if(err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
#ifdef ScalFMM_USE_MPI
err = starpu_opencl_release_kernel(kernel_directInoutPassPerformMpi);
if(err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
#endif
err = starpu_opencl_release_kernel(kernel_directInoutPassPerform);
if(err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
......@@ -181,7 +185,7 @@ public:
kernelFilename.getNbGroups(), kernelFilename.getGroupSize(), 0, NULL, NULL);
if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
}
#ifdef ScalFMM_USE_MPI
void transferInoutPassPerformMpi(cl_mem currentCellsPtr, size_t currentCellsSize, cl_mem currentCellsDownPtr,
cl_mem externalCellsPtr, size_t externalCellsSize, cl_mem externalCellsUpPtr,
int idxLevel, cl_mem outsideInteractionsCl, size_t outsideInteractionsSize){
......@@ -192,7 +196,7 @@ public:
kernelFilename.getNbGroups(), kernelFilename.getGroupSize(), 0, NULL, NULL);
if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
}
#endif
void transferInPassPerform(cl_mem currentCellsPtr, size_t currentCellsSize,
cl_mem currentCellsUpPtr, cl_mem currentCellsDownPtr, int idxLevel){
SetKernelArgs(kernel_transferInPassPerform, 0, &currentCellsPtr, &currentCellsSize, &currentCellsUpPtr,
......@@ -229,7 +233,7 @@ public:
kernelFilename.getNbGroups(), kernelFilename.getGroupSize(), 0, NULL, NULL);
if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
}
#ifdef ScalFMM_USE_MPI
void directInoutPassPerformMpi(cl_mem containersPtr, size_t containersSize, cl_mem containersDownPtr,
cl_mem externalContainersPtr, size_t externalContainersSize, cl_mem outsideInteractionsCl,
size_t outsideInteractionsSize){
......@@ -239,7 +243,7 @@ public:
kernelFilename.getNbGroups(), kernelFilename.getGroupSize(), 0, NULL, NULL);
if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
}
#endif
void directInPassPerform(cl_mem containersPtr, size_t containerSize, cl_mem containersDownPtr){
SetKernelArgs(kernel_directInPassPerform, 0, &containersPtr, &containerSize, &containersDownPtr, &treeHeight, &user_data);
const int err = clEnqueueNDRangeKernel(queue_directInPassPerform, kernel_directInPassPerform, kernelFilename.getNbDims(), NULL,
......
......@@ -13,9 +13,15 @@ public:
virtual bool supportP2M(const FStarPUTypes inPu) const = 0;
virtual bool supportM2M(const FStarPUTypes inPu) const = 0;
virtual bool supportM2L(const FStarPUTypes inPu) const = 0;
virtual bool supportM2LExtern(const FStarPUTypes inPu) const = 0;
virtual bool supportL2L(const FStarPUTypes inPu) const = 0;
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 {
......@@ -31,6 +37,9 @@ public:
bool supportM2L(const FStarPUTypes inPu) const override {
return check(inPu);
}
bool supportM2LExtern(const FStarPUTypes inPu) const override {
return check(inPu);
}
bool supportL2L(const FStarPUTypes inPu) const override {
return check(inPu);
}
......@@ -40,6 +49,9 @@ public:
bool supportP2P(const FStarPUTypes inPu) const override {
return check(inPu);
}
bool supportP2PExtern(const FStarPUTypes inPu) const override {
return check(inPu);
}
};
/**
......
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