Adding MPI test
This commit is contained in:
@@ -2810,7 +2810,7 @@ MPI_Request MPI_CLASS::IrecvBytes(
|
||||
/************************************************************************
|
||||
* sendrecv *
|
||||
************************************************************************/
|
||||
#if defined( USE_MPI ) || defined( USE_EXT_MPI )
|
||||
#if defined( USE_MPI )
|
||||
template<>
|
||||
void MPI_CLASS::sendrecv<char>( const char* sendbuf, int sendcount, int dest, int sendtag,
|
||||
char* recvbuf, int recvcount, int source, int recvtag ) const
|
||||
@@ -3760,12 +3760,12 @@ void MPI_CLASS::serializeStop()
|
||||
/****************************************************************************
|
||||
* Function to start/stop MPI *
|
||||
****************************************************************************/
|
||||
#ifdef USE_EXT_MPI
|
||||
#ifdef USE_MPI
|
||||
static bool called_MPI_Init = false;
|
||||
#endif
|
||||
bool MPI_CLASS::MPI_Active()
|
||||
{
|
||||
#ifdef USE_EXT_MPI
|
||||
#ifdef USE_MPI
|
||||
int MPI_initialized, MPI_finialized;
|
||||
MPI_Initialized( &MPI_initialized );
|
||||
MPI_Finalized( &MPI_finialized );
|
||||
@@ -3779,7 +3779,7 @@ void MPI_CLASS::start_MPI( int argc, char *argv[], int profile_level )
|
||||
changeProfileLevel( profile_level );
|
||||
NULL_USE( argc );
|
||||
NULL_USE( argv );
|
||||
#ifdef USE_EXT_MPI
|
||||
#ifdef USE_MPI
|
||||
if ( MPI_Active() ) {
|
||||
called_MPI_Init = false;
|
||||
} else {
|
||||
@@ -3795,7 +3795,7 @@ void MPI_CLASS::start_MPI( int argc, char *argv[], int profile_level )
|
||||
}
|
||||
void MPI_CLASS::stop_MPI()
|
||||
{
|
||||
#ifdef USE_EXT_MPI
|
||||
#ifdef USE_MPI
|
||||
int finalized;
|
||||
MPI_Finalized( &finalized );
|
||||
if ( called_MPI_Init && !finalized ) {
|
||||
|
||||
@@ -209,6 +209,24 @@ void quicksort( std::vector<T1> &x, std::vector<T2> &y )
|
||||
}
|
||||
}
|
||||
}
|
||||
template<class T>
|
||||
void unique( std::vector<T> &x )
|
||||
{
|
||||
if ( x.size() <= 1 )
|
||||
return;
|
||||
// First perform a quicksort
|
||||
quicksort( x );
|
||||
// Next remove duplicate entries
|
||||
size_t pos = 1;
|
||||
for ( size_t i = 1; i < x.size(); i++ ) {
|
||||
if ( x[i] != x[pos - 1] ) {
|
||||
x[pos] = x[i];
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if ( pos < x.size() )
|
||||
x.resize( pos );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ ENDIF()
|
||||
|
||||
# Sample test that will run with 1, 2, and 4 processors, failing with 4 or more procs
|
||||
ADD_LBPM_TEST_1_2_4( hello_world )
|
||||
ADD_LBPM_TEST_1_2_4( test_MPI )
|
||||
ADD_LBPM_TEST( TestColorBubble ../example/Bubble/input.db)
|
||||
ADD_LBPM_TEST( TestColorSquareTube ../example/Bubble/input.db)
|
||||
|
||||
|
||||
1537
tests/test_MPI.cpp
Normal file
1537
tests/test_MPI.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user