Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-user] Program Arguments

I think I see the same thing. I augmented the sample Hello World MPI example to print out the arguments:

#include <stdio.h>
#include <mpi.h>

int main(int argc, char *argv[]) {
   int rank;
   MPI_Init(&argc, &argv);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   printf("ArgC: %d\n",argc);
   printf("Argv: %d %d\n", atoi(argv[0]),atoi(argv[1]) );
   printf("Hello World from rank=%d\n", rank);
   MPI_Finalize();
   return 0;
}

I then added command line arguments to the program in the run configuration under the Arguments tab in the Parallel program arguments with the values 500 1024 215432543.

My output was:

ArgC: 2
Argv: 0 500
Hello World from rank=0

Jonathan

Natalie Freed wrote:
Hello,

I'm running into a problem when trying to pass command line arguments to a program. I've tried entering them under the Arguments tab in the launch configuration dialog, as described in the documentation (here: http://www.eclipse.org/ptp/documentation/org.eclipse.ptp.help/html/02pLaunchConfig.html). This works fine if I only have one argument, but when I enter more than one (separated by spaces-I also tried line breaks and commas), only the first is read. It appears to be passing the entire thing as a string rather than parsing the individual arguments. I tried reinstalling without PTP (so just Eclipse core and the CDT), and that works just fine, so I'm thinking this is a PTP problem. Has anyone had this problem, and is it a bug, or am I doing something wrong? I'm using OpenMPI 1.2, Eclipse 3.2, CDT 3.1, and PTP 1.1, both on Linux and Mac OS X (both installations have the problem).

Thanks :)
Natalie
------------------------------------------------------------------------

_______________________________________________
ptp-user mailing list
ptp-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-user


Back to the top