Assure compatibility with gcc 4.3

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1375 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
fatene 2009-01-29 16:33:58 +00:00
commit b4763185cb
9 changed files with 139 additions and 79 deletions

View file

@ -35,6 +35,7 @@
*/
#include <vector>
#include <iostream>
#include "runner.h"
#include "reac_thread.h"
@ -106,17 +107,37 @@ void initializeContext ()
{
num_local_exec_runners = 0;
/*
std :: cout << " Hi, I'm thread number \t" << getNodeRank () << std::endl;
int err_code = MPI_Barrier(MPI_COMM_WORLD);
if ( err_code != MPI_SUCCESS )
{
std :: cout << " Synchronisation error code \t" << err_code << std::endl;
}
*/
synchronizeNodes ();
// setting up the execution IDs & counting the number of local exec. runners
for (unsigned i = 0; i < the_runners.size (); i ++)
{
the_runners [i] -> setExecutionID ( my_node -> execution_id_run[ i ] );
if (the_runners [i] -> isAssignedLocally ()) num_local_exec_runners ++;
}
/*
std :: cout << " num_local_exec_runners \t" << num_local_exec_runners << std::endl;
std :: cout << " num_exec_runners \t" << num_exec_runners << std::endl;
*/
synchronizeNodes ();
collectiveCountOfRunners( &num_local_exec_runners, &num_exec_runners );
// synchronizeNodes ();
/*
err_code = iCollectiveCountOfRunners( &num_local_exec_runners, &num_exec_runners );
std :: cout << " Error code \t" << err_code << "\t MPI_SUCCESS\t " << MPI_SUCCESS << std::endl;
if ( err_code != MPI_SUCCESS )
{
std :: cout << " Something strange in the neighbourhood \t" << err_code << std::endl;
}
*/
for (unsigned i = 0; i < the_runners.size (); i ++)
if (the_runners [i] -> isAssignedLocally ()) the_runners [i] -> notifyContextInitialized ();

View file

@ -122,6 +122,13 @@ void collectiveCountOfRunners ( unsigned int* num_local_exec_runners, unsigned i
MPI_Allreduce( num_local_exec_runners, num_exec_runners, 1, MPI_UNSIGNED, MPI_SUM, MPI_COMM_WORLD );
}
// Return the code of execution of MPI_Allreduce
int iCollectiveCountOfRunners ( unsigned int* num_local_exec_runners, unsigned int* num_exec_runners )
{
return MPI_Allreduce( num_local_exec_runners, num_exec_runners, 1, MPI_UNSIGNED, MPI_SUM, MPI_COMM_WORLD );
}
int getRankFromName (const std :: string & __name)
{

View file

@ -67,6 +67,8 @@ extern int getNumberOfNodes (); /* It gives the size of the environment (Total n
extern void collectiveCountOfRunners ( unsigned int* num_local_exec_runners, unsigned int* num_exec_runners );
extern int iCollectiveCountOfRunners ( unsigned int* num_local_exec_runners, unsigned int* num_exec_runners );
extern int getRankFromName (const std :: string & __name); /* It gives the rank of the process
expressed by its name */

View file

@ -34,10 +34,12 @@
*
*/
#include <iostream>
#include <set>
#include <cassert>
#include "schema.h"
#include "mess.h"
#include "xml_parser.h"
#include "comm.h"
#include "node.h"
@ -130,7 +132,8 @@ bool isScheduleNode ()
void loadSchema (const char * __filename)
{
// std :: cout << " I'm node number \t" << getNodeRank () << std :: endl;
openXMLDocument (__filename);
std :: string name;
@ -204,4 +207,5 @@ void loadSchema (const char * __filename)
}
closeXMLDocument ();
//synchronizeNodes ();
}