f



C++ or C?

I am new to MPI and have a basic understanding of C and C++. So I was
wondering if any of you guys with experience in using MPI had any
pointers with regards choosing either C or C++.

I intend to use MPI in parallelizing code I have that was written in
Java. So obviously the Java code it is heavly object orientated. With
regards parallelizing it; right now I think it will mainly be a
Master-Slave style of design with no inter-process communication
needed once the master has sent the work to the slave.

Most, if not all, of my communications will involve simply sending a
large object from the master to the slaves, with the slaves returning
this object (a modified version of) to the master.

Right now I am thinking that it would be most convenient to just write
it in C++.

But with regards performance, will there be a significant overhead in
using C++ as oppossed to C.

Also, can I simply send a C++ object using MPI_Send?



Apologies if these questions sound naive/trivial...but i am new :)

Any help appreciated,

Pat.
0
googleaddress
7/6/2004 6:18:31 AM
comp.parallel.mpi 1534 articles. 0 followers. kisitanggang (69) is leader. Post Follow

2 Replies
1402 Views

Similar Articles

[PageSpeed] 8

Patrick schrieb:
> I am new to MPI and have a basic understanding of C and C++. So I was
> wondering if any of you guys with experience in using MPI had any
> pointers with regards choosing either C or C++.
> 
> I intend to use MPI in parallelizing code I have that was written in
> Java. So obviously the Java code it is heavly object orientated. With
> regards parallelizing it; right now I think it will mainly be a
> Master-Slave style of design with no inter-process communication
> needed once the master has sent the work to the slave.
> 
> Most, if not all, of my communications will involve simply sending a
> large object from the master to the slaves, with the slaves returning
> this object (a modified version of) to the master.
> 
> Right now I am thinking that it would be most convenient to just write
> it in C++.
> 
> But with regards performance, will there be a significant overhead in
> using C++ as oppossed to C.

Not really.

> 
> Also, can I simply send a C++ object using MPI_Send?

No. Why? For an explanation consider the following question:
Why can't you just write() an C++ object to a file and read()
it into another process?
Hint: pointers...
> 
> 
> 
> Apologies if these questions sound naive/trivial...but i am new :)
> 
> Any help appreciated,
> 
> Pat.

I suggest that you may write your code in C++ but only use
the C binding of the MPI standard (see www.mpi-forum.org for
the standard papers). The reason for my suggestion is that
the C++ binding of MPI does not introduce additional functionality
and it of course is not able to convert a non object-oriented API
into an OO API.

If you search for me and C++ in this newsgroup (for example
at groups.google.com) then you will find other rants from
my about the uselessness of the C++ binding :-)

ciao
Georg


0
Georg
7/6/2004 2:22:32 PM
Georg Bisseling <spam@bisseling.de> wrote in message news:<2kvqtcF6u6rnU1@uni-berlin.de>...
> Patrick schrieb:
> > I am new to MPI and have a basic understanding of C and C++. So I was
> > wondering if any of you guys with experience in using MPI had any
> > pointers with regards choosing either C or C++.
> > 
> > I intend to use MPI in parallelizing code I have that was written in
> > Java. So obviously the Java code it is heavly object orientated. With
> > regards parallelizing it; right now I think it will mainly be a
> > Master-Slave style of design with no inter-process communication
> > needed once the master has sent the work to the slave.
> > 
> > Most, if not all, of my communications will involve simply sending a
> > large object from the master to the slaves, with the slaves returning
> > this object (a modified version of) to the master.
> > 
> > Right now I am thinking that it would be most convenient to just write
> > it in C++.
> > 
> > But with regards performance, will there be a significant overhead in
> > using C++ as oppossed to C.
> 
> Not really.
> 
> > 
> > Also, can I simply send a C++ object using MPI_Send?
> 
> No. Why? For an explanation consider the following question:
> Why can't you just write() an C++ object to a file and read()
> it into another process?
> Hint: pointers...
> > 
> > 
> > 
> > Apologies if these questions sound naive/trivial...but i am new :)
> > 
> > Any help appreciated,
> > 
> > Pat.
> 
> I suggest that you may write your code in C++ but only use
> the C binding of the MPI standard (see www.mpi-forum.org for
> the standard papers). The reason for my suggestion is that
> the C++ binding of MPI does not introduce additional functionality
> and it of course is not able to convert a non object-oriented API
> into an OO API.
> 
> If you search for me and C++ in this newsgroup (for example
> at groups.google.com) then you will find other rants from
> my about the uselessness of the C++ binding :-)
> 
> ciao
> Georg

Thank you for your reply Georg. This gives me a starting point.

My main concern now is sending objects from master to slave and
vica-versa. I guess this is a common problem and well documented.

regards,
pat
0
googleaddress
7/7/2004 10:13:22 PM
Reply:

Similar Artilces:

Better C/C++ Than C/C++?
I am looking for a good systems programming language that can be used instead of C/C++. My qualifications for the language are: * mature compiler(s) that produce native-code binaries (for Windows) * open source - preferable, but not 100% necessary Thanks, Kevin "Kevin Albrecht" <kevin@albrecht.net> writes: > I am looking for a good systems programming language > that can be used instead of C/C++. My qualifications > for the language are: > > * mature compiler(s) that produce native-code > binaries (for Windows) Ocaml, D, cyclone, Eiffel, Beta > * open source - preferable, but not 100% necessary what's wrong with using C? Friedrich > what's wrong with using C? Too low level, no built-in garbage collection. -- Kevin "Kevin Albrecht" <kevin@albrecht.net> writes: >> what's wrong with using C? > > Too low level, Well the Smalltalk people say, have a small language and a big library. I assume C's library status beyond that of Smalltalk. > no built-in garbage collection. Use the Boehm Weisser GC. Friedrich "Kevin Albrecht" <kevin@albrecht.net> wrote in message news:<2TiYb.237892$rj7.1641209@twister.tampabay.rr.com>... > I am looking for a good systems programming language > that can be used instead of C/C++. My qualifications > for the language are: > > * mature compiler(s) that produce native-code > binaries (for Windows) > ...

C/C++ in MATALB or MATLAB in C/C++?
Hi I've been asking on the net how to use MEX properly so that I can use C/C++ in MATLAB, but information is not forthcoming. There seems to be a lot on using MATLAB in C/C++ but not the other way around. I understand Mathworks is trying very hard to sell the Matlab Compiler, but even so, why is it SO hard to get information about MEX? Or is it that I've missed something very fundamental, meaning that I'm struggling over something that is actually quite easy? Any thoughts and info would be great. Thanks BullDog BullDog wrote: > Hi > > I've been asking on the net ...

C/C++ in matlab and matlab in C/C++ ?
Is it possible to read C/C++ code in matlab and the other way around too? Hi, as long as C or C++ are written in text files you can edit them in the matlab editor. To see the special character of C or C++ coding language, in the editor go to menus: file>preferences>Edito/Debugger>language and on popup "Language" select "C/C++". This does not allow you to run the C/C++ code, just to view it i nicer way... regards, chris saneman <asdfsdf@asd.com> wrote in message <frl846 $f8i$2@news.net.uni-c.dk>... > Is it possible to read C/C...

C,, C++, Java, C#
I come from C,C++,Java and C#. What can SmallTalk do for me and for what cost? Regarding the Squeak thing, it's interesting though confusing. Is it an IDE? Why are the menus so wacky? "DM McGowan II" <nospam@nospam.net> wrote in message news:PLednX2vnLd11IncRVn-rA@comcast.com... > I come from C,C++,Java and C#. What can SmallTalk do for me ...? Ask not what Smalltalk can do for, but what can you do with Smalltalk. :-) In very few words, it significantly reduces time to market, while enhancig the development experience. This is because: 1. It manages the memory for you, so you don't have to allocate/deallocate all the time (the source of some of the most nasty bugs in C). Java and C# learnt that feature from ST. 2. It has single inheritance. 3. All the development is in a single file, called the image, so you don't have to fish for where did you put that missing class. Yet, you don't have to go through thousands of lines of code to find the method you wrote three months ago. 4. It's the language for which it's easier to work within the Agile methodologies. 5. It's strongly typed without being unnecessarily redundant. 6. It's "wacky" interface releases you from the need to use curlys. 7. It comes with a huge library, so you don't need to reinvent the wheel as much. 8. It's debugger is highly integrated and friendly, so the experience of findin...

