Or use MPI_Type_match_size to find the right type.

  George.

> On Jan 8, 2015, at 19:05 , Gus Correa <g...@ldeo.columbia.edu> wrote:
> 
> Hi Diego
> 
> *EITHER*
> declare your QQ and PR (?) structure components as DOUBLE PRECISION
> *OR*
> keep them REAL(dp) but *fix* your "dp" definition, as George Bosilca 
> suggested.
> 
> Gus Correa
> 
> On 01/08/2015 06:36 PM, Diego Avesani wrote:
>> Dear Gus, Dear All,
>> so are you suggesting to use DOUBLE PRECISION and not REAL(dp)?
>> Thanks again
>> 
>> Diego
>> 
>> 
>> On 9 January 2015 at 00:02, Gus Correa <g...@ldeo.columbia.edu
>> <mailto:g...@ldeo.columbia.edu>> wrote:
>> 
>>    On 01/08/2015 05:50 PM, Diego Avesani wrote:
>> 
>>        Dear George, Dear all,
>>        what are the other issues?
>> 
>>        Why did you put in selected_real_kind(15, 307) the number 307
>> 
>> 
>>    Hi Diego
>> 
>>    That is the Fortran 90 (and later) syntax for selected_real_kind.
>>    The first number is the number of digits in the mantissa,
>>    the second is the exponent range.
>>    For (simpler) alternatives, see here:
>> 
>>    http://fortranwiki.org/__fortran/show/Real+precision
>>    <http://fortranwiki.org/fortran/show/Real+precision>
>> 
>>    A lot of grief (and probably the segfault)
>>    could have been saved if you just used
>>    "DOUBLE PRECISION", instead of REAL in your
>>    structure components declaration, as I suggested a while back.
>> 
>>    I hope this helps,
>>    Gus Correa
>> 
>> 
>>        Thanks again
>> 
>>        Diego
>> 
>> 
>>        On 8 January 2015 at 23:24, George Bosilca <bosi...@icl.utk.edu
>>        <mailto:bosi...@icl.utk.edu>
>>        <mailto:bosi...@icl.utk.edu <mailto:bosi...@icl.utk.edu>>> wrote:
>> 
>>             Diego,
>> 
>>             Please find below the corrected example. There were several
>>        issues
>>             but the most important one, which is certainly the cause of the
>>             segfault, is that "real(dp)" (with dp =
>>        selected_real_kind(p=16)) is
>>             NOT equal to MPI_DOUBLE_RECISION. For double precision you
>>        should
>>             use 15 (and not 16).
>> 
>>                George.
>> 
>> 
>>             On Thu, Jan 8, 2015 at 6:08 AM, Jeff Squyres (jsquyres)
>>             <jsquy...@cisco.com <mailto:jsquy...@cisco.com>
>>        <mailto:jsquy...@cisco.com <mailto:jsquy...@cisco.com>>> wrote:
>> 
>>                 There were still some minor errors left over in the
>>        attached
>>                 program.
>> 
>>                 I strongly encourage you to use "use mpi" instead of
>>        "include
>>                 'mpif.h'" because you will get compile time errors when
>>        you pass
>>                 incorrect / forget to pass parameters to MPI
>>        subroutines.  When
>>                 I switched your program to "use mpi", here's what the
>>        compiler
>>                 showed me:
>> 
>>                 1. the name "MPI" is reserved
>>                 2. need to pass displacements(1:nstruct+1) to
>>        mpi_type_create_struct
>>                 3. need to pass request(1) to mpi_isend
>>                 4. need to pass request(1) to mpi_wait
>>                 5. need to pass ierr argument to mpi_wait
>> 
>>                 1-4 are technically not correct, but the program would
>>        likely
>>                 (usually) compile/run "correctly" anyway.  5 is
>>        probably what
>>                 caused your segv.
>> 
>>                 Attached is my copy of your program with fixes for the
>>                 above-mentioned issues.
>> 
>>                 BTW, I missed the beginning of this thread -- I assume
>>        that this
>>                 is an artificial use of mpi_type_create_resized for the
>>        purposes
>>                 of a small example.  The specific use of it in this program
>>                 appears to be superfluous.
>> 
>> 
>> 
>> 
>> 
>>                 On Jan 8, 2015, at 4:26 AM, Gilles Gouaillardet
>>                 <gilles.gouaillar...@iferc.org
>>        <mailto:gilles.gouaillar...@iferc.org>
>>                 <mailto:gilles.gouaillardet@__iferc.org
>>        <mailto:gilles.gouaillar...@iferc.org>>> wrote:
>> 
>>                 > Diego,
>>                 >
>>                 > yes, it works for me (at least with the v1.8 head and
>>        gnu compilers)
>>                 >
>>                 > Cheers,
>>                 >
>>                 > Gilles
>>                 >
>>                 > On 2015/01/08 17:51, Diego Avesani wrote:
>>                 >> Dear Gilles,
>>                 >> thanks again, however it does not work.
>>                 >>
>>                 >> the program says:  "SIGSEGV, segmentation fault
>>        occurred"
>>                 >>
>>                 >> Does the program run in your case?
>>                 >>
>>                 >> Thanks again
>>                 >>
>>                 >>
>>                 >>
>>                 >> Diego
>>                 >>
>>                 >>
>>                 >> On 8 January 2015 at 03:02, Gilles Gouaillardet <
>>                 >>
>>                 >>gilles.gouaillardet@iferc.__org
>>        <mailto:gilles.gouaillar...@iferc.org>
>>        <mailto:gilles.gouaillardet@__iferc.org
>>        <mailto:gilles.gouaillar...@iferc.org>>
>>                 >> > wrote:
>>                 >>
>>                 >>
>>                 >>>  Diego,
>>                 >>>
>>                 >>> my bad, i should have passed displacements(1) to
>>        MPI_Type_create_struct
>>                 >>>
>>                 >>> here is an updated version
>>                 >>>
>>                 >>> (note you have to use a REQUEST integer for
>>        MPI_Isend and MPI_Irecv,
>>                 >>> and you also have to call MPI_Wait to ensure the
>>        requests complete)
>>                 >>>
>>                 >>> Cheers,
>>                 >>>
>>                 >>> Gilles
>>                 >>>
>>                 >>>
>>                 >>> On 2015/01/08 8:23, Diego Avesani wrote:
>>                 >>>
>>                 >>> Dear Gilles, Dear all,
>>                 >>>
>>                 >>> I'm sorry to bother you again, but I have some
>>        problem with send and
>>                 >>> receive the struct_data.
>>                 >>>
>>                 >>> I tried to send a MPI_Type_Create_Struct but I get
>>        a segmentation fault
>>                 >>> occurred and I do not know why. The program is very
>>        simple, it is the old
>>                 >>> one with the isend and irecv subroutines
>>                 >>>
>>                 >>> (you can find it in the attachment)
>>                 >>>
>>                 >>> Thanks again
>>                 >>>
>>                 >>>
>>                 >>> Diego
>>                 >>>
>>                 >>>
>>                 >>> On 5 January 2015 at 15:54, Diego Avesani
>>                 >>> <diego.aves...@gmail.com
>>        <mailto:diego.aves...@gmail.com>
>>        <mailto:diego.avesani@gmail.__com <mailto:diego.aves...@gmail.com>>>
>>                 <diego.aves...@gmail.com
>>        <mailto:diego.aves...@gmail.com>
>>        <mailto:diego.avesani@gmail.__com <mailto:diego.aves...@gmail.com>>>
>>                 >>>  wrote:
>>                 >>>
>>                 >>>
>>                 >>>  Dear Gilles,
>>                 >>>
>>                 >>> Thanks, Thanks a lot.
>>                 >>> Now is more clear.
>>                 >>>
>>                 >>> Again, thanks a lot
>>                 >>>
>>                 >>> Diego
>>                 >>>
>>                 >>>
>>                 >>>
>>                 >>>
>>                 >>>
>>                 >>> _________________________________________________
>>                 >>> users mailing
>>                 >>>listus...@open-mpi.org
>>        <mailto:listus...@open-mpi.org> <mailto:listus...@open-mpi.org
>>        <mailto:listus...@open-mpi.org>__>
>>                 >>>
>>                 >>> Subscription:
>>                 >>>http://www.open-mpi.org/__mailman/listinfo.cgi/users
>>        <http://www.open-mpi.org/mailman/listinfo.cgi/users>
>>                 >>>
>>                 >>> Link to this post:
>> 
>>         
>> >>>http://www.open-mpi.org/__community/lists/users/2015/01/__26116.php 
>> <http://www.open-mpi.org/community/lists/users/2015/01/26116.php>
>>                 >>>
>>                 >>>
>>                 >>>
>>                 >>>
>>                 >>> _________________________________________________
>>                 >>> users mailing list
>>                 >>>
>>                 >>>us...@open-mpi.org <mailto:us...@open-mpi.org>
>>        <mailto:us...@open-mpi.org <mailto:us...@open-mpi.org>>
>>                 >>>
>>                 >>> Subscription:
>>                 >>>http://www.open-mpi.org/__mailman/listinfo.cgi/users
>>        <http://www.open-mpi.org/mailman/listinfo.cgi/users>
>>                 >>>
>>                 >>> Link to this post:
>>                 >>>
>> 
>>         
>> >>>http://www.open-mpi.org/__community/lists/users/2015/01/__26118.php 
>> <http://www.open-mpi.org/community/lists/users/2015/01/26118.php>
>>                 >>>
>>                 >>>
>>                 >>>
>>                 >>
>>                 >>
>>                 >> _________________________________________________
>>                 >> users mailing list
>>                 >>
>>                 >>us...@open-mpi.org <mailto:us...@open-mpi.org>
>>        <mailto:us...@open-mpi.org <mailto:us...@open-mpi.org>>
>>                 >>
>>                 >> Subscription:
>>                 >>http://www.open-mpi.org/__mailman/listinfo.cgi/users
>>        <http://www.open-mpi.org/mailman/listinfo.cgi/users>
>>                 >>
>>                 >> Link to this post:
>> 
>>         
>> >>http://www.open-mpi.org/__community/lists/users/2015/01/__26124.php 
>> <http://www.open-mpi.org/community/lists/users/2015/01/26124.php>
>>                 >
>>                 > _________________________________________________
>>                 > users mailing list
>>                 >us...@open-mpi.org <mailto:us...@open-mpi.org>
>>        <mailto:us...@open-mpi.org <mailto:us...@open-mpi.org>>
>>                 >
>>        Subscription:http://www.open-__mpi.org/mailman/listinfo.cgi/__users
>>        <http://www.open-mpi.org/mailman/listinfo.cgi/users>
>>                 > Link to this
>>        
>> post:http://www.open-mpi.org/__community/lists/users/2015/01/__26126.php
>>        <http://www.open-mpi.org/community/lists/users/2015/01/26126.php>
>> 
>> 
>>                 --
>>                 Jeff Squyres
>>        jsquy...@cisco.com <mailto:jsquy...@cisco.com>
>>        <mailto:jsquy...@cisco.com <mailto:jsquy...@cisco.com>>
>>                 For corporate legal information go to:
>>        http://www.cisco.com/web/__about/doing_business/legal/__cri/
>>        <http://www.cisco.com/web/about/doing_business/legal/cri/>
>> 
>> 
>>                 _________________________________________________
>>                 users mailing list
>>        us...@open-mpi.org <mailto:us...@open-mpi.org>
>>        <mailto:us...@open-mpi.org <mailto:us...@open-mpi.org>>
>>                 Subscription:
>>        http://www.open-mpi.org/__mailman/listinfo.cgi/users
>>        <http://www.open-mpi.org/mailman/listinfo.cgi/users>
>>                 Link to this post:
>>        http://www.open-mpi.org/__community/lists/users/2015/01/__26127.php
>>        <http://www.open-mpi.org/community/lists/users/2015/01/26127.php>
>> 
>> 
>> 
>>             _________________________________________________
>>             users mailing list
>>        us...@open-mpi.org <mailto:us...@open-mpi.org>
>>        <mailto:us...@open-mpi.org <mailto:us...@open-mpi.org>>
>>             Subscription:
>>        http://www.open-mpi.org/__mailman/listinfo.cgi/users
>>        <http://www.open-mpi.org/mailman/listinfo.cgi/users>
>>             Link to this post:
>>        http://www.open-mpi.org/__community/lists/users/2015/01/__26140.php
>>        <http://www.open-mpi.org/community/lists/users/2015/01/26140.php>
>> 
>> 
>> 
>> 
>>        _________________________________________________
>>        users mailing list
>>        us...@open-mpi.org <mailto:us...@open-mpi.org>
>>        Subscription:
>>        http://www.open-mpi.org/__mailman/listinfo.cgi/users
>>        <http://www.open-mpi.org/mailman/listinfo.cgi/users>
>>        Link to this post:
>>        http://www.open-mpi.org/__community/lists/users/2015/01/__26141.php
>>        <http://www.open-mpi.org/community/lists/users/2015/01/26141.php>
>> 
>> 
>>    _________________________________________________
>>    users mailing list
>>    us...@open-mpi.org <mailto:us...@open-mpi.org>
>>    Subscription: http://www.open-mpi.org/__mailman/listinfo.cgi/users
>>    <http://www.open-mpi.org/mailman/listinfo.cgi/users>
>>    Link to this post:
>>    http://www.open-mpi.org/__community/lists/users/2015/01/__26142.php
>>    <http://www.open-mpi.org/community/lists/users/2015/01/26142.php>
>> 
>> 
>> 
>> 
>> _______________________________________________
>> users mailing list
>> us...@open-mpi.org
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> Link to this post: 
>> http://www.open-mpi.org/community/lists/users/2015/01/26143.php
>> 
> 
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post: 
> http://www.open-mpi.org/community/lists/users/2015/01/26146.php

Reply via email to