Re: [OMPI users] MPI and C++ (Boost)
Luis Vitorio Cargnini wrote: Ok, after all the considerations, I'll try Boost, today, make some experiments and see if I can use it or if I'll avoid it yet. But as said by Raimond I think, the problem is been dependent of a rich-incredible-amazing-toolset but still implementing only MPI-1, and do not implement all the MPI functions main drawbacks of boost, but the set of functions implemented do not compromise the functionality, i don't know about the MPI-1, MPI-2 and future MPI-3 specifications, how this specifications implementations affect boost and the developer using Boost, with OpenMPI of course. Continuing if something change in the boost how can I guarantee it won't affect my code in the future ? It is impossible. Anyway I'll test it today and without it and choose my direction, thanks for all the replies, suggestions, solutions, that you all pointed to me I really appreciate all your help and comments about boost or not my code. Thanks and Regards. Vitorio. Vitorio, If there is some MPI capability that is not currently provided in Boost.MPI, then just call it the normal MPI way. Using Boost.MPI doesn't interfere with any use of the C bindings, even in the same function. As for future changes, if something happens to a boost library that you don't like, just keep using the older version. Past releases of boost remain available after new releases arrive. John
Re: [OMPI users] MPI and C++ (Boost)
Ok, after all the considerations, I'll try Boost, today, make some experiments and see if I can use it or if I'll avoid it yet. But as said by Raimond I think, the problem is been dependent of a rich-incredible-amazing-toolset but still implementing only MPI-1, and do not implement all the MPI functions main drawbacks of boost, but the set of functions implemented do not compromise the functionality, i don't know about the MPI-1, MPI-2 and future MPI-3 specifications, how this specifications implementations affect boost and the developer using Boost, with OpenMPI of course. Continuing if something change in the boost how can I guarantee it won't affect my code in the future ? It is impossible. Anyway I'll test it today and without it and choose my direction, thanks for all the replies, suggestions, solutions, that you all pointed to me I really appreciate all your help and comments about boost or not my code. Thanks and Regards. Vitorio. Le 09-07-07 à 08:26, Jeff Squyres a écrit : I think you face a common trade-off: - use a well-established, debugged, abstraction-rich library - write all of that stuff yourself FWIW, I think the first one is a no-brainer. There's a reason they wrote Boost.MPI: it's complex, difficult stuff, and is perfect as middleware for others to use. If having users perform a 2nd step is undesirable (i.e., install Boost before installing your software), how about embedding Boost in your software? Your configure/build process can certainly be tailored to include Boost[.MPI]. Hence, users will only perform 1 step, but it actually performs "2" steps under the covers (configures +installs Boost.MPI and then configures+installs your software, which uses Boost). FWIW: Open MPI does exactly this. Open MPI embeds at least 5 software packages: PLPA, VampirTrace, ROMIO, libltdl, and libevent. But 99.9% of our users don't know/care because it's all hidden in our configure / make process. If you watch carefully, you can see the output go by from each of those configure sections when running OMPI's configure. But no one does. ;-) Sidenote: I would echo that the Forum is not considering including Boost.MPI at all. Indeed, as mentioned in different threads, the Forum has already voted once to deprecate the MPI C++ bindings, partly *because* of Boost. Boost.MPI has shown that the C++ community is better at making C++ APIs for MPI than the Forum is. Hence, our role should be to make the base building blocks and let the language experts make their own preferred tools. On Jul 7, 2009, at 5:03 AM, Matthieu Brucher wrote: > IF boost is attached to MPI 3 (or whatever), AND it becomes part of the > mainstream MPI implementations, THEN you can have the discussion again. Hi, At the moment, I think that Boost.MPI only supports MPI1.1, and even then, some additional work may be done, at least regarding the complex datatypes. Matthieu -- Information System Engineer, Ph.D. Website: http://matthieu-brucher.developpez.com/ Blogs: http://matt.eifelle.com and http://blog.developpez.com/? blog=92 LinkedIn: http://www.linkedin.com/in/matthieubrucher ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users -- Jeff Squyres Cisco Systems ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users smime.p7s Description: S/MIME cryptographic signature PGP.sig Description: Ceci est une signature électronique PGP
Re: [OMPI users] MPI and C++ (Boost)
I think you face a common trade-off: - use a well-established, debugged, abstraction-rich library - write all of that stuff yourself FWIW, I think the first one is a no-brainer. There's a reason they wrote Boost.MPI: it's complex, difficult stuff, and is perfect as middleware for others to use. If having users perform a 2nd step is undesirable (i.e., install Boost before installing your software), how about embedding Boost in your software? Your configure/build process can certainly be tailored to include Boost[.MPI]. Hence, users will only perform 1 step, but it actually performs "2" steps under the covers (configures+installs Boost.MPI and then configures+installs your software, which uses Boost). FWIW: Open MPI does exactly this. Open MPI embeds at least 5 software packages: PLPA, VampirTrace, ROMIO, libltdl, and libevent. But 99.9% of our users don't know/care because it's all hidden in our configure / make process. If you watch carefully, you can see the output go by from each of those configure sections when running OMPI's configure. But no one does. ;-) Sidenote: I would echo that the Forum is not considering including Boost.MPI at all. Indeed, as mentioned in different threads, the Forum has already voted once to deprecate the MPI C++ bindings, partly *because* of Boost. Boost.MPI has shown that the C++ community is better at making C++ APIs for MPI than the Forum is. Hence, our role should be to make the base building blocks and let the language experts make their own preferred tools. On Jul 7, 2009, at 5:03 AM, Matthieu Brucher wrote: > IF boost is attached to MPI 3 (or whatever), AND it becomes part of the > mainstream MPI implementations, THEN you can have the discussion again. Hi, At the moment, I think that Boost.MPI only supports MPI1.1, and even then, some additional work may be done, at least regarding the complex datatypes. Matthieu -- Information System Engineer, Ph.D. Website: http://matthieu-brucher.developpez.com/ Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn: http://www.linkedin.com/in/matthieubrucher ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users -- Jeff Squyres Cisco Systems
Re: [OMPI users] MPI and C++ - now Send and Receive of Classes and STL containers
Hi, On Mon, Jul 06, 2009 at 03:24:07PM -0400, Luis Vitorio Cargnini wrote: > Thanks, but I really do not want to use Boost. > Is easier ? certainly is, but I want to make it using only MPI > itself > and not been dependent of a Library, or templates like the majority > of > boost a huge set of templates and wrappers for different libraries, > implemented in C, supplying a wrapper for C++. > I admit Boost is a valuable tool, but in my case, as much > independent I > could be from additional libs, better. > If you do not want to use boost, then I suggest not using nested vectors but just ones that contain PODs as value_type (or even C-arrays). If you insist on using complicated containers you will end up writing your own MPI-C++ abstraction (resulting in a library). This will be a lot of (unnecessary and hard) work. Just my 2 cents. Cheers, Markus
Re: [OMPI users] MPI and C++ (Boost)
> IF boost is attached to MPI 3 (or whatever), AND it becomes part of the > mainstream MPI implementations, THEN you can have the discussion again. Hi, At the moment, I think that Boost.MPI only supports MPI1.1, and even then, some additional work may be done, at least regarding the complex datatypes. Matthieu -- Information System Engineer, Ph.D. Website: http://matthieu-brucher.developpez.com/ Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn: http://www.linkedin.com/in/matthieubrucher
Re: [OMPI users] MPI and C++ (Boost)
Hi Luis, Luis Vitorio Cargnini wrote: Your suggestion is a great and interesting idea. I only have the fear to get used to the Boost and could not get rid of Boost anymore, because one thing is sure the abstraction added by Boost is impressive, it turn I should add that I fully understand what it is you are saying and despite all the good things there were being said about Boost, I was avoiding it for a very long time because of the dependency issue. For two reasons -- the dependency issue for myself (exactly like what you said) and distributing it means users will have to do an extra step (regardless of how easy/hard the step is, it's an extra step). I finally switched over :-) and the "prototype" idea was just a way to ease you into it. MPI programs are hard to get right, and Boost aside, it is a good idea to have something working that is easy to do and then you can remove the parts that you don't like later. By the way, it seems that less-used parts of MPI do not have equivalents in Boost.MPI, so just using Boost won't solve all of your problems. There is a list here (the table with the entries that say "unsupported"): http://www.boost.org/doc/libs/1_39_0/doc/html/mpi/tutorial.html#mpi.c_mapping Good luck! Ray
Re: [OMPI users] MPI and C++ (Boost)
Terry Frankcombe wrote: I understand Luis' position completely. He wants an MPI program, not a program that's written in some other environment, no matter how attractive that may be. It's like the difference between writing a numerical program in standard-conforming Fortran and writing it in the latest flavour of the month interpreted language calling highly optimised libraries behind the scenes. IF boost is attached to MPI 3 (or whatever), AND it becomes part of the mainstream MPI implementations, THEN you can have the discussion again. Ciao Terry I guess we view it differently. Boost.MPI isn't a language at all. It is a library written in fully ISO compliant C++, that exists to make doing an otherwise complex and error prone job simpler and more readable. As such, I would compare it to using a well tested BLAS library to do matrix manipulations in your Fortran code or writing it yourself. Both can be standard conforming Fortran (though many BLAS implementations include lower level optimized code), and neither is a flavor of the month interpreted language. The advantage of the library is that it allows you to work at a level of abstraction that may be better suited to your work. For you, as for everyone else, make your choices based on what you believe best serves the needs of your program, whether that includes Boost.MPI or not. However, making the choices with an understanding of the options strengths and weaknesses gives the best chance of writing a good program. John PS - I am not part of the MPI Forum, but I would be surprised if they chose to add boost to any MPI version. Possibly an analog of Boost.MPI, but not all of boost. There are over 100 different libraries, covering many different areas of use in boost, and most of them have no direct connection to MPI. PPS - If anyone would like to know more about Boost, I would suggest the website (http://www.boost.org) or the user mailing list. Folks who don't write in C++ will probably not be very interested.
Re: [OMPI users] MPI and C++ (Boost)
On Mon, 2009-07-06 at 23:09 -0400, John Phillips wrote: > Luis Vitorio Cargnini wrote: > > > > Your suggestion is a great and interesting idea. I only have the fear to > > get used to the Boost and could not get rid of Boost anymore, because > > one thing is sure the abstraction added by Boost is impressive, it turn > > the things much less painful like MPI to be implemented using C++, also > > the serialization inside Boost::MPI already made by Boost to use MPI is > > astonishing attractive, and of course the possibility to add new types > > like classes to be able to send objects through MPI_Send of Boost, this > > is certainly attractive, but again I do not want to get dependent of a > > library as I said, this is my major concern. > > . > >I'm having problems understanding your base argument here. It seems > to be that you are afraid that Boost.MPI will make your prototype > program so much better and easier to write that you won't want to remove > it. Wouldn't this be exactly the reason why keeping it would be good? > >I like and use Boost.MPI. I voted for inclusion during the review in > the Boost developer community. However, what you should do in your > program is use those tools that produce the right trade off between the > best performance, easiest to develop correctly, and most maintainable > program you can. If that means using Boost.MPI, then remember that > questions about it are answered at the Boost Users mailing list. If your > decision is that that does not include Boost.MPI then you will have some > other challenges to face but experience shows that you can still produce > a very high quality program. > >Choose as you see fit, just be sure to understand your own reasons. > (Whether any of the rest of us on this list understand them or not.) I understand Luis' position completely. He wants an MPI program, not a program that's written in some other environment, no matter how attractive that may be. It's like the difference between writing a numerical program in standard-conforming Fortran and writing it in the latest flavour of the month interpreted language calling highly optimised libraries behind the scenes. IF boost is attached to MPI 3 (or whatever), AND it becomes part of the mainstream MPI implementations, THEN you can have the discussion again. Ciao Terry -- Dr. Terry Frankcombe Research School of Chemistry, Australian National University Ph: (+61) 0417 163 509Skype: terry.frankcombe
Re: [OMPI users] MPI and C++ (Boost)
Luis Vitorio Cargnini wrote: Your suggestion is a great and interesting idea. I only have the fear to get used to the Boost and could not get rid of Boost anymore, because one thing is sure the abstraction added by Boost is impressive, it turn the things much less painful like MPI to be implemented using C++, also the serialization inside Boost::MPI already made by Boost to use MPI is astonishing attractive, and of course the possibility to add new types like classes to be able to send objects through MPI_Send of Boost, this is certainly attractive, but again I do not want to get dependent of a library as I said, this is my major concern. . I'm having problems understanding your base argument here. It seems to be that you are afraid that Boost.MPI will make your prototype program so much better and easier to write that you won't want to remove it. Wouldn't this be exactly the reason why keeping it would be good? I like and use Boost.MPI. I voted for inclusion during the review in the Boost developer community. However, what you should do in your program is use those tools that produce the right trade off between the best performance, easiest to develop correctly, and most maintainable program you can. If that means using Boost.MPI, then remember that questions about it are answered at the Boost Users mailing list. If your decision is that that does not include Boost.MPI then you will have some other challenges to face but experience shows that you can still produce a very high quality program. Choose as you see fit, just be sure to understand your own reasons. (Whether any of the rest of us on this list understand them or not.) John
Re: [OMPI users] MPI and C++ - now Send and Receive of Classes and STL containers
Luis Vitorio Cargnini wrote: just one additional and if I have: vector< vector > x; How to use the MPI_Send MPI_Send([0][0], x[0].size(),MPI_DOUBLE, 2, 0, MPI_COMM_WORLD); ? Vitorio, The standard provides no information on where the different parts of the data will be, relative to each other. In specific, there is no reason to believe that the data in the different internally nested doubles will be contiguous. (In fact, I know of no platform where it will be.) That means trying to send the whole structure at once is problematic. What you wrote will provide a pointer to the first element of the first nested vector to MPI_Send, and the length of that nested vector. If that is what you intend, I expect it to work. (I have not tested it, so I may be misthinking something here.) The other nested vectors could be sent for themselves, using separate MPI_Send calls. The only reliable way to send all of the data at once would be to serialize it off to a single vector or array for the send, then repack it in the structure after it is received. John
Re: [OMPI users] MPI and C++ (Boost)
Hi Raymond, thanks for your answer Le 09-07-06 à 21:16, Raymond Wan a écrit : I've used Boost MPI before and it really isn't that bad and shouldn't be seen as "just another library". Many parts of Boost are on their way to being part of the standard and are discussed and debated on. And so, it isn't the same as going to some random person's web page and downloading their library/template. Of course, it takes time to make it into the standard and I'm not entirely sure if everything will (probably not). (One "annoying" thing about Boost MPI is that you have to compile it...if you are distributing your code, end-users might find that bothersome...oh, and serialization as well.) we have a common factor, I'm not exactly distributing, but I'll add a dependency into my code, something that bothers me. One suggestion might be to make use of Boost and once you got your code working, start changing it back. At least you will have a working program to compare against. Kind of like writing a prototype first... Your suggestion is a great and interesting idea. I only have the fear to get used to the Boost and could not get rid of Boost anymore, because one thing is sure the abstraction added by Boost is impressive, it turn the things much less painful like MPI to be implemented using C++, also the serialization inside Boost::MPI already made by Boost to use MPI is astonishing attractive, and of course the possibility to add new types like classes to be able to send objects through MPI_Send of Boost, this is certainly attractive, but again I do not want to get dependent of a library as I said, this is my major concern. . Ray smime.p7s Description: S/MIME cryptographic signature PGP.sig Description: Ceci est une signature électronique PGP
Re: [OMPI users] MPI and C++ (Boost)
Hi Luis, Luis Vitorio Cargnini wrote: Thanks, but I really do not want to use Boost. Is easier ? certainly is, but I want to make it using only MPI itself and not been dependent of a Library, or templates like the majority of boost a huge set of templates and wrappers for different libraries, implemented in C, supplying a wrapper for C++. I admit Boost is a valuable tool, but in my case, as much independent I could be from additional libs, better. I've used Boost MPI before and it really isn't that bad and shouldn't be seen as "just another library". Many parts of Boost are on their way to being part of the standard and are discussed and debated on. And so, it isn't the same as going to some random person's web page and downloading their library/template. Of course, it takes time to make it into the standard and I'm not entirely sure if everything will (probably not). (One "annoying" thing about Boost MPI is that you have to compile it...if you are distributing your code, end-users might find that bothersome...oh, and serialization as well.) One suggestion might be to make use of Boost and once you got your code working, start changing it back. At least you will have a working program to compare against. Kind of like writing a prototype first... Ray
Re: [OMPI users] MPI and C++ - now Send and Receive of Classes and STL containers
Thanks, but I really do not want to use Boost. Is easier ? certainly is, but I want to make it using only MPI itself and not been dependent of a Library, or templates like the majority of boost a huge set of templates and wrappers for different libraries, implemented in C, supplying a wrapper for C++. I admit Boost is a valuable tool, but in my case, as much independent I could be from additional libs, better. Le 09-07-06 à 04:49, Number Cruncher a écrit : I strongly suggest you take a look at boost::mpi, http://www.boost.org/doc/libs/1_39_0/doc/html/mpi.html It handles serialization transparently and has some great natural extensions to the MPI C interface for C++, e.g. bool global = all_reduce(comm, local, logical_and()); This sets "global" to "local_0 && local_1 && ... && local_N-1" Luis Vitorio Cargnini wrote: Thank you very much John, the explanation of [0], was the kind of think that I was looking for, thank you very much. This kind of approach solves my problems. Le 09-07-05 à 22:20, John Phillips a écrit : Luis Vitorio Cargnini wrote: Hi, So, after some explanation I start to use the bindings of C inside my C++ code, then comme my new doubt: How to send a object through Send and Recv of MPI ? Because the types are CHAR, int, double, long double, you got. Someone have any suggestion ? Thanks. Vitorio. Vitorio, If you are sending collections of built in data types (ints, doubles, that sort of thing), then it may be easy, and it isn't awful. You want the data in a single stretch of continuous memory. If you are using an STL vector, this is already true. If you are using some other container, then no guarantees are provided for whether the memory is continuous. Imagine you are using a vector, and you know the number of entries in that vector. You want to send that vector to processor 2 on the world communicator with tag 0. Then, the code snippet would be; std::vector v; ... code that fills v with something ... int send_error; send_error = MPI_Send([0], v.size(), MPI_DOUBLE, 2, 0, MPI_COMM_WORLD); The [0] part provides a pointer to the first member of the array that holds the data for the vector. If you know how long it will be, you could use that constant instead of using the v.size() function. Knowing the length also simplifies the send, since the remote process also knows the length and doesn't need a separate send to provide that information. It is also possible to provide a pointer to the start of storage for the character array that makes up a string. Both of these legacy friendly interfaces are part of the standard, and should be available on any reasonable implementation of the STL. If you are using a container that is not held in continuous memory, and the data is all of a single built in data type, then you need to first serialize the data into a block of continuous memory before sending it. (If the data block is large, then you may actually have to divide it into pieces and send them separately.) If the data is not a block of all a single built in type, (It may include several built in types, or it may be a custom data class with complex internal structure, for example.) then the serialization problem gets harder. In this case, look at the MPI provided facilities for dealing with complex data types and compare to the boost provided facilities. There is an initial learning curve for the boost facilities, but in the long run it may provide a substantial development time savings if you need to transmit and receive several complex types. In most cases, the run time cost is small for using the boost facilities. (according to the tests run during library development and documented with the library) John Phillips ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users smime.p7s Description: S/MIME cryptographic signature PGP.sig Description: Ceci est une signature électronique PGP
Re: [OMPI users] MPI and C++ - now Send and Receive of Classes and STL containers
just one additional and if I have: vector< vector > x; How to use the MPI_Send MPI_Send([0][0], x[0].size(),MPI_DOUBLE, 2, 0, MPI_COMM_WORLD); ? Le 09-07-05 à 22:20, John Phillips a écrit : Luis Vitorio Cargnini wrote: Hi, So, after some explanation I start to use the bindings of C inside my C++ code, then comme my new doubt: How to send a object through Send and Recv of MPI ? Because the types are CHAR, int, double, long double, you got. Someone have any suggestion ? Thanks. Vitorio. Vitorio, If you are sending collections of built in data types (ints, doubles, that sort of thing), then it may be easy, and it isn't awful. You want the data in a single stretch of continuous memory. If you are using an STL vector, this is already true. If you are using some other container, then no guarantees are provided for whether the memory is continuous. Imagine you are using a vector, and you know the number of entries in that vector. You want to send that vector to processor 2 on the world communicator with tag 0. Then, the code snippet would be; std::vector v; ... code that fills v with something ... int send_error; send_error = MPI_Send([0], v.size(), MPI_DOUBLE, 2, 0, MPI_COMM_WORLD); The [0] part provides a pointer to the first member of the array that holds the data for the vector. If you know how long it will be, you could use that constant instead of using the v.size() function. Knowing the length also simplifies the send, since the remote process also knows the length and doesn't need a separate send to provide that information. It is also possible to provide a pointer to the start of storage for the character array that makes up a string. Both of these legacy friendly interfaces are part of the standard, and should be available on any reasonable implementation of the STL. If you are using a container that is not held in continuous memory, and the data is all of a single built in data type, then you need to first serialize the data into a block of continuous memory before sending it. (If the data block is large, then you may actually have to divide it into pieces and send them separately.) If the data is not a block of all a single built in type, (It may include several built in types, or it may be a custom data class with complex internal structure, for example.) then the serialization problem gets harder. In this case, look at the MPI provided facilities for dealing with complex data types and compare to the boost provided facilities. There is an initial learning curve for the boost facilities, but in the long run it may provide a substantial development time savings if you need to transmit and receive several complex types. In most cases, the run time cost is small for using the boost facilities. (according to the tests run during library development and documented with the library) John Phillips ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users smime.p7s Description: S/MIME cryptographic signature PGP.sig Description: Ceci est une signature électronique PGP
Re: [OMPI users] MPI and C++ - now Send and Receive of Classes and STL containers
I strongly suggest you take a look at boost::mpi, http://www.boost.org/doc/libs/1_39_0/doc/html/mpi.html It handles serialization transparently and has some great natural extensions to the MPI C interface for C++, e.g. bool global = all_reduce(comm, local, logical_and()); This sets "global" to "local_0 && local_1 && ... && local_N-1" Luis Vitorio Cargnini wrote: Thank you very much John, the explanation of [0], was the kind of think that I was looking for, thank you very much. This kind of approach solves my problems. Le 09-07-05 à 22:20, John Phillips a écrit : Luis Vitorio Cargnini wrote: Hi, So, after some explanation I start to use the bindings of C inside my C++ code, then comme my new doubt: How to send a object through Send and Recv of MPI ? Because the types are CHAR, int, double, long double, you got. Someone have any suggestion ? Thanks. Vitorio. Vitorio, If you are sending collections of built in data types (ints, doubles, that sort of thing), then it may be easy, and it isn't awful. You want the data in a single stretch of continuous memory. If you are using an STL vector, this is already true. If you are using some other container, then no guarantees are provided for whether the memory is continuous. Imagine you are using a vector, and you know the number of entries in that vector. You want to send that vector to processor 2 on the world communicator with tag 0. Then, the code snippet would be; std::vector v; ... code that fills v with something ... int send_error; send_error = MPI_Send([0], v.size(), MPI_DOUBLE, 2, 0, MPI_COMM_WORLD); The [0] part provides a pointer to the first member of the array that holds the data for the vector. If you know how long it will be, you could use that constant instead of using the v.size() function. Knowing the length also simplifies the send, since the remote process also knows the length and doesn't need a separate send to provide that information. It is also possible to provide a pointer to the start of storage for the character array that makes up a string. Both of these legacy friendly interfaces are part of the standard, and should be available on any reasonable implementation of the STL. If you are using a container that is not held in continuous memory, and the data is all of a single built in data type, then you need to first serialize the data into a block of continuous memory before sending it. (If the data block is large, then you may actually have to divide it into pieces and send them separately.) If the data is not a block of all a single built in type, (It may include several built in types, or it may be a custom data class with complex internal structure, for example.) then the serialization problem gets harder. In this case, look at the MPI provided facilities for dealing with complex data types and compare to the boost provided facilities. There is an initial learning curve for the boost facilities, but in the long run it may provide a substantial development time savings if you need to transmit and receive several complex types. In most cases, the run time cost is small for using the boost facilities. (according to the tests run during library development and documented with the library) John Phillips ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users
Re: [OMPI users] MPI and C++ - now Send and Receive of Classes and STL containers
Regardless of MPI, when sending C++ object over the network you have to serialize their contents. The structures, or classes, have to be coded to a stream of bytes, sent over the network, then recoded into their complex object types by the receiving application. There is no way to send object instances in their original memory format because the object layout is dependent on the machine/memory/compiler (plus a number of other things, I'm simplifying here). boost offers a library to easy the serialization work, but you still have to provide hooks to convert the object to a network format. http://www.boost.org/doc/libs/1_39_0/libs/serialization/doc/index.html On Jul 5, 2009, at 8:54 PM, Luis Vitorio Cargnini wrote: Hi, So, after some explanation I start to use the bindings of C inside my C++ code, then comme my new doubt: How to send a object through Send and Recv of MPI ? Because the types are CHAR, int, double, long double, you got. Someone have any suggestion ? Thanks. Vitorio.___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users
Re: [OMPI users] MPI and C++
On Jul 4, 2009, at 9:20 AM, Robert Kubrick wrote: > There is a proposal that has passed one vote so far to deprecate > the C++ bindings in MPI-2.2 (meaning: still have them, but advise > against using them). This opens the door for potentially removing > the C++ bindings in MPI-3.0. Is it the reason for this to boost the 'boost' library adoption? It is one reason, yes. Another reason is that the C++ bindings haven't really delivered what was expected. They were intended to be the baseline for implementing higher-level C++ abstraction (such as boost.MPI). But that didn't really happen -- the C++ bindings don't give enough extra functionality to be useful to a C++ programmer in this regard. This is the key reason that the Forum is voting to deprecate the C++ bindings: people are simply using the C bindings instead of the C++ bindings. That Boost.MPI is implemented on the C bindings instead of the C++ bindings speaks volumes to this effect. :-) -- Jeff Squyres Cisco Systems
Re: [OMPI users] MPI and C++
Thanks Jeff. Le 09-07-04 à 08:24, Jeff Squyres a écrit : There is a proposal that has passed one vote so far to deprecate the C++ bindings in MPI-2.2 (meaning: still have them, but advise against using them). This opens the door for potentially removing the C++ bindings in MPI-3.0. As has been mentioned on this thread already, the official MPI C++ bindings are fairly simplistic -- they take advantage of a few language features, but not a lot. They are effectively a 1-to-1 mapping to the C bindings. The Boost.MPI library added quite a few nice C++-friendly abstractions on top of MPI. But if Boost is unattractive for you, then your best bet is probably just to use the C bindings. smime.p7s Description: S/MIME cryptographic signature PGP.sig Description: Ceci est une signature électronique PGP
Re: [OMPI users] MPI and C++
On Jul 4, 2009, at 8:24 AM, Jeff Squyres wrote: On Jul 3, 2009, at 7:42 PM, Dorian Krause wrote: I would discourage you to use the C++ bindings, since (to my knowledge) they might be removed from MPI 3.0 (there is such a proposal). There is a proposal that has passed one vote so far to deprecate the C++ bindings in MPI-2.2 (meaning: still have them, but advise against using them). This opens the door for potentially removing the C++ bindings in MPI-3.0. Is it the reason for this to boost the 'boost' library adoption? As has been mentioned on this thread already, the official MPI C++ bindings are fairly simplistic -- they take advantage of a few language features, but not a lot. They are effectively a 1-to-1 mapping to the C bindings. The Boost.MPI library added quite a few nice C++-friendly abstractions on top of MPI. But if Boost is unattractive for you, then your best bet is probably just to use the C bindings. -- Jeff Squyres Cisco Systems ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users
Re: [OMPI users] MPI and C++
Thanks for your answers I'll use normal C-style MPI so. I checked boost, but it seems it only supplies me with a shared communication interface among the nodes, turning a little difficult to parallelize the processes itself, also boost obligate me to have an MPI installation too. Boost is working like a giant wrapper for many non- OO things to C++, and it seems to use boost I have to install a lot of additional things. Thanks. Regards. Vitorio. Le 09-07-03 à 19:44, Dorian Krause a écrit : I'm sorry. I meant boost.mpi ... Luis Vitorio Cargnini wrote: Hi, Please I'm writing a C++ applications that will use MPI. My problem is, I want to use the C++ bindings and then come my doubts. All the examples that I found people is using almost like C, except for the fact of adding the namespace MPI:: before the procedure calls. For example I want to apply MPI for a OO code, like inside my object, for example, call the MPI::Init() inside the constructor ... Please if someone could advice me on this thanks. ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users smime.p7s Description: S/MIME cryptographic signature PGP.sig Description: Ceci est une signature électronique PGP
Re: [OMPI users] MPI and C++
I'm sorry. I meant boost.mpi ... Luis Vitorio Cargnini wrote: Hi, Please I'm writing a C++ applications that will use MPI. My problem is, I want to use the C++ bindings and then come my doubts. All the examples that I found people is using almost like C, except for the fact of adding the namespace MPI:: before the procedure calls. For example I want to apply MPI for a OO code, like inside my object, for example, call the MPI::Init() inside the constructor ... Please if someone could advice me on this thanks. ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users
Re: [OMPI users] MPI and C++
Hi, Luis Vitorio Cargnini wrote: Hi, Please I'm writing a C++ applications that will use MPI. My problem is, I want to use the C++ bindings and then come my doubts. All the examples that I found people is using almost like C, except for the fact of adding the namespace MPI:: before the procedure calls. That's how the bindings are defined in the Standard. For example I want to apply MPI for a OO code, like inside my object, for example, call the MPI::Init() inside the constructor ... MPI has itself an object-oriented design, so this should be no problem. I would discourage you to use the C++ bindings, since (to my knowledge) they might be removed from MPI 3.0 (there is such a proposal). You might also want to take a look at Python.MPI which is a popular wrapper library. Hope this helps, Dorian Please if someone could advice me on this thanks. ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users