c,c++,obj-c
Of the 3 languages titled in this post is c++ older than obj-c ? Would someone experienced in C be able to dive right into C++ rather than obj-c ? Java is out for me now except applet programming I think I'm going to go with just C and C++. Bill Bill Cunningham wrote: > Of the 3 languages titled in this post is c++ older than obj-c ? Why does that matter? Do you want to use an old language? Try Fortran or LISP. > Would > someone experienced in C be able to dive right into C++ rather than > obj-c ? Not quite dive in, at least not into the OO parts of C++. ...

C, C++ and C# Forums
Throne Software has opened up C, C++ and C# Forums at: http://www.thronesoftware.com/forum/ Join us! ...

c++/c
hi i have been recently told that there is no exception handling ic c+ +.?? as far as i remember i have read, it has. also java has exception handling for sure but there we can use finally also which we cant use in c ++. what other differences do we have in the two languages c++ and java in exception handling. and which one is better? rupika wrote: > > i have been recently told that there is no exception handling ic > c++.?? You should ask about C in comp.lang.c, about C++ in comp.lang.c++. -- [mail]: Chuck F (cbfalconer at maineline dot net) [page]: <http://cbfalconer.home...

About C and C++
Hello, I will resume it like this: On the criterias of "complexity" and "difficulty", the C and C++ programming languages are more complex and difficult than Object Pascal for example, so since they are more complex and difficult they are likely to create something like a darwinian filter who don't let the weaker humans among us humans to cross or to climb the social ladder, this is why i think that C and C++ do participate to social darwinism, this is why i say that C and C++ are bad. Thank you, Amine Moulay Ramdane. ...

c++ or c#
hello all experiancesd techies, i am a final yr engg student with knowledge of c++ n java. i want to start windows programing, n hence have to decide whether to choose my language as c++ or c#. please guide me which language would benefit in the long run, if i intend to persue a job in a product development company/( like adobe) after graduation,(not in a consultancy like acenture). also suggest me good books for that. thanx a lot <pravin.chaudhary@gmail.com> wrote in message news:1131971088.291580.42500@g47g2000cwa.googlegroups.com... > i am a final yr engg student with ...

c++ to c
Hello Everyone, I have a project where I need to write C++ code in C (due to OS issues). Can someone please show me exactly what I need to do to convert the code to C. Thanks Jami Here is the code I need to convert to C++: class CTestSuite : public CTestSuiteBase { public : CTestSuite(CTestBase *aTest); virtual ~CTestSuite(); virtual TInt InvokeTestL(int argc, char * argv[], TTestConfig * aConfig) ; IMPORT_C CTestSuite *GetTestSuite(); virtual int RunTestL(int aArgc, char *aArgv [], TTestConfig *aConfig); protected: CTestBase *iTest; } ; class CTestSuiteBase : p...

C or C++
Hi All, I am starting to learn C and am wondering if C++ may be a better choice? The purpose is to do free software development and eventually contribute to existing projects. I believe that a lot of gnome stuff is c and kde stuff tends to be c++ is that correct? what would other people out their recommend. I realize there are lots of different opinions on this but I was just interest to see third party thoughts. Thanks Anthony Anthony Irwin <nospam@noemailhere.nowhere> wrote: > Hi All, > > I am starting to learn C and am wondering if C++ may be a ...

More about C and C++
Hello, I have wrote: >I will resume it like this: >On the criterias of "complexity" and "difficulty", the C and C++ >programming languages are more complex and difficult than Object >Pascal for example, so since they are more complex and difficult they >are likely to create something like a darwinian filter who don't let >the weaker humans among us humans to cross or to climb the social >ladder, this is why i think that C and C++ do participate to social >darwinism, this is why i say that C and C++ are bad. Joseph Mitzen repsonded: >Something may be more complex or more difficult to learn but it may >bring more capabilities. For instance, a helicopter is both >mechanically more complex and more difficult to learn to fly than an >airplane. However, helicopters possess vertical takeoff and landing >which allow it to reach places planes can not and also gives it >special abilities, such as hovering. >Two important measurements then are the value (what one gains for the >complexity) and what one needs to do (is language X enough for the >task, will feature Y be used, etc.). >Otherwise, one could simply say "Delphi is more complex and difficult >than Ruby or Python, therefore Delphi is bad." It's not only >simplistic, it's also meaningless (bad at what?). I understand your example of hellicopter, you are s...

c to c++
hi, i was wondering whether its worth converting from c to c++? i'm lazy but if its worth the effort... ______________________ http://monsterbeans.com/ | --------------------------------------- eminhanif@googlemail.com wrote: > hi, > i was wondering whether its worth converting from c to c++? > i'm lazy but if its worth the effort... Rather than participating in the language war flamefest your message invites, I will simply make the most obvious point: it is worth your while to learn any language that will be used in connection with your work. This includes learning a ...

C C++
While reading some source code, I saw a variable called "end" of type "time". So I investigated what the type "time" meant and saw that time was a typedef for "Real". So what does "Real" mean? "Real" is a typedef for QL_REAL. So what does "QL_REAL" mean? QL_REAL is type double via the line of code #define QL_REAL double.... "Mallik * G" <gadde.mallik@gmail.com> wrote in message news:7e4a882c-6f46-46eb-aa54-903842fa1b4d@p39g2000prm.googlegroups.com... > While reading some source code, I saw a variable cal...

C++ to C
Are there any open source C++ compilers that will produce C code? I understand the first C++ compilers operated this way. On Mon, 27 Oct 2003 23:07:19 GMT, "Bootstrap Bill" <wrcousert@yahoo.com> wrote in comp.lang.c: > Are there any open source C++ compilers that will produce C code? I > understand the first C++ compilers operated this way. C++ compilers are off-topic in comp.lang.c. -- Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html comp.lang.c++ http://www.parashift.com/c++-faq-lite/ alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq "Bootstrap Bill" <wrcousert@yahoo.com> writes: > Are there any open source C++ compilers that will produce C code? I > understand the first C++ compilers operated this way. You might want to have a look at Comeau - it's not open source, but it's cheap, and AFAIK does exactly what you want (www.comeaucomputing.com) HTH & kind regards frank -- Frank Schmitt 4SC AG phone: +49 89 700763-0 e-mail: frankNO DOT SPAMschmitt AT 4sc DOT com in comp.lang.c i read: >"Bootstrap Bill" <wrcousert@yahoo.com> writes: >> Are there any open source C++ compilers that will produce C code? I >> understand the first C++ compilers operated this way. > >You might want to have a look at Comeau - it's not open source, but >it's cheap, and AFAIK does exactly what you want but note ...

What After C and C++?
First it was C, then C++, what comes next? "Penna Elabi" <terebinthus@go.com> wrote in message news:77081966.0311290846.3d5a7064@posting.google.com... > First it was A whole bunch of computer languages, then >C, then a whole bunch more computer languages, then >C++, what comes next? A whole bunch more. So what? Did you have a question about C++ (which is the *only* topic here) ? -Mike "Penna Elabi" <terebinthus@go.com> wrote... > First it was C, then C++, what comes next? Who cares? This newsgroup is concerned with C++, not with what c...

C or C++
i would like someone with experience to answer my question ! C or C++ and why? Which one is stronger ? The criteria are yours! Thanks in advance guys. -- --------------------------------- --- -- - Posted with NewsLeecher v3.7 Final Web @ http://www.newsleecher.com/?usenet ------------------- ----- ---- -- - vadam17@hotmail.com ha scritto: > i would like someone with experience to answer my question ! C or > C++ and why? Which one is stronger ? The criteria are yours! > Thanks in advance guys. why cat or dog ? they are 2 different animals .... it is the same ... in my opinion...

c++ or c#
Hi. I'm new to c++ and still learning it. I've been advised that c and c++ are now becoming obsolete..I better learn c# (supposedly the best language available) ..is it true?? * sandy: > Hi. I'm new to c++ and still learning it. I've been advised that c > and c++ are now becoming obsolete..I better learn c# (supposedly the > best language available) ..is it true?? The premise is false but many, including me, agree with the conclusion that you should learn e.g. C# first (obviously for different reasons). Learning C# or another language first might take you months o...

More about C and C++
Hello... I have wrote: >I will resume it like this: >On the criterias of "complexity" and "difficulty", the C and C++ >programming languages are more complex and difficult than Object >Pascal for example, so since they are more complex and difficult they >are likely to create something like a darwinian filter who don't let >the weaker humans among us humans to cross or to climb the social >ladder, this is why i think that C and C++ do participate to social >darwinism, this is why i say that C and C++ are bad. Josep...

