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:
parent
ca452b8c0b
commit
b4763185cb
9 changed files with 139 additions and 79 deletions
|
|
@ -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 ();
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -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 ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,27 +74,28 @@ ENDFOREACH (test)
|
|||
|
||||
IF(ENABLE_MINIMAL_CMAKE_TESTING)
|
||||
|
||||
SET (MIN_TEST_LIST t-MultiStart)
|
||||
|
||||
SET (MIN_TEST_LIST t-MultiStart)
|
||||
|
||||
FOREACH (testrun ${TEST_RUN})
|
||||
FOREACH (testrun ${TEST_RUN})
|
||||
ADD_EXECUTABLE(${testrun} ${T_${testrun}_SOURCES})
|
||||
ADD_TEST(${testrun} ${testrun})
|
||||
ENDFOREACH (testrun)
|
||||
|
||||
FOREACH (mintest ${MIN_TEST_LIST})
|
||||
FOREACH (mintest ${MIN_TEST_LIST})
|
||||
SET ("T_${mintest}_SOURCES" "${mintest}.cpp")
|
||||
ADD_EXECUTABLE(${mintest} ${T_${mintest}_SOURCES})
|
||||
ADD_TEST(${mintest} "mpiexec" "-n" "4" "${CMAKE_CURRENT_BINARY_DIR}/${mintest}" "@param")
|
||||
TARGET_LINK_LIBRARIES(${mintest} peo ${XML2_LIBS} rmc_mpi ga es eoutils eo peo)
|
||||
ENDFOREACH (mintest)
|
||||
ENDFOREACH (mintest)
|
||||
|
||||
FOREACH (teststop ${TEST_STOP})
|
||||
FOREACH (teststop ${TEST_STOP})
|
||||
ADD_EXECUTABLE(${teststop} ${T_${teststop}_SOURCES})
|
||||
ADD_TEST(${teststop} ${teststop})
|
||||
ENDFOREACH (teststop)
|
||||
ENDFOREACH (teststop)
|
||||
|
||||
ELSEIF(ENABLE_CMAKE_TESTING)
|
||||
|
||||
|
||||
FOREACH (test ${TEST_RUN} ${TEST_LIST} ${TEST_STOP})
|
||||
ADD_EXECUTABLE(${test} ${T_${test}_SOURCES})
|
||||
ENDFOREACH (test)
|
||||
|
|
@ -110,10 +111,10 @@ ELSEIF(ENABLE_CMAKE_TESTING)
|
|||
FOREACH (teststop ${TEST_STOP})
|
||||
ADD_TEST(${teststop} ${teststop})
|
||||
ENDFOREACH (teststop)
|
||||
|
||||
|
||||
FOREACH (test ${TEST_LIST})
|
||||
TARGET_LINK_LIBRARIES(${test} peo ${XML2_LIBS} rmc_mpi ga es eoutils eo peo)
|
||||
ENDFOREACH (test)
|
||||
ENDFOREACH (test)
|
||||
|
||||
ENDIF(ENABLE_MINIMAL_CMAKE_TESTING)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
<node name="1" num_workers="0">
|
||||
<runner>1</runner>
|
||||
<runner>2</runner>
|
||||
</node>
|
||||
|
||||
<node name="2" num_workers="1">
|
||||
|
|
|
|||
|
|
@ -35,8 +35,9 @@
|
|||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main (int __argc, char *__argv[])
|
||||
{
|
||||
system("mpdallexit");
|
||||
int success = system("mpdallexit");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,9 @@
|
|||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main (int __argc, char *__argv[])
|
||||
{
|
||||
system("mpdboot");
|
||||
int success = system("mpdboot");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue