Re: [OMPI users] MPI_BCAST and fortran subarrays

2011-12-16 Thread Jeff Squyres
A few points to add to this discussion... 1. In the new (proposed) MPI-3 Fortran bindings (i.e., the "use mpi_f08" module), array subsections will be handled properly by MPI. However, we'll have to wait for the Fortran compilers to support F08 features first (i.e., both the MPI Forum and the F

Re: [OMPI users] MPI_BCAST and fortran subarrays

2011-12-15 Thread Patrick Begou
Thanks all for your converging point of view about my problem. Portability is also an important point for this code so there is only one solution: using user defined data type. In my mind, this was more for C or C++ code without the fortran subarray behavior but I was in error. The problem is

Re: [OMPI users] MPI_BCAST and fortran subarrays

2011-12-14 Thread Gustavo Correa
When it comes to intrinsic Fortran-90 functions, or to libraries provided by the compiler vendor [e.g. MKL in the case of Intel], I do agree that they *should* be able to parse the array-section notation and use the correct memory layout. However, for libraries that are not part of Fortran-90, s

Re: [OMPI users] MPI_BCAST and fortran subarrays

2011-12-14 Thread David Warren
Actually, sub array passing is part of the F90 standard (at least according to every document I can find), and not an Intel extension. So if it doesn't work you should complain to the compiler company. One of the reasons for using it is that the compiler should be optimized for whatever method

Re: [OMPI users] MPI_BCAST and fortran subarrays

2011-12-14 Thread Gustavo Correa
Hi Patrick >From my mere MPI and Fortran-90 user point of view, I think that the solution offered by the MPI standard [at least up to MPI-2] to address the problem of non-contiguous memory layouts is to use MPI user-defined types, as I pointed out in my previous email. I like this solution becaus

Re: [OMPI users] MPI_BCAST and fortran subarrays

2011-12-14 Thread Patrick Begou
Thanks all for your anwers. yes, I understand well that it is a non contiguous memory access problem as the MPI_BCAST should wait for a pointer on a valid memory zone. But I'm surprised that with the MPI module usage Fortran does not hide this discontinuity in a contiguous temporary copy of the

Re: [OMPI users] MPI_BCAST and fortran subarrays

2011-12-12 Thread Edmund Sumbar
The interface to MPI_Bcast does not specify a assumed-shape-array dummy first argument. Consequently, as David points out, the compiler makes a contiguous temporary copy of the array section to pass to the routine. If using ifort, try the "-check arg_temp_created" compiler option to verify creation

Re: [OMPI users] MPI_BCAST and fortran subarrays

2011-12-12 Thread David Warren
What FORTRAN compiler are you using? This should not really be an issue with the MPI implementation, but with the FORTRAN. This is legitimate usage in FORTRAN 90 and the compiler should deal with it. I do similar things using ifort and it creates temporary arrays when necessary and it all works

Re: [OMPI users] MPI_BCAST and fortran subarrays

2011-12-12 Thread Gustavo Correa
Hi Patrick I think tab(i,:) is not contiguous in memory, but has a stride of nbcpus. Since the MPI type you are passing is just the barebones MPI_INTEGER, MPI_BCAST expects the four integers to be contiguous in memory, I guess. The MPI calls don't have any idea of the Fortran90 memory layout, and

[OMPI users] MPI_BCAST and fortran subarrays

2011-12-12 Thread Patrick Begou
I've got a strange problem with Fortran90 and MPI_BCAST call on a large application. I've isolated the problem in this short program samples. With fortran we can use subarrays in functions calls. Example, with passing a subarray to the "change" procedure: MODULE mymod IMPLICIT NONE CONTAINS S