I am trying to send and recieve string using MPI but results are hopless.
Send function:
MPI_Send(&result, result.size(), MPI_CHAR, 0, 0, MPI_COMM_WORLD);
And the recv function:
MPI_Recv(&result, /* message buffer */
128, /* one data item */
MPI_CHAR, /* of type char real */
MPI_ANY_SOURCE, /* receive from any sender */
MPI_ANY_TAG, /* any type of message */
MPI_COMM_WORLD, /* default communicator */
&status); /* info about the received message */
Where result is a string.
I didn't get any error but program doesn't want to finish.
result
is known to have a large enough buffer (previously created), he can use&result[0]
to get a non-const pointer to the internal buffer. – Fluoresce