Commit 3ade215f authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixed const_cast in MPI calls.

parent a36d42a2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ class DistributedGridIO_MPIIOBase
        MPI_File_write(file,&meshFunctionSerializationTypeLength,1,MPI_INT,&wstatus);
        MPI_Get_count(&wstatus,MPI_INT,&count);
        size+=count*sizeof(int);
        MPI_File_write(file,meshFunctionSerializationType.getString(),meshFunctionSerializationType.getLength(),MPI_CHAR,&wstatus);
        MPI_File_write(file,const_cast< void* >( ( const void* ) meshFunctionSerializationType.getString() ),meshFunctionSerializationType.getLength(),MPI_CHAR,&wstatus);
        MPI_Get_count(&wstatus,MPI_CHAR,&count);
        size+=count*sizeof(char);

@@ -310,7 +310,7 @@ class DistributedGridIO_MPIIOBase
        MPI_File_write(file,&dataSerializationTypeLength,1,MPI_INT,&wstatus);
        MPI_Get_count(&wstatus,MPI_INT,&count);
        size+=count*sizeof(int);
        MPI_File_write(file,dataSerializationType.getString(),dataSerializationType.getLength(),MPI_CHAR,&wstatus);
        MPI_File_write( file, const_cast< void* >( ( const void* ) dataSerializationType.getString() ), dataSerializationType.getLength(), MPI_CHAR, &wstatus );
        MPI_Get_count(&wstatus,MPI_CHAR,&count);
        size+=count*sizeof(char);
        //Data count
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ class DistributedGridIO<
		    MPI_File_write(file,&vectorFieldSerializationTypeLength,1,MPI_INT,&wstatus);
		    MPI_Get_count(&wstatus,MPI_INT,&count);
		    size+=count*sizeof(int);
		    MPI_File_write(file,vectorFieldSerializationType.getString(),vectorFieldSerializationType.getLength(),MPI_CHAR,&wstatus);
		    MPI_File_write(file,const_cast< void* >( ( const void* ) vectorFieldSerializationType.getString() ),vectorFieldSerializationType.getLength(),MPI_CHAR,&wstatus);
		    MPI_Get_count(&wstatus,MPI_CHAR,&count);
		    size+=count*sizeof(char);

+1 −1
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ 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 );
   MPI_Send( const_cast< void* >( ( const void* ) str.getString() ), str.length(), MPI_CHAR, target, tag, mpi_comm );
}

inline void mpiReceive( String& str, int source, int tag, MPI_Comm mpi_comm )