Thanks for the info. I am using mkstemp() when a shared memory segment is created and with the latest changes in Nemesis I guess only one proc creates the shm segment.
Regards,
Jayesh
-----Original Message-----
From: mpich2-core-bounces@mcs.anl.gov [mailto:mpich2-core-bounces@mcs.anl.gov] On Behalf Of Anthony Chan
Sent: Friday, October 31, 2008 2:38 PM
To: mpich2-core@mcs.anl.gov
Subject: Re: [mpich2-core] Implicit decl warning with "-ansi"+"-Wall" option
BTW, make sure you are not calling mkstemp() in every MPI process.
mkstemp() opens a file to check if the temporary file is unique.
Imagine what will happen if a 32K-process job calls mkstemp() by every process on a common file system.... MPE got bitten by this once when it was first tested on BGW, it crashed/hung GPFS...
----- "Anthony Chan" <chan@mcs.anl.gov> wrote:
> The gcc compiler options swallow the mkstemp declaration.
> MPICH2 or MPE's configure checks for mkstemp declaration (and other
> common libc functions) to see if it exists (especially when
> --enables-strict is used) If not, the configure will insert mkstemp
> declaration.
>
> ----- "Jayesh Krishna" <jayesh@mcs.anl.gov> wrote:
>
> > Hi,
> >
> > =========================================
> > #include <stdlib.h>
> >
> > /* extern int mkstemp(char *); */
> > int main(int argc, char *argv[]){
> > int fd = -1;
> > char template[] = "temp_XXXXXX";
> > fd = mkstemp(template);
> > return 0;
> > }
> > =========================================
> >
> > The code above gives me the following warning when compiled with
> > "-Wall" & "-ansi" option with gcc,
> >
> > =========================================
> > shakey:/sandbox/jayesh/Enhancements/NemesisOnWindows/testPgms> gcc
> > -ansi -Wall test.c
> > test.c: In function â?~mainâ?T:
> > test.c:7: warning: implicit declaration of function â?~mkstempâ?T
> > =========================================
> >
> > Any ideas ?
> >
> > -Jayesh