[mvapich-discuss] mvapich2-1.2-2009-03-17 compilation issue

Yaakoub El Khamra yye00 at tacc.utexas.edu
Thu Mar 19 15:53:40 EDT 2009


My fix for now is using --enable-g=handle,dbg,log  but I full intend
to get it to work with MPIU_Malloc/Free malloc and free. It would be
easier to detect memory leaks that way.  Thank you for pointing out
the coding standards page, it will come in handy.


Regards
Yaakoub El Khamra




On Thu, Mar 19, 2009 at 2:21 PM, Pavan Balaji <balaji at mcs.anl.gov> wrote:
>
> The correct fix to this is for the MVAPICH2 code to use MPIU_ routines
> rather than malloc/free directly. Basically, MPICH2 provides wrapper
> functions that allow it to do memory allocation and usage debugging,
> that are enabled when you do --enable-g=mem or meminit (when you do
> --enable-g=all, everything is added).
>
> Just replacing malloc and free with MPIU_Malloc/MPIU_Free should be OK,
> but there are better macros available too:
> http://wiki.mcs.anl.gov/mpich2/index.php/Coding_Standards#Memory_Allocation_in_MPICH2.
>
> As a short term fix, you can just disable memory debugging hooks. There
> are other useful ones too: dbg, log, handle, handlealloc, etc (you can
> just look in the top-level configure.in and search for --enable-g).
>
>  -- Pavan
>
> Yaakoub El Khamra wrote:
>> I am trying to compile mvapich2-1.2-2009-03-17 (from tarball) with the
>> following options:
>>  ./configure --prefix=/work/01125/yye00/DebugStack/latest_mvapich2_install/
>> --enable-error-checking=all --enable-error-messages=all
>> --enable-timing-level=all --enable-g=all --enable-debuginfo
>> --enable-threads=single CC=icc CXX=icpc F77=ifort F90=ifort
>> --with-ib-libpath=/opt/ofed/lib64/
>> --with-ib-include=/opt/ofed/include/
>>
>> This cause the following error:
>> ch3u_rma_sync.c(205): warning #1899: multicharacter character literal
>> (potential portability problem)
>>           int *ranks_in_win_grp = (int *) malloc((comm_size - 1) * sizeof(int));
>>                                           ^
>>
>> ch3u_rma_sync.c(205): error: expected a ";"
>>           int *ranks_in_win_grp = (int *) malloc((comm_size - 1) * sizeof(int));
>>                                           ^
>>
>> ch3u_rma_sync.c(233): warning #1899: multicharacter character literal
>> (potential portability problem)
>>           free(ranks_in_win_grp);
>>           ^
>>
>> ch3u_rma_sync.c(233): error: expected a ";"
>>           free(ranks_in_win_grp);
>>
>>
>> On further investigation, it seems that the preprocessing step is
>> where this breaks down. Malloc seems to be defined as: 'Error use
>> MPIU_Malloc' :::; and similarly free is defined as: 'Error use
>> MPIU_Free' :::;
>>
>> These #defines are in src/include/mpimem.h which manages to find its
>> way into the ch3u_rma_sync.c . Is there a way to guard against this?
>> Should I be using different configuration flags?
>> Thanks in advance.
>>
>>
>>
>>
>> Regards
>> Yaakoub El Khamra
>> _______________________________________________
>> mvapich-discuss mailing list
>> mvapich-discuss at cse.ohio-state.edu
>> http://mail.cse.ohio-state.edu/mailman/listinfo/mvapich-discuss
>
> --
> Pavan Balaji
> http://www.mcs.anl.gov/~balaji
>



More information about the mvapich-discuss mailing list