Commit c510629f authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Tomáš Oberhuber
Browse files

Renaming String send and receive to mpiSend and mpiReceive.

parent b9b0973c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -46,12 +46,12 @@ int main( int argc, char* argv[] )
   if( string1 )
      cout << "string1 is not empty" << endl;

   File myFile;
   /*File myFile;
   myFile.open( "string_save.out", File::out );
   myFile << string1;
   myFile.close();

   myFile.open( "string_save.out", File::in );
   myFile >> string3;
   cout << "string 3 after loading = " << strg << endl;
   cout << "string 3 after loading = " << string3 << endl;*/
}
+4 −4
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ else
      __tnl_mpi_print_stream_ << "Node " << TNL::Communicators::MpiCommunicator::GetRank() << " of "                             \
         << TNL::Communicators::MpiCommunicator::GetSize() << " : " << message << std::endl;                                     \
      TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str().c_str() );                                              \
      send( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() );                                                                                         \
      mpiSend( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() );                                                                                         \
   }                                                                                                                             \
   else                                                                                                                          \
   {                                                                                                                             \
@@ -35,7 +35,7 @@ else
           __tnl_mpi_print_j++ )                                                                                                 \
         {                                                                                                                       \
            TNL::String __tnl_mpi_print_string_;                                                                                 \
            receive( __tnl_mpi_print_string_, __tnl_mpi_print_j, std::numeric_limits< int >::max() );                                                                \
            mpiReceive( __tnl_mpi_print_string_, __tnl_mpi_print_j, std::numeric_limits< int >::max() );                                                                \
            std::cerr << __tnl_mpi_print_string_;                                                                                \
         }                                                                                                                       \
   }                                                                                                                             \
@@ -78,7 +78,7 @@ else
         __tnl_mpi_print_stream_ << "Node " << TNL::Communicators::MpiCommunicator::GetRank() << " of "                          \
            << TNL::Communicators::MpiCommunicator::GetSize() << " : " << message << std::endl;                                  \
         TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str().c_str() );                                           \
         send( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() );                                                                                      \
         mpiSsend( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() );                                                                                      \
      }                                                                                                                          \
   }                                                                                                                             \
   else                                                                                                                          \
@@ -94,7 +94,7 @@ else
            if( __tnl_mpi_print_cond )                                                                                           \
            {                                                                                                                    \
               TNL::String __tnl_mpi_print_string_;                                                                              \
               receive( __tnl_mpi_print_string_, __tnl_mpi_print_j, std::numeric_limits< int >::max() );                                                             \
               mpiReceive( __tnl_mpi_print_string_, __tnl_mpi_print_j, std::numeric_limits< int >::max() );                                                             \
               std::cerr << __tnl_mpi_print_string_;                                                                             \
            }                                                                                                                    \
         }                                                                                                                       \
+2 −2
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ template<> inline String convertToString( const bool& b )
 * @param tag MPI tag
 * @param mpi_comm MPI communication group
 */
void send( const String& str, int target, int tag = 0, MPI_Comm mpi_comm = MPI_COMM_WORLD );
void mpiSend( const String& str, int target, int tag = 0, MPI_Comm mpi_comm = MPI_COMM_WORLD );

/**
 * \brief Receives a string from the source MPI process.
@@ -407,7 +407,7 @@ void send( const String& str, int target, int tag = 0, MPI_Comm mpi_comm = MPI_C
 * @param tag MPI tag
 * @param mpi_comm MPI communication group
 */
void receive( String& str, int source, int tag = 0, MPI_Comm mpi_comm = MPI_COMM_WORLD );
void mpiReceive( String& str, int source, int tag = 0, MPI_Comm mpi_comm = MPI_COMM_WORLD );

//! Broadcast to other nodes in MPI cluster
// void MPIBcast( String& str, int root, MPI_Comm mpi_comm = MPI_COMM_WORLD );
+2 −2
Original line number Diff line number Diff line
@@ -250,14 +250,14 @@ inline std::ostream& operator<<( std::ostream& stream, const String& str )
}

#ifdef HAVE_MPI
inline void send( const String& str, int target, int tag, MPI_Comm mpi_comm )
inline void mpiSend( const String& str, int target, int tag, MPI_Comm mpi_comm )
{
   int size = str.getSize();
   MPI_Send( &size, 1, MPI_INT, target, tag, mpi_comm );
   MPI_Send( str.getString(), str.length(), MPI_CHAR, target, tag, mpi_comm );
}

inline void receive( String& str, int source, int tag, MPI_Comm mpi_comm )
inline void mpiReceive( String& str, int source, int tag, MPI_Comm mpi_comm )
{
   int size;
   MPI_Status status;