Page 1 of 1

BLACS Initialisation Error

PostPosted: Tue Jul 24, 2007 9:35 am
by RostauGuardian
Hi all,

I am getting the following warning from each process when initialising a BLACS context/grid in my F90 code:

BLACS ERROR 'Users with C main programs must explicitly call MPI_Init'
from {-1,-1}, pnum=0, Contxt=-1, on line -1 of file 'SRC/MPI/blacs_pinfo_.c'.

I am getting this warning with both MPICH and MPICH2 on two different compilers (Portland and Pathscale).

These are the offending lines in the code with appropriately initialised variables (the error occurs after execution of the first line):

call blacs_get(0,0,context)
call blacs_gridinit(context,'Row',grid_rows,grid_columns)
call blacs_gridinfo(context,grid_rows,grid_columns,process_row,process_column)

Would love if someone can comment on what may be causing this problem.

Thanks in advance.....

PostPosted: Tue Jul 24, 2007 11:03 am
by Julie
RostauGuardian

Here is an example (hello world) that can help you understand what's wrong in your code: http://www.netlib.org/blacs/BLACS/Examples.html
It uses the same piece of code than you.

To compile it, just run the following command:
Code: Select all
mpif77 hello.f   %PATH TO BLACS LIB%/blacsF77init_MPI-LINUX-0.a  %PATH TO BLACS LIB%/blacs_MPI-LINUX-0.a %PATH TO BLACS LIB%/blacsF77init_MPI-LINUX-0.a

let me know if it helps
Julie

PostPosted: Tue Jul 24, 2007 6:30 pm
by RostauGuardian
Julie,

Thanks for the link. What I did notice was that in your compile line you don't refer to blacsCinit.a. For some reason in my link line I had this library. I got no warning at the linking stage but obviously this was the problem.

When I removed it and kept the blacsF77init.a solely then the orginal error went away. The reference to C program in the error now seems significant based on the link library I was using even though my code was an F90 code.

Thanks indirectly for your help.

Best Wishes.