Re: Shared memory handling for mixed C/FORTRAN program

2015-04-14 Thread Corinna Vinschen
On Apr 13 11:00, Christoph Weise wrote: > > > > The problem is the call to shmget: > > > > #undef PAGESIZE > > #define PAGESIZE 512 > > shmid = shmget(key, PAGESIZE, IPC_ALLOC); > > > > Since you're requesting only 512 bytes, the shared memory segment the > > following shmat call returns

Re: Shared memory handling for mixed C/FORTRAN program

2015-04-13 Thread Christoph Weise
> The problem is the call to shmget: > > #undef PAGESIZE > #define PAGESIZE 512 > shmid = shmget(key, PAGESIZE, IPC_ALLOC); > > Since you're requesting only 512 bytes, the shared memory segment the > following shmat call returns is only 4K. The shmget call should request > as much memor

Re: Shared memory handling for mixed C/FORTRAN program

2015-04-12 Thread Corinna Vinschen
On Apr 12 13:23, Corinna Vinschen wrote: > On Apr 11 20:25, Christoph Weise wrote: > > Please see below, I provide minimal C code for three separate > > executables, one creates the shm section, another finds it, the third > > removes it. I include also a bash test script that executes the > > rout

Re: Shared memory handling for mixed C/FORTRAN program

2015-04-12 Thread Corinna Vinschen
On Apr 11 20:25, Christoph Weise wrote: > Please see below, I provide minimal C code for three separate > executables, one creates the shm section, another finds it, the third > removes it. I include also a bash test script that executes the > routines in order. Thanks, > Please beware as I remov

Re: Shared memory handling for mixed C/FORTRAN program

2015-04-11 Thread Christoph Weise
>On Apr 10 22:20, Christoph Weise wrote: >> >PAGESIZE on Cygwin is not 1024, and the right value to use for >> >XSI SHM is SHMLBA (== 64K on Cygwin) >> >> Setting PAGESIZE to SHMLBA creates problems elsewhere in the program >> (then PAGESIZE is too big for the program to handle, a problem I have >

Re: Shared memory handling for mixed C/FORTRAN program

2015-04-11 Thread Corinna Vinschen
On Apr 10 22:20, Christoph Weise wrote: > >PAGESIZE on Cygwin is not 1024, and the right value to use for > >XSI SHM is SHMLBA (== 64K on Cygwin) > > Setting PAGESIZE to SHMLBA creates problems elsewhere in the program > (then PAGESIZE is too big for the program to handle, a problem I have > yet t

Re: Shared memory handling for mixed C/FORTRAN program

2015-04-10 Thread Christoph Weise
Thanks for your help, your suggestions have helped me greatly but I'm still stuck. >> I am porting to cygwin a program in FORTRAN/C that relies on C >> routines to create a shared memory region allowing various independent >> FORTRAN routines to share data. Program compiles and runs ok on L

Re: Shared memory handling for mixed C/FORTRAN program

2015-04-09 Thread Corinna Vinschen
On Apr 8 11:49, Christoph Weise wrote: > I am porting to cygwin a program in FORTRAN/C that relies on C > routines to create a shared memory region allowing various independent > FORTRAN routines to share data. Program compiles and runs ok on Linux > with g77/gcc compilers. I am compiling on cygwi

Re: Shared memory handling for mixed C/FORTRAN program

2015-04-08 Thread Marco Atzeri
On 4/8/2015 1:49 PM, Christoph Weise wrote: I am porting to cygwin a program in FORTRAN/C that relies on C routines to create a shared memory region allowing various independent FORTRAN routines to share data. Program compiles and runs ok on Linux with g77/gcc compilers. I am compiling on cy

Shared memory handling for mixed C/FORTRAN program

2015-04-08 Thread Christoph Weise
I am porting to cygwin a program in FORTRAN/C that relies on C routines to create a shared memory region allowing various independent FORTRAN routines to share data. Program compiles and runs ok on Linux with g77/gcc compilers. I am compiling on cygwin 1.7.33-2(0.280/5/3)with gfortran/gcc (4.8.3