[mvapich-discuss] mvapich2-1.2-2009-03-17 compilation issue
Pavan Balaji
balaji at mcs.anl.gov
Thu Mar 19 15:21:59 EDT 2009
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