PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Sizeof missing when compiling with mpif90
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
f.baart



Joined: 20 Jan 2011
Posts: 3

PostPosted: Fri Jan 28, 2011 7:15 am    Post subject: Sizeof missing when compiling with mpif90 Reply with quote

Hi,
I'm trying to compile a program that uses mpi with mpif90 from the portland group on OSX. I get the following error:

mpif90 -DUSEMPI -DHAVE_MPI_WTIME -g -o xbeach xbeach-xmpi.o xbeach-general_mpi.o [several .o files here .....] xbeach-xbeach.o
Undefined symbols:
"_mpi_sizeof0dl_", referenced from:
_L.350_34_0_1 in xbeach-xmpi.o
[..... several .o files here]

I get this error for the following symbols:
"_mpi_sizeof0dl_" <- logicals?
"_mpi_sizeof1dl_"
"_mpi_sizeof2dl_"
"_mpi_sizeof3dl_"
"_mpi_sizeof4dl_"
"_mpi_sizeof0dch_" <- complex?
"_mpi_sizeof1dch_"
"_mpi_sizeof2dch_"
"_mpi_sizeof3dch_"
"_mpi_sizeof4dch_"

I have one call to a sizeof function:
call MPI_Bcast(par,sizeof(par),MPI_BYTE,xmpi_master,xmpi_comm,ierror)
where par is of a derived type with quite a lot of variables (chars, reals, logicals) and a few pointers that are broadcasted separately.

I noticed that symbols like these are present in /opt/pgi/osx86-64/2011/mpi/openmpi/lib/libmpi_f90.a
I tried compiling with openmpi and gfortran and that works fine. Does anybody have a suggestion on how to solve this?

Kind regards,

Fedor
Back to top
View user's profile
hongyon



Joined: 19 Jul 2004
Posts: 551

PostPosted: Mon Jan 31, 2011 9:50 am    Post subject: Reply with quote

Hi,

We would need a simple program to show that. Can you provide us?
The precompiled OpenMPI that comes with PGI compiler is version 1.2.7. Perhaps it might be a bit old?

Hongyon
Back to top
View user's profile
f.baart



Joined: 20 Jan 2011
Posts: 3

PostPosted: Tue Feb 01, 2011 2:57 am    Post subject: simple example Reply with quote

I was able to simplify it to this example:

Code:

program testbcast
use mpi
implicit none

logical :: a
integer :: ierror, rank, size

a = .true.
call mpi_init(ierror)
call mpi_sizeof(a, size, ierror)
call mpi_finalize(ierror)
end program testbcast


This is the output I get.

    $ mpif90 ./testbc.F90
    ./testbc.F90:
    NOTE: your trial license will expire in 2 days, 13.6 hours.
    NOTE: your trial license will expire in 2 days, 13.6 hours.
    Undefined symbols:
    "_mpi_sizeof0dl_", referenced from:
    _MAIN_ in testbc.o
    ld: symbol(s) not found


The mpi_sizeof functions are made by the mpi_sizeof.f90.sh script in openmpi. I tested this program also with openmpi 1.5 from macports + gfortran 4.4 and that gives the same error.
Back to top
View user's profile
hongyon



Joined: 19 Jul 2004
Posts: 551

PostPosted: Tue Feb 01, 2011 11:52 am    Post subject: Reply with quote

Hi,

This might be a bug in OpenMPI. There is an interface for mpi_sizeof for logical but the mpi_sizeof.f90.sh does not create a routine because lkinds is not there in fortran_kinds.sh.

A workaround is to use mpi_type_size.

call mpi_type_size(MPI_LOGICAL, size, ierror)


You mentioned in the first post that you have used gfortran to compile Openmpi and that works for you. Which version of OpenMPI? On Mac OSX?

Hongyon
Back to top
View user's profile
f.baart



Joined: 20 Jan 2011
Posts: 3

PostPosted: Wed Feb 02, 2011 5:25 am    Post subject: mpi_sizeof with logicals Reply with quote

hongyon wrote:
Hi,
You mentioned in the first post that you have used gfortran to compile Openmpi and that works for you. Which version of OpenMPI? On Mac OSX?


This simple example I made does not work for gfortran 4.4 + openmpi 1.5 +gcc44 (build with macports). My original code works with gfortran + openmpi but I don't call the mpi_sizeof directly. I think it's called by some mpi subroutine that I call with a derived type with a logical, or with a logical.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group