From f87cb4bc365d8238b74c29ddc58b5d1e37b4af28 Mon Sep 17 00:00:00 2001 From: Camille Coti <camille.coti@lipn.univ-paris13.fr> Date: Thu, 1 Aug 2019 15:24:20 -0700 Subject: [PATCH] Pass the number of results to be added by a slave in the AddSlave version --- src/tensormatrix_mpi.cpp | 4 +++- src/utils_parall.cpp | 4 ++-- src/utils_parall.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tensormatrix_mpi.cpp b/src/tensormatrix_mpi.cpp index 96289fc..9ede677 100644 --- a/src/tensormatrix_mpi.cpp +++ b/src/tensormatrix_mpi.cpp @@ -40,6 +40,7 @@ MPI_Datatype DT_PARAMETERS; MPI_Datatype DT_PARAMETERS_2; int nbforemen = NBFOREMEN; /* Number of foremen to use with the hierarchical M/W */ +int maxresult = MAXRESULT; /* Maximum results in the result queue, addslave version */ /******************************************************************************* * Main function * @@ -98,7 +99,8 @@ int main( int argc, char** argv ){ break; } if( argc >= 4 ) { - nbforemen = atoi( argv[3]); + nbforemen = atoi( argv[3] ); /* these two variables are obtained from the same CI parameter but since they are */ + maxresult = atoi( argv[3] ); /* used in two functions for two purposes, use two different names */ } } } diff --git a/src/utils_parall.cpp b/src/utils_parall.cpp index 503ac70..07b9638 100644 --- a/src/utils_parall.cpp +++ b/src/utils_parall.cpp @@ -155,7 +155,7 @@ void send_add_or_end_addslave( std::vector<std::string>& results, int peer, int /* Do I have a lot of results to be treated in the result queue? */ - if( results.size() > MAXRESULT ) { + if( results.size() > maxresult ) { /* if the result queue is too big, send it */ send_expressions_to_add( results, peer ); } else { @@ -168,7 +168,7 @@ void send_add_or_end_addslave( std::vector<std::string>& results, int peer, int void send_work_addslave( std::vector<parameters_t>& input, std::vector<std::string>& results, int peer ) { - if( results.size() > MAXRESULT ) { + if( results.size() > maxresult ) { /* if the result queue is too big, send it */ send_expressions_to_add( results, peer ); } else { diff --git a/src/utils_parall.h b/src/utils_parall.h index 24350ef..2d5cd4b 100644 --- a/src/utils_parall.h +++ b/src/utils_parall.h @@ -56,5 +56,6 @@ extern MPI_Datatype DT_PARAMETERS; extern MPI_Datatype DT_PARAMETERS_2; extern int nbforemen; /* Number of foremen to use with the hierarchical M/W */ +extern int maxresult; /* Maximum results in the result queue, addslave version */ #endif // _UTILS_PARALL_H_ -- GitLab