Path: utzoo!utgpu!cunews!cognos!jimp From: jimp@cognos.UUCP (Jim Patterson) Newsgroups: comp.sys.hp Subject: Re: Problem using shared memory on a HP 9000/720... Message-ID: <9623@cognos.UUCP> Date: 8 May 91 13:20:45 GMT References: <48580026@hpcupt3.cup.hp.com> Reply-To: jimp@cognos.UUCP (Jim Patterson) Organization: Cognos Inc., Ottawa, Canada Lines: 52 In article <48580026@hpcupt3.cup.hp.com> dhandly@hpcupt3.cup.hp.com (Dennis Handly) writes: >I'm not sure if there are any good solutions except passing the address >of the shared common from C directly to Fortran. Another solution here might be to modify the definition of the common area 'aap' from your example so that it's in the third quadrant (where shared memory is allocated) rather than the first (where data variables normally reside). You can do this at the assembly level. E.g. if you compile server to a .s file via f77 -S server.f then you can change the definition of aap as follows (context diff follows). The "QUAD=3" specification locates this area in the third 'quadrant', so it's in the same 'segment' as the shared memory area allocated by the C program. Ideally, you would want to do this once and reference it as an extern in each fortran module that needs it, but I don't think the fortran compiler works that way. The other alternative would be to edit each fortran assembly file as below (I know, Yuch!). It appears to work though. *** server.s Wed May 8 09:10:09 1991 --- server.s-changed Wed May 8 09:08:21 1991 *************** *** 189,196 **** .SPACE $TEXT$ .SUBSPA $CODE$ .EXPORT produce,PRIV_LEV=3 ! .SPACE $PRIVATE$ ! .SUBSPA $DATA$ aap .COMM 40 .SPACE $TEXT$ .SUBSPA $CODE$ --- 189,196 ---- .SPACE $TEXT$ .SUBSPA $CODE$ .EXPORT produce,PRIV_LEV=3 ! .SPACE $PRIVATE_SHARED$ ! .SUBSPA $SHARED$,QUAD=3,ALIGN=8,ACCESS=31 aap .COMM 40 .SPACE $TEXT$ .SUBSPA $CODE$ --------------------- -- Jim Patterson Cognos Incorporated UUCP:uunet!mitel!cunews!cognos!jimp P.O. BOX 9707 PHONE:(613)738-1440 x6112 3755 Riverside Drive Ottawa, Ont K1G 3Z4