[Nek5000-users] Sharing parameters between processors
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Mon Nov 30 16:37:26 CST 2015
Indeed, common blocks only work with the local memory. The easiest way
is, if it is only a few parameters, that you put them into the rea file
in the unused section (say about index 120 or so). Then the values are
immediately available on each processor.
Otherwise you have to do explicit communication. The starting point
would be the broadcast operation, bcast(buf,len), which shares len reals
stored on process 0 with all other processes. bcast is a wrapper to the
standard MPI function
call mpi_bcast (buf,len,mpi_byte,0,nekcomm,ierr)
Hope this helps,
Philipp
On 2015-11-30 23:31, nek5000-users at lists.mcs.anl.gov wrote:
> Hi Nekers,
>
> In my current simulation, I am defining an array containing parameters
> that are shared between several processors. I have tried to do this in
> the usercheck subroutine, with a COMMON statement. However, the COMMON
> statement enables saving the parameters between two successive calls of
> the usercheck by the same processor, but does not enable to share a
> variable between two processor. In other words, if I modify the variable
> a on the processor 1, the variable a on the processor 2 will not be
> modified, which is not what I want. Any idea on how to do that?
>
> Thanks for your help,
>
> Oscar Valdorez
>
>
>
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>
More information about the Nek5000-users
mailing list