C or C++?
Hi, I am a newbie to programming, and sorry again that I have to ask the C or C++ questions. Is C required before learning C++? And become better in C does it also make you a better C++ programmer? Or that to be a C+ + programmer, it's better not to have any knowledge of C and start a new in the C++ way as some books suggest? weidongtom@gmail.com wrote: > Hi, > > I am a newbie to programming, and sorry again that I have to ask the C > or C++ questions. Is C required before learning C++? No. And become better > in C does it also make you a better C++ programmer? Not n...

About C and C++
Hello... I will resume it like this: On the criterias of "complexity" and "difficulty", the C and C++ programming languages are more complex and difficult than Object Pascal for example, so since they are more complex and difficult they are likely to create something like a darwinian filter who don't let the weaker humans among us humans to cross or to climb the social ladder, this is why i think that C and C++ do participate to social darwinism, this is why i say that C and C++ are bad. Thank you, Amine Moulay Ramdane. On Sunday, 8 June 2014...

More about C and C++
Hello, I have wrote: >I will resume it like this: >On the criterias of "complexity" and "difficulty", the C and C++ >programming languages are more complex and difficult than Object >Pascal for example, so since they are more complex and difficult they >are likely to create something like a darwinian filter who don't let >the weaker humans among us humans to cross or to climb the social >ladder, this is why i think that C and C++ do participate to social >darwinism, this is why i say that C and C++ are bad. Josep...

Parallelizing C/C++ code
Hello Folks, I have been searching for information about Compiler approaches to parallelization of code. I haven't much information about it. I have looked into SUIF, CIL and Daedalus but I don't know if they have enough results to be used as an actual parallelization platform. Will the approach be dependent on the MoC like in Daedalus? I am new to the area and would like to have some feedback from you about what is actually useful and what has already been dropped by the community. The intention is to get some kind of parallelism analysis out of C/C++ code. Thanks for any help, Raphael. According to google there are 4.4 million hits for "parallelizing compiler". :) So you know it's a huge area. Perhaps start with wikipedia for an introduction. On May 1, 7:00 am, russell kym horsell <k...@sdf.lonestar.org> wrote: > According to google there are 4.4 million hits for "parallelizing > compiler". :) So you know it's a huge area. Perhaps start with > wikipedia for an introduction. Hi Russel, Thanks for googling it for me :) Nevertheless, I think the problem for me lies more in the analysis area. Are the analysis for parallelism worth the effort for compilers technology? Googling for a tool that accomplishes such parallelization gives no result. I therefore imagine that it has no simple solution. Since I'm no compilers researcher I thought of asking here, maybe I could get an answer like: It has not been adopted by ...

Web resources about - C++ or C? - comp.parallel.mpi

C++ - Wikipedia, the free encyclopedia
C++ (pronounced "see plus plus") is a statically typed , free-form , multi-paradigm , compiled , general-purpose programming language . It is ...

Facebook Open-Sources C++ HTTP Library Collection Proxygen
Facebook’s open-source train keeps rolling, as the social network announced the release of Proxygen , a collection of C++ HTTP libraries, which ...

Dr. Dobb's - Good stuff for serious developers: Programming Tools, Code, C++, Java, HTML5, Cloud, Mobile ...
... articles, source code, blogs,forums,video tutorials, and audio podcasts, as well as articles from Dr. Dobb's Journal, BYTE.com, C/C++ Users ...

C - Skills - LinkedIn
See top C professionals, groups, and related job openings.

bind - Fixed point combinators in C++ - Stack Overflow
#include #include #include // Y-combinator compatible factorialint fact(boost::function f,int v){ if(v == 0) return 1; else return v * f(v -1);}// ...

Learning C++ HD on the App Store on iTunes
Get Learning C++ HD on the App Store. See screenshots and ratings, and read customer reviews.

CppCon 2014: T. Grue & S. Kabbes "A Deep Dive into 2 Cross-Platform Mobile Apps Written in C++" - YouTube ...
http://www.cppcon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2014 ...

Apple popularity boosts Objective-C language past C++ - Mobile Development, mobile technology, iPhone ...
Tiobe's language usage index now has the Objective-C language used for building iPad and iPhone apps taking third place, knocking C++ to fourth ...

C++ Front Office Trading Software Engineer - Trading exposure
CFOworld.com.au covers accounting, risk management, taxation, technology and financial news from ASX-listed companies.

Mastering Object Oriented Design in C++
Defining Technology for Australia's IT Leaders.

Resources last updated: 3/19/2016 2:34:43 PM