[mvapich-discuss] OSC's mpiexec local rank

Brody Huval brodyh at stanford.edu
Sun Mar 24 14:17:55 EDT 2013


Hi Doug,

Thanks for the reply. I believe I have used PMI_ID before and had it work. However, I just switched to a different cluster and am now seeing this behavior:

Hello World from process 0 with PMI_ID=0 running on kid080.nics.utk.edu
Hello World from process 1 with PMI_ID=1 running on kid080.nics.utk.edu
Hello World from process 9 with PMI_ID=9 running on kid076.nics.utk.edu
Hello World from process 2 with PMI_ID=2 running on kid080.nics.utk.edu
Hello World from process 10 with PMI_ID=10 running on kid076.nics.utk.edu
Hello World from process 11 with PMI_ID=11 running on kid076.nics.utk.edu
Hello World from process 3 with PMI_ID=3 running on kid078.nics.utk.edu
Hello World from process 6 with PMI_ID=6 running on kid077.nics.utk.edu
Hello World from process 4 with PMI_ID=4 running on kid078.nics.utk.edu
Hello World from process 7 with PMI_ID=7 running on kid077.nics.utk.edu
Hello World from process 5 with PMI_ID=5 running on kid078.nics.utk.edu
Hello World from process 8 with PMI_ID=8 running on kid077.nics.utk.edu


From this simple program:


int main(int argc, char *argv[]) {
        int rank, ntasks, length, local_rank;
        char hostname[80];             /* Message array */
	local_rank = atoi(getenv("PMI_ID"));
	MPI_Init(&argc, &argv); /* Initialize MPI */
	MPI_Comm_size(MPI_COMM_WORLD, &ntasks);/* Get nr of tasks */
 	MPI_Comm_rank(MPI_COMM_WORLD, &rank);    /* Get id of this process */
        MPI_Get_processor_name(hostname, &length);  /* Get name of this processor */
        printf("Hello World from process %d with PMI_ID=%d running on %s\n", rank, local_rank,hostname);
	MPI_Finalize();         /* Terminate MPI */
        exit(0);
}


I am just using "mpiexec <program>" within a submit script. Any idea why this would happen? Thanks for your time.

Best,
Brody


On Mar 24, 2013, at 4:58 AM, Doug Johnson <djohnson at osc.edu> wrote:

> At Sat, 23 Mar 2013 23:26:36 -0700,
> Brody Huval wrote:
>> 
>> Hi,
>> 
>> Is there an equivalent to the MV2_COMM_WORLD_LOCAL_RANK when using OSC's mpiexec with PBS/torque? If not, anyone have any suggestions or code to get one?
>> 
> 
> Hi Brody,
> 
> The OSC mpiexec PMI_ID environment variable is equivalent.
> 
> Best,
> Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.cse.ohio-state.edu/pipermail/mvapich-discuss/attachments/20130324/47720060/attachment-0001.html


More information about the mvapich-discuss mailing list