[Beowulf] Block send mpi
Many of your questions may have already been answered in earlier discussions or in the FAQ. The search results page will indicate current discussions as well as past list serves, articles, and papers.
rene rene at renestorm.deTue Feb 15 02:37:23 PST 2005
- Previous message: [Beowulf] Re: Re: Re: Home beowulf - NIC latencies (Patrick Geoffray)
- Next message: [Beowulf] Re: Re: Home beowulf - NIC latencies
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Mark, please revise this one more time. Maybe I understood it now. int packsize; MPI_Pack_size (bit, MPI_INT, newcomm, &packsize); - Calculates the memory demand (packsize) in bytes needed for count (bit) of MPI_INTs. int bufsize = packsize + (MPI_BSEND_OVERHEAD); - Adds the overhead void *buf = new (void (*[bufsize]) ); - allocates the needed buffer in bytes. MPI_Buffer_attach (buf, bufsize); - attaches the buffer bsend->ierr = MPI_Bsend (&testdata[0], bit, MPI_INT, node, 0, newcomm); - sends the data MPI_Buffer_detach (&buf, &bufsize); - Detaches it Regards, Rene > > int packsize; > > MPI_Pack_size (bit, MPI_INT, newcomm, &packsize); > > I would expect packsize to be counting bytes here. > > > int bufsize = packsize + (MPI_BSEND_OVERHEAD); > > // void *buf = new (void (*[packsize]) ()); > > int *buf = new (int ([packsize])); > > but here you have allocated an array of ints where the number > of elements is packsize. that means you have 4x too many bytes. > > > bsend->ierr = MPI_Bsend (&testdata[0], bit, MPI_INT, node, 0, > > newcomm); > > bear in mind that &testdata[0] is legal but redundant - > it means the same thing as bare 'testdata'. -- Rene Storm @Cluster Linux Cluster Consultant Hamburgerstr. 42e D-22952 Luetjensee mailto:Rene at ReneStorm.de Voice-IP: Skype.com, Rene_Storm
- Previous message: [Beowulf] Re: Re: Re: Home beowulf - NIC latencies (Patrick Geoffray)
- Next message: [Beowulf] Re: Re: Home beowulf - NIC latencies
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Beowulf mailing list
