ScaLAPACK Archives

[Scalapack] Bug in BLACS with return datatypes

Hey Julie :) 

The following patch solves the bug with Open MPI. It is following the "legacy" 
practice of redeclaring function prototypes every time they are used in another 
.c file.


Index: BLACS/SRC/blacs_map_.c
===================================================================
--- BLACS/SRC/blacs_map_.c      (revision 193)
+++ BLACS/SRC/blacs_map_.c      (working copy)
@@ -7,7 +7,7 @@
                            int *npcol0)
 #endif
 {
-
+   MPI_Comm Cblacs2sys_handle(int BlacsCtxt);
    MPI_Comm BI_TransUserComm(int, int, int *);
 
    int info, i, j, Iam, *iptr;


Aurelien 



Le 29 juil. 2013 ? 12:32, julie langou <julie@Domain.Removed> a ?crit :

Thank you very much Aurelien for reporting the problem.
Solution 3 seems to be the most appropriate indeed.We are going to add it to 
our "to-do" list.
If you could me send the patch, I would apply it in our repository as a 
temporary fix
Regards,
Julie
On Jul 25, 2013, at 7:44 AM, Aur?lien Bouteiller <bouteill@Domain.Removed> 
wrote:

Hey guys, 

I think I found an original 1996 bug :)

The following functions in BLACS return a "non integer" datatype. Now the 
problem is that BLACS doesn't have a .h file, so basically all functions are 
automatically inferred to be "int func(int)". This has worked in the past 
because most of the time the returned datatype was int compatible. This is 
not the case anymore (in particular in Open MPI, MPI_Comm is a pointer 
(64bit) and therefore doesn't fit in a 32bit int.

MPI_Datatype GetMpiGetType()
MPI_Datatype GetMpiGetType()
MPI_Comm Cblacs2Sys_handle()
double Cdwalltime00() 

There are several possible course of action from there.
1. Have all functions have a prototype in Bdef.h, that would solve all the 
bugs internal to Scalapack, but would still leave users vulnerable.
2. Change the prototypes so that instead of return values, they are passed 
as pointer arguments. Could break backward compatibility.
3. Have Blacks/Scalapack show a full .h API file to users (in a sense, a 
public Bdef.h) 


I have done the Bdef.h fix. If you are interested I can contribute it. 

Aurelien 

--
* Dr. Aur?lien Bouteiller
* Researcher at Innovative Computing Laboratory
* University of Tennessee
* 1122 Volunteer Boulevard, suite 309b
* Knoxville, TN 37996
* 865 974 9375







_______________________________________________
Scalapack mailing list
Scalapack@Domain.Removed
http://lists.eecs.utk.edu/mailman/listinfo/scalapack


--
* Dr. Aur?lien Bouteiller
* Researcher at Innovative Computing Laboratory
* University of Tennessee
* 1122 Volunteer Boulevard, suite 309b
* Knoxville, TN 37996
* 865 974 9375








<Prev in Thread] Current Thread [Next in Thread>


For additional information you may use the LAPACK/ScaLAPACK Forum.
Or one of the mailing lists, or