Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Scope of MPI derived data types in MPI_COMM_WORLD
From: George Bosilca (bosilca_at_[hidden])
Date: 2008-07-28 19:55:37


On Jul 28, 2008, at 11:12 PM, Jitendra Kumar wrote:

> Hi,
> While working with multiple file source codes, what is the scope of
> the
> MPI derived data types.
> - I am trying to declare a derived data type for a complex struct
> containing dynamic arrays in main() function in a C code.
> - In a different function located in a seperate file, I am trying to
> use
> the data type for sending a struct using MPI_Send. The corresponding
> receive is again in a separate function which may or may not exist in
> the same file.
> However, it throws as error as it doesn't knows the declared data type
> outside main( ). How should the data type be declared to have it's
> scope
> anywhere in the code ?

It should be declared as a global. However, this is not a data-type
specific thing, it's a classical symbol visibility problem in C.

> Is any derived data type declared valid anywhere in MPI_COMM_WORLD ?

Absolutely not and it will not be on the foreseeable future. I think
you kind of mix the concept of variable visibility with the concept of
comm_world in MPI. They do not have anything in common.

   george.

>
>
> Thanks,
> Jitendra
>
> --
> Jitendra Kumar
> Doctoral Student
> Department of Civil, Construction and Environmental Engineering
> North Carolina State University
> Raleigh, NC 27695
> jkumar_at_[hidden]
> http://www4.ncsu.edu/~jkumar
>
>
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users



  • application/pkcs7-signature attachment: smime.p7s