• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: XCode and MPI
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCode and MPI


  • Subject: Re: XCode and MPI
  • From: Ignaz Reicht <email@hidden>
  • Date: Thu, 30 Jun 2011 09:46:11 +0200

Dear Dave,
thank you for your help!

best
iggy

2011/6/25 <email@hidden>

On Jun 25, 2011, at 7:09 AM, Ignaz Reicht wrote:

> Dear Users,
>
> Has someone experience using openMPI in XCode? When executing the MPI program using commandline, I can set parameters for the number of processes/cores:$ mpiexec -n 8 MyMPIprogram
>
> When executing this program in XCode4 I only get 1 process/core running. Anyone an Idea how to set additional parameters to the compiler in XCode or how XCode and MPI work together?
>
> Thanks
> Iggy

Here's what I've done:

First, create a mpi.xcconfig file that looks like this:

CC = /usr/bin/mpic++

and then add a user-defined build setting and tell it to use that. I think I also had to tell it to use llvm-gcc-4.2 as the compiler in the normal settings otherwise it passed some new llvm flags that mpic++ didn't recognize.

To make it run, I edited the Scheme,  and told it to use a custom executable and selected /usr/bin/mpirun (which shows up as orterun since mpirun is a symlink to that. On the arguments tab, I added:

-np 4

and

$(BUILT_PRODUCTS_DIR)/floydmpi

where floydmpi is the name of my executable.

Then it will run it within Xcode4 using 4 processes. The downside is if you program requires standard input, the input you type in at the Xcode console is not passed to your executable so this will only work with programs that do not require any standard input (i.e., pass everything via the command line). Because of this, I usually just use Xcode to edit and compile and then run the executable from the Terminal.

If you search the archives you'll find myself and others posting about the standard input issue and none of the suggestion people made worked so I gave up and just use the Terminal. If you figure out a solution, please post it to the list.

HTH,
Dave


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >XCode and MPI (From: Ignaz Reicht <email@hidden>)
 >Re: XCode and MPI (From: email@hidden)

  • Prev by Date: Re: Program Structure
  • Next by Date: Re: IB localization question
  • Previous by thread: Re: XCode and MPI
  • Next by thread: Suppressing pointer sign warnings
  • Index(es):
    • Date
    • Thread