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.�
Let say that particles are of type particle_t:
type particle_t
����� integer :: host, id,...
����� real,pointer :: data(:)=>null()
end type particle_t
I built two corresponding mpi types, one with data allocated,
mpi_particles_t,
and
mpi_particles_null_t, when p%data=>null().
What I want to do is the following:
- �All processes allocates an array of type particles_t for all
particles, but data is allocated only if a particle is
assigned to� the domain:
��� ��� ���
allocate(A(tot_num_particles))
��� ��� ������ do n=1,tot_num_particles
�� ��� ��� �� ���� if ( particle(n)%host == myid) ��
allocate(particle(n)%data(data_size))
��������������� enddo
��� 2. All processes create their mpi data type mpi_A_t:
������
do n=1,tot_num_particles
��� ������� if ( particle(n)%host ==
myid)� then��
����������������� blockcounts(n) = 1 ; oldtypes(n) =
mpi_particles_t
���������� �� else �
��� ��� ��� ����� blockcounts(n) = 1 ; oldtypes(n) =
mpi_particles_null_t
��� ����
� endif
����������� call MPI_GET_ADDRESS(A(n), offsets(n), ierr)
������� enddo
��� ��
call mpi_type_create_struct(tot_num_particles,blockcounts,offsets,oldtypes,mpi_A_myid_t,ierr)
����� � call mpi_type_commit(mpi_A_myid_t,ierr)
��� ���
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.
Thanks in advance,
--Ted
On 05/22/2014 03:31 PM, Ted Sariyski wrote: