George is correct.  Try this:

[5:21] svbu-mpi:~/mpi % cat tag-ub.f90
program mpitag
      use mpi
      implicit none
      integer :: err
      integer (KIND=MPI_ADDRESS_KIND) :: my_tag_ub
      logical flag

      call MPI_INIT(err)
      call MPI_COMM_GET_ATTR(MPI_COMM_WORLD, MPI_TAG_UB, my_tag_ub, flag, err)
      if (flag .eq. .true.) then
         print *, "Got tag ub:", my_tag_ub
      else
         print *, "Couldn't find tag ub!"
      endif
      call MPI_FINALIZE(err)
end program mpitag
[5:21] svbu-mpi:~/mpi % mpif90 tag-ub.f90
[5:22] svbu-mpi:~/mpi % ./a.out 
 Got tag ub:            2147483647
[5:22] svbu-mpi:~/mpi % 



On Mar 13, 2012, at 7:50 PM, George Bosilca wrote:

> MPI_TAG_UB is not a constant, it is a predefined attribute. As such it should 
> be accessed using the attribute accessors (MPI_COMM_GET_ATTR page 229 in the 
> MPI 2.2 standard).
> 
>   george.
> 
> On Mar 13, 2012, at 13:51 , Timothy Stitt wrote:
> 
>> Hi Jeff,
>> 
>> I went through the procedure of compiling and running, then copied the 
>> procedure verbatim from the command line (see below). 
>> 
>> ********
>> [tstitt@memtfe] /pscratch/tstitt > more mpitag.f90
>> program mpitag
>> 
>>   use mpi
>> 
>>   implicit none
>> 
>>   integer :: err
>> 
>>   call MPI_INIT(err)
>>   
>>   print *,MPI_TAG_UB
>> 
>>   call MPI_FINALIZE(err)
>> 
>> end program mpitag
>> [tstitt@memtfe] /pscratch/tstitt > mpif90 --version
>> ifort (IFORT) 12.0.2 20110112
>> Copyright (C) 1985-2011 Intel Corporation.  All rights reserved.
>> 
>> [tstitt@memtfe] /pscratch/tstitt > mpiexec --version
>> mpiexec (OpenRTE) 1.4.3
>> 
>> Report bugs to http://www.open-mpi.org/community/help/
>> [tstitt@memtfe] /pscratch/tstitt > mpif90 -o mpitag mpitag.f90 
>> [tstitt@memtfe] /pscratch/tstitt > mpiexec -n 2 ./mpitag 
>>            0
>>            0
>> **********
>> 
>> Let me know if you need any further information.
>> 
>> Thanks,
>> 
>> Tim.
>> 
>> On Mar 13, 2012, at 1:39 PM, Jeffrey Squyres wrote:
>> 
>>> Tim -- 
>>> 
>>> I am unable to replicate this problem with a 1.4 build with icc.
>>> 
>>> Can you share your test code?
>>> 
>>> 
>>> On Mar 10, 2012, at 7:30 PM, Timothy Stitt wrote:
>>> 
>>>> Hi all,
>>>> 
>>>> I was experimenting with MPI_TAG_UB in my code recently and found that its 
>>>> value is set to 0 in my v1.4.3 and v1.4.5 builds (these are the only 
>>>> builds I have available to test). 
>>>> 
>>>> Oddly it only happens with my builds compiled with the Intel compiler. The 
>>>> PGI builds do produce a non-zero value. Has anyone else experienced this?
>>>> 
>>>> Regards,
>>>> 
>>>> Tim.
>>>> _______________________________________________
>>>> users mailing list
>>>> us...@open-mpi.org
>>>> http://www.open-mpi.org/mailman/listinfo.cgi/users
>>> 
>>> 
>>> -- 
>>> Jeff Squyres
>>> jsquy...@cisco.com
>>> For corporate legal information go to: 
>>> http://www.cisco.com/web/about/doing_business/legal/cri/
>>> 
>>> 
>>> _______________________________________________
>>> users mailing list
>>> us...@open-mpi.org
>>> http://www.open-mpi.org/mailman/listinfo.cgi/users
>> 
>> Tim Stitt PhD (User Support Manager).
>> Center for Research Computing | University of Notre Dame | 
>> P.O. Box 539, Notre Dame, IN 46556 | Phone:  574-631-5287 | Email: 
>> tst...@nd.edu 
>> 
>> _______________________________________________
>> 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


-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to