...
 
Commits (100)
image: hpclib/hiepacs image: hpclib/hiepacs
before_script:
- source /usr/share/modules/init/bash && source /usr/local/share/spack/setup-env.sh && spack load cmake
variables: variables:
GIT_SUBMODULE_STRATEGY: normal GIT_SUBMODULE_STRATEGY: normal
stages: stages:
- build - build
- pages
- test - test
- sonar - sonar
...@@ -19,8 +23,8 @@ build: ...@@ -19,8 +23,8 @@ build:
- cd Build && cmake .. - cd Build && cmake ..
-DSCALFMM_USE_LOG=ON -DSCALFMM_USE_LOG=ON
-DSCALFMM_USE_ASSERT=ON -DSCALFMM_USE_ASSERT=ON
-DSCALFMM_USE_SSE=OFF -DINASTEMP_USE_AVX2=OFF
-DSCALFMM_USE_AVX=OFF -DINASTEMP_USE_AVX=OFF
-DSCALFMM_USE_BLAS=ON -DSCALFMM_USE_BLAS=ON
-DSCALFMM_USE_FFT=ON -DSCALFMM_USE_FFT=ON
-DSCALFMM_USE_MPI=ON -DSCALFMM_USE_MPI=ON
...@@ -29,8 +33,8 @@ build: ...@@ -29,8 +33,8 @@ build:
-DSCALFMM_BUILD_TESTS=ON -DSCALFMM_BUILD_TESTS=ON
-DSCALFMM_BUILD_UTESTS=ON -DSCALFMM_BUILD_UTESTS=ON
-DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_C_COMPILER=gcc-6 -DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++-6 -DCMAKE_CXX_COMPILER=g++
- make -j5 2>&1 |tee scalfmm-build.log - make -j5 2>&1 |tee scalfmm-build.log
doc: doc:
...@@ -43,9 +47,22 @@ doc: ...@@ -43,9 +47,22 @@ doc:
script: script:
- cd Build && cmake .. - cd Build && cmake ..
-DSCALFMM_BUILD_DOC=ON -DSCALFMM_BUILD_DOC=ON
-DCMAKE_C_COMPILER=gcc-6 -DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++-6 -DCMAKE_CXX_COMPILER=g++
- make doc - make doc
pages:
stage: pages
dependencies:
- doc
artifacts:
paths:
- public
script:
- mkdir public
- mv Build/Doc/html/* public/
only:
- master
test: test:
stage: test stage: test
...@@ -57,7 +74,7 @@ test: ...@@ -57,7 +74,7 @@ test:
paths: paths:
- Build/ - Build/
script: script:
- (cd Build && OMP_NUM_THREADS=4 ctest --no-compress-output -V -j 5 -D ExperimentalBuild -D ExperimentalTest -D ExperimentalCoverage -D ExperimentalSubmit) - (cd Build && OMP_NUM_THREADS=4 ctest --no-compress-output -VV -j 5 -D ExperimentalBuild -D ExperimentalTest -D ExperimentalCoverage -D ExperimentalSubmit)
sonar: sonar:
stage: sonar stage: sonar
...@@ -78,4 +95,4 @@ sonar: ...@@ -78,4 +95,4 @@ sonar:
- source ./Utils/scripts/analysis.sh - source ./Utils/scripts/analysis.sh
- sonar-scanner |tee sonar.log; - sonar-scanner |tee sonar.log;
only: only:
- develop@solverstack/ScalFMM - master@solverstack/ScalFMM
\ No newline at end of file
[submodule "CMakeModules/morse_cmake"] [submodule "CMakeModules/morse_cmake"]
path = CMakeModules/morse_cmake path = CMakeModules/morse_cmake
url = https://gitlab.inria.fr/solverstack/morse_cmake.git url = https://gitlab.inria.fr/solverstack/morse_cmake.git
[submodule "inastemp"]
path = inastemp
url = https://gitlab.inria.fr/coulaud/inastemp.git
This diff is collapsed.
###########################################################################################
# Berenger Bramas Inria
# This goes with the getCpuInfos.cpp
# This will create one CMAKE value per output option from the cpp file.
# For example the output of the CPP file can be:
# SSE3=TRUE;AVX=FALSE
# Then it will create:
# CPUOPTION_SSE3 = TRUE
# CPUOPTION_AVX = FALSE
#
# The binary should return 0 on success.
###########################################################################################
macro(GetCpuInfos)
# The original CPP file
set(GetCpuInfosFile "${PROJECT_SOURCE_DIR}/CMakeModules/getCpuInfos.cpp")
# Fatal error if the file does not exist
if(NOT EXISTS ${GetCpuInfosFile})
message(FATAL_ERROR "The GetCpuInfosFile does not exist (${GetCpuInfosFile})")
endif()
# Compile and execute the file
try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
${CMAKE_BINARY_DIR} ${GetCpuInfosFile} # [CMAKE_FLAGS <Flags>] [COMPILE_DEFINITIONS <flags>]
COMPILE_OUTPUT_VARIABLE comp
RUN_OUTPUT_VARIABLE run)
# If it has successfuly compiled an run
if(COMPILE_RESULT_VAR AND (RUN_RESULT_VAR EQUAL 0) )
set( CPU_OPTIONS ${run} )
# For each value
foreach(optionNode ${run})
# Get name and value
string(REPLACE "=" ";" optionNameAndValue ${optionNode})
list(LENGTH optionNameAndValue optionLength)
# If we get both
if(optionLength EQUAL 2)
list(GET optionNameAndValue 0 optionName)
list(GET optionNameAndValue 1 optionValue)
# create cmake variable
set(CPUOPTION_${optionName} ${optionValue})
else()
message(WARNING "GetCpuInfosFile wrong format for ${optionNode}.")
endif()
endforeach()
# output the sentence from the binrary
message(STATUS "CPUOPTION : ${CPU_OPTIONS}")
else()
message(WARNING "GetCpuInfosFile did not return correctly.")
endif()
endmacro(GetCpuInfos)
#include "immintrin.h"
int main() {
#ifdef __MIC__
__m512 tx, ty ;
tx += ty ;
#endif
return 0;
}
#include "immintrin.h"
int main() {
__m256d tx, ty ;
tx += ty ;
return 0;
}
#include <xmmintrin.h> // SSE
#include <emmintrin.h> //SSE2
#include <pmmintrin.h> //SSE3
#ifdef __SSSE3__
#include <tmmintrin.h> //SSSE3
#endif
#ifdef __SSSE4_1__
#include <smmintrin.h> // SSE4
#endif
int main() {
__m128d tx, ty ;
tx += ty ;
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
#include <tmmintrin.h> // SSSE3
#include <smmintrin.h> // SSE4
#include <immintrin.h> // AVX
int main(){
{
__m256d res0d, res1d;
res0d = _mm256_hadd_pd(res0d, res1d);
__m256 res0, res1;
res0 = _mm256_hadd_ps(res0, res1);
}
{
__m128d res0d, res1d;
res0d = _mm_hadd_pd(res0d, res1d);
__m128 res0, res1;
res0 = _mm_hadd_ps(res0, res1);
}
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
#include <tmmintrin.h> // SSSE3
#include <smmintrin.h> // SSE4
#include <immintrin.h> // AVX
int main(){
{
#ifdef __MIC__
__m512d res0d, res1d;
res0d = _mm512_hadd_pd(res0d, res1d);
__m512 res0, res1;
res0 = _mm512_hadd_ps(res0, res1);
#endif
}
{
__m256d res0d, res1d;
res0d = _mm256_hadd_pd(res0d, res1d);
__m256 res0, res1;
res0 = _mm256_hadd_ps(res0, res1);
}
{
__m128d res0d, res1d;
res0d = _mm_hadd_pd(res0d, res1d);
__m128 res0, res1;
res0 = _mm_hadd_ps(res0, res1);
}
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
#ifdef __SSSE3__
#include <tmmintrin.h> //SSSE3
#endif
#ifdef __SSSE4_1__
#include <smmintrin.h> // SSE4
#endif
int main(){
__m128d res0d, res1d;
res0d = _mm_hadd_pd(res0d, res1d);
__m128 res0, res1;
res0 = _mm_hadd_ps(res0, res1);
return 0;
}
This diff is collapsed.
Subproject commit 31198c66ff51f600dde4282faed234a4c0b9cfd9 Subproject commit 41ca6a54d906b91b1a2439fe68d69f95cef89f9b
# helper function for generating targets
# This function creates an executable target with a list
# of sources and all requirements passed as arguments
# if the expression passed as boolean is true.
# ----------------------------------------------------
function(scalfmm_create_target target_name sources_list dependencies options )
# Here, we generate a vector of boolean to check if dependencies (targets)
# exists. 1 is yes, 0 otherwise
foreach(dep IN LISTS dependencies)
if(TARGET ${dep})
list(APPEND VECTOR_BOOL 1)
else()
list(APPEND VECTOR_BOOL 0)
endif()
endforeach()
# If all dependencies are met, we generate the target, otherwise not.
if(NOT 0 IN_LIST VECTOR_BOOL)
add_executable(${target_name} ${sources_list})
target_link_libraries(${target_name} PRIVATE ${dependencies})
target_compile_options(${target_name} PRIVATE ${options})
set_target_properties(${target_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BUILD_TYPE})
install(TARGETS ${target_name} RUNTIME DESTINATION bin)
endif()
endfunction(scalfmm_create_target)
set(CPACK_PACKAGE_VERSION_PATCH 0)
execute_process(
COMMAND git rev-list HEAD --count
OUTPUT_VARIABLE CPACK_PACKAGE_VERSION_PATCH
RESULT_VARIABLE RET
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
#string_TRIM(PATCH1 PATCH)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "ON")
#
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENCE")
set(CPACK_PACKAGE_VERSION_MAJOR "${${CMAKE_PROJECT_NAME}_MAJOR_VERSION}")
set(CPACK_PACKAGE_VERSION_MINOR "${${CMAKE_PROJECT_NAME}_MINOR_VERSION}")
#
set(PACK_PACKAGE_VERSION "${${CMAKE_PROJECT_NAME}_VERSION}.${${CMAKE_PROJECT_NAME}_MINOR_VERSION}-${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "SCALFMM-${${CMAKE_PROJECT_NAME}_MAJOR_VERSION}.${${CMAKE_PROJECT_NAME}_MINOR_VERSION}-${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_IGNORE_FILES "\\\\.git;.DS_Store;.*~;/*.aux;/*.idx;/*.log;/*.out;/*.toc;/*.ilg;CMakeLists.txt.user;/.settings/")
list(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/Utils/;/Build*;/Obsolete/")
#
...@@ -6,11 +6,7 @@ ...@@ -6,11 +6,7 @@
## INCLUDE(CTest) ## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "ScalFMM") set(CTEST_PROJECT_NAME "ScalFMM")
set(CTEST_NIGHTLY_START_TIME "00:00:00 GMT") set(CTEST_NIGHTLY_START_TIME "00:00:00 GMT")
set(CTEST_SUBMIT_URL "http://cdash.inria.fr/CDash/submit.php?project=scalfmm")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "cdash.inria.fr")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=scalfmm")
set(CTEST_DROP_SITE_CDASH TRUE)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# BUILDNAME variable construction # BUILDNAME variable construction
......
...@@ -3,6 +3,7 @@ find_package(Doxygen) ...@@ -3,6 +3,7 @@ find_package(Doxygen)
if(DOXYGEN_FOUND) if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-mcss ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-mcss COPYONLY)
add_custom_target( add_custom_target(
doc doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
......
@INCLUDE = Doxyfile
GENERATE_HTML = NO
GENERATE_XML = YES
XML_PROGRAMLISTINGS = NO
...@@ -658,7 +658,8 @@ WARN_LOGFILE = ...@@ -658,7 +658,8 @@ WARN_LOGFILE =
# with spaces. # with spaces.
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../Doc/Site_dox \ INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../Doc/Site_dox \
@CMAKE_CURRENT_SOURCE_DIR@/../Src/ \ @CMAKE_CURRENT_SOURCE_DIR@/../src/ \
@CMAKE_CURRENT_SOURCE_DIR@/../include/ \
@CMAKE_CURRENT_SOURCE_DIR@/../Examples/ \ @CMAKE_CURRENT_SOURCE_DIR@/../Examples/ \
@CMAKE_CURRENT_SOURCE_DIR@/../Tests/ @CMAKE_CURRENT_SOURCE_DIR@/../Tests/
......
# check if compiling into source directories # Examples
STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource) # --------
if(insource)
MESSAGE(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto scalfmm/Build and tapes cmake ../")
endif(insource)
project(EXAMPLES_SCALFMM CXX) # List of source files
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BUILD_TYPE}) set(source_tests_files
#ADD_DEFINITIONS( ${SCALFMM_CXX_FLAGS}) changeFmaFormat.cpp
ChebyshevHybridFMM.cpp
ChebyshevOpenMPAdaptiveFMM.cpp
ChebyshevOpenMPFMM.cpp
ChebyshevStarpuImplicit.cpp
compare2Files.cpp
compareAllPoissonKernels.cpp
CutOffAlgorithm.cpp
DirectComputation.cpp
generateDistributions.cpp
LagrangeHybridFMM.cpp
LagrangeInterpolationAdaptiveFMM.cpp
LagrangeOpenMPFMM.cpp
LagrangeStarpuImplicit.cpp
RotationFMM.cpp
RotationMPIFMM.cpp
statisticsOnOctree.cpp
)
# Adding the project sources dir as an include dir # Add execs - 1 cpp = 1 exec
INCLUDE_DIRECTORIES( foreach(exec ${source_tests_files})
${SCALFMM_BINARY_DIR}/Src set(compile_exec TRUE)
${SCALFMM_SOURCE_DIR}/Src get_filename_component( execname ${exec} NAME_WE )
${SCALFMM_SOURCE_DIR}/Contribs
${SCALFMM_INCLUDES} foreach(fuse_key ${FUSE_DEP_AVAILABLE})
file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
) if(lines_fuse AND NOT ${fuse_key} IN_LIST FUSE_LIST)
set(GENERIC_SOURCE_FILES changeFmaFormat compare2Files generateDistributions statisticsOnOctree message( STATUS "This needs ${fuse_key} = ${exec}" )
DirectComputation CutOffAlgorithm RotationFMM compareAllPoissonKernels) set(compile_exec FALSE)
if(SCALFMM_USE_BLAS) endif()
set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES} ChebyshevInterpolationFMM ChebyshevInterpolationAdaptiveFMM ) endforeach()
endif(SCALFMM_USE_BLAS)
if(SCALFMM_USE_FFT) # Dependency are OK
set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES} UniformInterpolationFMM LagrangeInterpolationAdaptiveFMM ) if( compile_exec )
else() add_executable( ${execname} ${exec})
message(STATUS " &&&&&&&&&&&&&&&&&&&& SCALFMM_USE_FFT ${SCALFMM_USE_FFT}") list(APPEND SCALFMM_EXAMPLES_TARGETS ${execname})
endif(SCALFMM_USE_FFT) list(APPEND SCALFMM_TESTS_TARGETS ${execname})
set_target_properties(${execname} PROPERTIES ENABLE_EXPORTS TRUE
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BUILD_TYPE}
)
target_link_libraries( ${execname} PRIVATE ${CMAKE_PROJECT_NAME})
install(TARGETS ${execname} RUNTIME DESTINATION bin)
endif()
endforeach(exec)
if(SCALFMM_USE_MPI) add_custom_target(scalfmm_examples ALL DEPENDS ${SCALFMM_EXAMPLES_TARGETS})
set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES} RotationMPIFMM )
if(SCALFMM_USE_BLAS)
set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES} MPIChebyshevInterpolationFMM ChebyshevInterpolationMPIFMMSplit ChebyshevInterpolationMPIFMM )
endif(SCALFMM_USE_BLAS)
if(SCALFMM_USE_FFT)
set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES} MPIUniformInterpolationFMM)
endif(SCALFMM_USE_FFT)
endif()
#
#MESSAGE(WARNIG "GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES}")
#
#
#
foreach(exec ${GENERIC_SOURCE_FILES})
add_executable(${exec} ${exec}.cpp)
SET_TARGET_PROPERTIES(${exec} PROPERTIES ENABLE_EXPORTS TRUE)
target_link_libraries(${exec} ${scalfmm_lib} ${SCALFMM_LIBRARIES} )
install( TARGETS ${exec} DESTINATION bin )
endforeach(exec)
This diff is collapsed.
// See LICENCE file at project root
// ==== CMAKE =====
// @FUSE_MPI
// @FUSE_BLAS
// ================
#include <iostream>
#include <stdexcept>
#include <cstdio>
#include <cstdlib>
#include "ScalFmmConfig.h"
#include "Containers/FOctree.hpp"
#include "Utils/FMpi.hpp"
#include "Core/FFmmAlgorithmThreadProc.hpp"
#include "Files/FFmaGenericLoader.hpp"
#include "Files/FMpiSplitFmaLoader.hpp"
#include "Files/FMpiTreeBuilder.hpp"
#include "Utils/FLeafBalance.hpp"
#include "Kernels/Interpolation/FInterpMatrixKernel.hpp"
#include "Kernels/Chebyshev/FChebSymKernel.hpp"
#include "Kernels/Chebyshev/FChebCell.hpp"
#include "Components/FSimpleLeaf.hpp"
#include "Kernels/P2P/FP2PParticleContainerIndexed.hpp"
#include "Utils/FParameters.hpp"
#include "Utils/FParameterNames.hpp"
/// \file ChebyshevInterpolationMPIFMM
//!
//! \brief This program runs the MPI FMM with Chebyshev interpolation of 1/r kernel
//! \authors B. Bramas, O. Coulaud
//!
//! This code is a short example to use the FMM Algorithm Proc with Chebyshev Interpolation for the 1/r kernel
// Simply create particles and try the kernels
int main(int argc, char* argv[])
{
///////// PARAMETERS HANDLING //////////////////////////////////////
FHelpDescribeAndExit(
argc, argv,
"Driver for Chebyshev Interpolation kernel using MPI (1/r kernel).\n\n"
"usage: mpirun -np nb_proc_needed ./ChebyshevInterpolationAlgorithm [params]\n",
FParameterDefinitions::InputFile,
FParameterDefinitions::OctreeHeight,
FParameterDefinitions::OctreeSubHeight,
FParameterDefinitions::NbThreads);
const std::string defaultFile("../Data/test20k.main.fma");
const std::string filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, defaultFile.c_str());
const unsigned int TreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeSubHeight.options, 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, 1);
omp_set_num_threads(NbThreads);
std::cout << "\n>> Using " << omp_get_max_threads() << " threads.\n" << std::endl;
//
std::cout << "Parameters"<< std::endl
<< " Octree Depth " << TreeHeight << std::endl
<< " SubOctree depth " << SubTreeHeight << std::endl
<< " Input file name: " << filename << std::endl
<< " Thread count : " << NbThreads << std::endl
<< std::endl;
///////// VAR INIT /////////////////////////////////////////////////
using FReal = double;
// Begin spherical kernel
// Accuracy
const unsigned int ORDER = 7;
// Typedefs
using ContainerClass = FP2PParticleContainerIndexed<FReal>;
using LeafClass = FSimpleLeaf<FReal, ContainerClass>;
using CellClass = FChebCell<FReal,ORDER>;
using OctreeClass = FOctree<FReal,CellClass,ContainerClass,LeafClass>;
using MatrixKernelClass = FInterpMatrixKernelR<FReal>;
const MatrixKernelClass MatrixKernel;
using KernelClass = FChebSymKernel<FReal, CellClass,ContainerClass,MatrixKernelClass,ORDER>;
using FmmClassProc = FFmmAlgorithmThreadProc<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass>;
// Initialize values for MPI
FMpi app(argc,argv);
//
// Initialize timer
FTic time;
// Creation of the particle loader
FMpiSplitFmaLoader<FReal> loader(filename,app.global().processId());
if(!loader.isOpen())
throw std::runtime_error("Particle file couldn't be opened!") ;
// Initialize empty oct-tree
OctreeClass tree(TreeHeight, SubTreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
{ // -----------------------------------------------------
if(app.global().processId() == 0){
std::cout << "Creating & Inserting "
<< loader.getNumberOfParticles()
<< " particles..."
<< std::endl;
std::cout << "\tHeight : "
<< TreeHeight
<< "\tsub-height : "
<< SubTreeHeight
<< std::endl;
}
time.tic();
FPoint<FReal> position; // Spatial position of the particle.
FReal physicalValue; // Physical value of the particle.
// Read particles from parts.
for(FSize idxPart = 0 ; idxPart < loader.getMyNumberOfParticles() ; ++idxPart){
// Read particle from file
loader.fillParticle(&position,
&physicalValue);
tree.insert(position, idxPart, physicalValue);
}
time.tac();
double timeUsed = time.elapsed();
double minTime,maxTime;
std::cout << "Proc:" << app.global().processId()
<< " " << loader.getMyNumberOfParticles()
<< "particles have been inserted in the tree. (@Reading and Inserting Particles = "
<< time.elapsed() << " s)."
<< std::endl;
MPI_Reduce(&timeUsed,&minTime,1,MPI_DOUBLE,MPI_MIN,0,app.global().getComm());
MPI_Reduce(&timeUsed,&maxTime,1,MPI_DOUBLE,MPI_MAX,0,app.global().getComm());
if(app.global().processId() == 0){
std::cout << "readinsert-time-min:" << minTime
<< " readinsert-time-max:" << maxTime
<< std::endl;
}
} // -----------------------------------------------------
{ // -----------------------------------------------------
std::cout << "\nChebyshev Interpolation FMM Proc (P="<< ORDER << ") ... " << std::endl;
time.tic();
// Kernels to use (pointer because of the limited size of the stack)
KernelClass *kernels = new KernelClass(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel);
// MPI FMM algorithm
FmmClassProc algorithm(app.global(),&tree, kernels);
// FMM exectution
algorithm.execute();
time.tac();
double timeUsed = time.elapsed();
double minTime,maxTime;
std::cout << "Done " << "(@Algorithm = " << time.elapsed() << " s)." << std::endl;
MPI_Reduce(&timeUsed,&minTime,1,MPI_DOUBLE,MPI_MIN,0,app.global().getComm());
MPI_Reduce(&timeUsed,&maxTime,1,MPI_DOUBLE,MPI_MAX,0,app.global().getComm());
if(app.global().processId() == 0){
std::cout << "exec-time-min:" << minTime
<< " exec-time-max:" << maxTime
<< std::endl;
}
// Free kernels from memory
delete kernels;
}
// -----------------------------------------------------
//
// Some output
//
//
{ // -----------------------------------------------------
FSize N1=0, N2= loader.getNumberOfParticles()/2, N3= (loader.getNumberOfParticles()-1); ;
FReal energy =0.0 ;
//
// Loop over all leaves
//
std::cout <<std::endl<<" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "<<std::endl;
std::cout << std::scientific;
std::cout.precision(10) ;
tree.forEachLeaf([&](LeafClass* leaf){
const FReal*const posX = leaf->getTargets()->getPositions()[0];
const FReal*const posY = leaf->getTargets()->getPositions()[1];
const FReal*const posZ = leaf->getTargets()->getPositions()[2];
const FReal*const potentials = leaf->getTargets()->getPotentials();
const FReal*const forcesX = leaf->getTargets()->getForcesX();
const FReal*const forcesY = leaf->getTargets()->getForcesY();
const FReal*const forcesZ = leaf->getTargets()->getForcesZ();
const FSize nbParticlesInLeaf = leaf->getTargets()->getNbParticles();
const FReal*const physicalValues = leaf->getTargets()->getPhysicalValues();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
for(FSize idxPart = 0 ; idxPart < nbParticlesInLeaf ; ++idxPart){
const FSize indexPartOrig = indexes[idxPart];
if ((indexPartOrig == N1)
|| (indexPartOrig == N2)
|| (indexPartOrig == N3) ) {
std::cout << "Proc "<< app.global().processId()
<< " Index "<< indexPartOrig
<<" potential " << potentials[idxPart]
<< " Pos " << posX[idxPart]
<< " " << posY[idxPart]
<< " " << posZ[idxPart]
<< " Forces: " << forcesX[idxPart]
<< " " << forcesY[idxPart]
<< " " << forcesZ[idxPart]
<< std::endl;
}
energy += potentials[idxPart]*physicalValues[idxPart] ;
}
});
FReal gloEnergy = app.global().reduceSum(energy);
std::cout << std::endl
<< "Proc " << app.global().processId()
<< " Energy: " << gloEnergy
<< std::endl;
std::cout << std::endl
<< " &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "
<< std::endl
<< std::endl;
}
// -----------------------------------------------------
return 0;
}
// ==== CMAKE ===== // ==== CMAKE =====
// @FUSE_BLAS // @FUSE_BLAS
// ================
// Keep in private GIT
// @FUSE_MPI // @FUSE_MPI
// @FUSE_STARPU // @FUSE_STARPU
// //
...@@ -26,5 +24,5 @@ using FInterpolationKernel = FChebSymKernel<FReal, ...@@ -26,5 +24,5 @@ using FInterpolationKernel = FChebSymKernel<FReal,
ORDER> ; ORDER> ;
static std::string interpolationKernel("Chebyshev"); static std::string interpolationKernel("Chebyshev");
#include "testFMMInterpolationStarPU.hpp" #include "genericStarPUImplicit.hpp"
...@@ -70,8 +70,8 @@ int main(int argc, char ** argv){ ...@@ -70,8 +70,8 @@ int main(int argc, char ** argv){
counter.tic(); counter.tic();
// //
FmaRWParticle<FReal, 4,8> * particles = new