MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit 339cde25 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

Prepare the task in parallel

parent a9bb0729
......@@ -63,9 +63,9 @@ public:
void execute(const unsigned operationsToProceed = FFmmNearAndFarFields){
FLOG( FLog::Controller << "\tStart FGroupTaskAlgorithm\n" );
//#pragma omp parallel
#pragma omp parallel
{
//#pragma omp single nowait
#pragma omp single nowait
{
// For now rebuild all external interaction
buildExternalInteractionVecs();
......@@ -119,15 +119,15 @@ protected:
{
// We create one big vector per block
typename std::vector< std::vector<OutOfBlockInteraction> > allOutsideInteractions;
allOutsideInteractions.resize(tree->getNbParticleGroup());
externalInteractionsLeafLevel.resize(tree->getNbParticleGroup());
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
// Create the vector
allOutsideInteractions.push_back( std::vector<OutOfBlockInteraction>() );
typename std::vector<OutOfBlockInteraction>* outsideInteractions = &allOutsideInteractions.back();
typename std::vector<OutOfBlockInteraction>* outsideInteractions = &allOutsideInteractions[idxGroup];
ParticleGroupClass* containers = tree->getParticleGroup(idxGroup);
externalInteractionsLeafLevel.emplace_back();
std::vector<BlockInteractions<ParticleGroupClass>>* externalInteractions = &externalInteractionsLeafLevel.back();
std::vector<BlockInteractions<ParticleGroupClass>>* externalInteractions = &externalInteractionsLeafLevel[idxGroup];
#pragma omp task default(none) firstprivate(idxGroup, containers, outsideInteractions, externalInteractions)
{ // Can be a task(inout:iterCells, out:outsideInteractions)
......@@ -195,17 +195,20 @@ protected:
FLOG( leafTimer.tac(); );
FLOG( cellTimer.tic(); );
{
std::vector<std::vector<std::vector<OutOfBlockInteraction> > > allOutsideInteractions;
allOutsideInteractions.resize(tree->getHeight());
for(int idxLevel = tree->getHeight()-1 ; idxLevel >= 2 ; --idxLevel){
std::vector<std::vector<OutOfBlockInteraction> > allOutsideInteractions;
allOutsideInteractions[idxLevel].resize(tree->getNbCellGroupAtLevel(idxLevel));
externalInteractionsAllLevel[idxLevel].resize(tree->getNbCellGroupAtLevel(idxLevel));
for(int idxGroup = 0 ; idxGroup < tree->getNbCellGroupAtLevel(idxLevel) ; ++idxGroup){
allOutsideInteractions.push_back(std::vector<OutOfBlockInteraction>());
std::vector<OutOfBlockInteraction>* outsideInteractions = &allOutsideInteractions.back();
std::vector<OutOfBlockInteraction>* outsideInteractions = &allOutsideInteractions[idxLevel][idxGroup];
const CellContainerClass* currentCells = tree->getCellGroup(idxLevel, idxGroup);
externalInteractionsAllLevel[idxLevel].emplace_back();
std::vector<BlockInteractions<CellContainerClass>>* externalInteractions = &externalInteractionsAllLevel[idxLevel].back();
std::vector<BlockInteractions<CellContainerClass>>* externalInteractions = &externalInteractionsAllLevel[idxLevel][idxGroup];
#pragma omp task default(none) firstprivate(idxGroup, currentCells, outsideInteractions, idxLevel, externalInteractions)
{
......
......@@ -64,9 +64,9 @@ public:
void execute(const unsigned operationsToProceed = FFmmNearAndFarFields){
FLOG( FLog::Controller << "\tStart FGroupTaskDepAlgorithm\n" );
//#pragma omp parallel
#pragma omp parallel
{
//#pragma omp single nowait
#pragma omp single nowait
{
// For now rebuild all external interaction
buildExternalInteractionVecs();
......@@ -111,15 +111,15 @@ protected:
{
// We create one big vector per block
typename std::vector< std::vector<OutOfBlockInteraction> > allOutsideInteractions;
allOutsideInteractions.resize(tree->getNbParticleGroup());
externalInteractionsLeafLevel.resize(tree->getNbParticleGroup());
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
// Create the vector
allOutsideInteractions.push_back( std::vector<OutOfBlockInteraction>() );
typename std::vector<OutOfBlockInteraction>* outsideInteractions = &allOutsideInteractions.back();
typename std::vector<OutOfBlockInteraction>* outsideInteractions = &allOutsideInteractions[idxGroup];
ParticleGroupClass* containers = tree->getParticleGroup(idxGroup);
externalInteractionsLeafLevel.emplace_back();
std::vector<BlockInteractions<ParticleGroupClass>>* externalInteractions = &externalInteractionsLeafLevel.back();
std::vector<BlockInteractions<ParticleGroupClass>>* externalInteractions = &externalInteractionsLeafLevel[idxGroup];
#pragma omp task default(none) firstprivate(idxGroup, containers, outsideInteractions, externalInteractions)
{ // Can be a task(inout:iterCells, out:outsideInteractions)
......@@ -187,17 +187,20 @@ protected:
FLOG( leafTimer.tac(); );
FLOG( cellTimer.tic(); );
{
std::vector<std::vector<std::vector<OutOfBlockInteraction> > > allOutsideInteractions;
allOutsideInteractions.resize(tree->getHeight());
for(int idxLevel = tree->getHeight()-1 ; idxLevel >= 2 ; --idxLevel){
std::vector<std::vector<OutOfBlockInteraction> > allOutsideInteractions;
allOutsideInteractions[idxLevel].resize(tree->getNbCellGroupAtLevel(idxLevel));
externalInteractionsAllLevel[idxLevel].resize(tree->getNbCellGroupAtLevel(idxLevel));
for(int idxGroup = 0 ; idxGroup < tree->getNbCellGroupAtLevel(idxLevel) ; ++idxGroup){
allOutsideInteractions.push_back(std::vector<OutOfBlockInteraction>());
std::vector<OutOfBlockInteraction>* outsideInteractions = &allOutsideInteractions.back();
std::vector<OutOfBlockInteraction>* outsideInteractions = &allOutsideInteractions[idxLevel][idxGroup];
const CellContainerClass* currentCells = tree->getCellGroup(idxLevel, idxGroup);
externalInteractionsAllLevel[idxLevel].emplace_back();
std::vector<BlockInteractions<CellContainerClass>>* externalInteractions = &externalInteractionsAllLevel[idxLevel].back();
std::vector<BlockInteractions<CellContainerClass>>* externalInteractions = &externalInteractionsAllLevel[idxLevel][idxGroup];
#pragma omp task default(none) firstprivate(idxGroup, currentCells, outsideInteractions, idxLevel, externalInteractions)
{
......
......@@ -38,7 +38,13 @@ int main(int argc, char* argv[]){
const FParameterNames LocalOptionNoValidate { {"-no-validation"}, "To avoid comparing with direct computation"};
FHelpDescribeAndExit(argc, argv, "Test the blocked tree by counting the particles.",
FParameterDefinitions::OctreeHeight,FParameterDefinitions::InputFile,
FParameterDefinitions::NbThreads,
FParameterDefinitions::NbParticles, LocalOptionBlocSize, LocalOptionNoValidate);
// Set the number of threads
omp_set_num_threads(FParameters::getValue(argc,argv,FParameterDefinitions::NbThreads.options, omp_get_max_threads()));
// Initialize the types
static const int P = 9;
typedef FRotationCell<P> GroupCellClass;
......
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