<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">I need a little bit more help. My
question relates to the structure of the array (referred below as
A), for which a window object will be created. <br>
<br>
Let say that particles are of type particle_t:<br>
<br>
type particle_t<br>
integer :: host, id,...<br>
real,pointer :: data(:)=>null()<br>
end type particle_t<br>
<br>
I built two corresponding mpi types, one with data allocated, <i>mpi_particles_t</i>,
and <i>mpi_particles_null_t</i>, when p%data=>null().<br>
<br>
What I want to do is the following:<br>
<ol>
<li> All processes allocates an array of type particles_t for <b>all</b>
particles, but data is allocated only if a particle is
assigned to the domain:</li>
</ol>
<i><small>allocate(A(tot_num_particles))<br>
do n=1,tot_num_particles<br>
if ( particle(n)%host == myid)
allocate(particle(n)%data(data_size))<br>
enddo</small></i><br>
<br>
2. All processes create their mpi data type mpi_A_t:<br>
<br>
<big></big><i><small>do n=1</small></i><i>,</i><i><small>tot_num_particles</small></i><i><br>
<br>
</i><i><small> <big> <small>if ( particle(n)%host ==
myid) then </small></big></small></i><i><br>
</i><i><small> blockcounts(n) = 1 ; oldtypes(n) =
mpi_particles_t</small></i><i><br>
</i><i><small> else </small></i><i><br>
</i><i><small> blockcounts(n) = 1 ; oldtypes(n) =
mpi_particles_null_t</small></i><i><br>
</i> <small><i> endif</i></small><br>
<i><small> call MPI_GET_ADDRESS(A(n), offsets(n), ierr)</small></i><i><br>
</i><i><small> enddo</small></i><br>
<br>
<small><i>call mpi_type_create_struct(</i><i><small>tot_num_particles</small></i><i>,blockcounts,offsets,oldtypes,mpi_A_myid_t,ierr)</i><i><br>
</i><i> call mpi_type_commit(mpi_A_myid_t,ierr)<br>
<br>
</i><big>I gave a try but it fails. Before I proceed I want to
make sure that there is nothing fundamentally wrong with this
approach. Besides, even if it is correct, I am not sure that
this is the 'best' solution. I will highly appreciate your
comments.<br>
<br>
Thanks in advance,<br>
--Ted<br>
</big><i><br>
</i><i></i></small><br>
<br>
<br>
<br>
On 05/22/2014 03:31 PM, Ted Sariyski wrote:<br>
</div>
<blockquote cite="mid:537E50A8.4060303@craft-tech.com" type="cite">I
see. Thanks a lot.
<br>
--Ted
<br>
<br>
<br>
On 05/22/2014 03:15 PM, Rajeev Thakur wrote:
<br>
<blockquote type="cite">
<blockquote type="cite">What do you mean with: "Why can’t all
processes open one large window?" I guess I miss something.
<br>
</blockquote>
If each process has an array of objects that belong to it
(called array A say) , then with a single call to MPI_Win_create
you can create a window object that has everyone's A arrays in
it.
<br>
<br>
Rajeev
<br>
<br>
<br>
<br>
On May 22, 2014, at 9:46 AM, Ted Sariyski
<a class="moz-txt-link-rfc2396E" href="mailto:tsariysk@craft-tech.com"><tsariysk@craft-tech.com></a> wrote:
<br>
<br>
<blockquote type="cite">It is about MPI_win. Here is the problem
as it relates to MPI (it is a Boltzmann type equation).
<br>
<br>
There are N particles interacting with each other. Interaction
is directional, so that a particle interacts only with those
particles, which are within a narrow cone. The first step is
to segregate the initial set of N particles into subsets of
particles (I called it 'objects'), which interact with each
other. Here is what I do:
<br>
• Assign each object to a process.
<br>
• The process which owns a object:
<br>
• Makes a guess for the maximum number of particles
expected in this object.
<br>
• Allocates memory for it.
<br>
• Opens a shared window.
<br>
• All processes
<br>
• Each particle identify which object it belongs to,
and PUTs its data there.
<br>
• After assembly is done, objects are passed to a solver.
<br>
• Repeat
<br>
What do you mean with: "Why can’t all processes open one large
window?" I guess I miss something.
<br>
Thanks,
<br>
--Ted
<br>
<br>
<br>
On 05/21/2014 11:03 PM, Balaji, Pavan wrote:
<br>
<blockquote type="cite">On May 21, 2014, at 6:02 PM, Ted
Sariyski <a class="moz-txt-link-rfc2396E" href="mailto:tsariysk@craft-tech.com"><tsariysk@craft-tech.com></a>
<br>
wrote:
<br>
<br>
<blockquote type="cite">Memory limitations. With one large
window all processes have to allocate memory for the
objects they own as well as for objects assigned to other
process.
<br>
<br>
</blockquote>
Are we talking about the same thing here? I’m referring to
an MPI_Win. What objects do processes need to keep track
of?
<br>
<br>
— Pavan
<br>
<br>
_______________________________________________
<br>
discuss mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:discuss@mpich.org">discuss@mpich.org</a>
<br>
<br>
To manage subscription options or unsubscribe:
<br>
<br>
<a class="moz-txt-link-freetext" href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a>
<br>
</blockquote>
_______________________________________________
<br>
discuss mailing list <a class="moz-txt-link-abbreviated" href="mailto:discuss@mpich.org">discuss@mpich.org</a>
<br>
To manage subscription options or unsubscribe:
<br>
<a class="moz-txt-link-freetext" href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a>
<br>
</blockquote>
_______________________________________________
<br>
discuss mailing list <a class="moz-txt-link-abbreviated" href="mailto:discuss@mpich.org">discuss@mpich.org</a>
<br>
To manage subscription options or unsubscribe:
<br>
<a class="moz-txt-link-freetext" href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a>
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</body>
</html>