Commit f87cb4bc authored by Camille Coti's avatar Camille Coti
Browse files

Pass the number of results to be added by a slave in the AddSlave version

parent 5f5644f2
......@@ -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 */
}
}
}
......
......@@ -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 {
......
......@@ -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_
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