You should try to send strlen( workx )+1 characters in your
slaves-routine, since you skip the terminating zero for the c-style
strings (strlen doesn't include terminating zeros ). And MPI's send/recv
doesn't care for such things.
Good luck
Andre
Josh Stewart wrote:
> Hello all,
>
> I am relatively new at using MPI, but I am running into a problem with
> a small program I wrote to get myself familiar with sending and
> receiving messages. I wanted to send a series of char* strings, so I
> created an integer array for the sizes of each char* . I first send
> the array of integers to the master node, then I send each of the
> char*, one at a time. I can send the information and receive the
> information, but the problem I encounter is when I output the char*
> strings to the screen after receiving them at the master node. The
> char* strings seem to be appending some funky letters to the end of
> the char* that I originally sent. I have included the program, the
> output, and the laminfo as attachments to this e-mail. If anyone else
> has run into this problem, or you know how to fix (get around) this
> problem, please let me know.
>
> Thanks in advance.
> Josh
>
>------------------------------------------------------------------------
>
>_______________________________________________
>This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>
>
|