[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GEMPAK #OUP-365834]: GEMPAK - message queue problem



Mark,

You will need your gpend call within the drawMap.tst script where gpmap is
executed.

It works interactively because both are being executed by the same controlling
terminal, but not when outside of a terminal.

If you have 3 layers to draw, then your script should do all 3 in one shot.

Steve Chiswell
Unidata User Support

> Hi Steve,
> 
> I have reduced the problem to the files attached.  "decode_bufr.tst"
> runs the script drawMap.tst which executes gpmap once.
> Then decode_bufr.tst executes gpend.
> 
> The queues aren't closed and gplt continues to run.  Here is some screen
> capture:
> 
> ------ Message Queues PIDs --------
> msqid      owner      lspid      lrpid
> 8388608  mhughes     15730     15729
> 8454145  mhughes     15732     15730
> 
> [mhughes@pcmhughes1 bufrfiles]$ ps -eaf | grep gplt
> mhughes  15730     1  0 22:48 ?        00:00:00 gplt
> mhughes  15739  5292  0 22:48 pts/2    00:00:00 grep gplt
> 
> So, this is a minimal example (gplt followed by gpend) and it still
> fails.  Do you see a solution?
> 
> Thanks,
> 
> Mark
> 
> 
> Unidata GEMPAK Support wrote:
> 
> >Mark,
> >
> >It sounds like you are spawning a separate csh process for each part of your 
> >chart,
> >so the parent process of the gpmap is changing. That could be the problem
> >with your gpend not closing the queue, and overlays failing as well.
> >
> >If this is the case, its probably best for your program to generate all the 
> >layers
> >of your plot as input lines to the gpmap invocation, and then with a single 
> >invocation
> >of the csh script, create the postscript output file.
> >
> >I do have a programs_ps target in the gpmap Makefile to build a version of 
> >gpmap
> >that bypasses the gplt. But again you would want to do all the layers in
> >a single system call.
> >
> >Steve Chiswell
> >Unidata User Support
> >
> >
> >
> >
> >
> >>Hi,
> >>
> >>Here is the error:
> >>Error in message send = 22
> >>
> >>I am drawing a significant weather chart.  Each of the features is drawn
> >>with a seperate call to gpmap.
> >>I am producing a postscript file.
> >>When I look at the ipc message queue stats, I see that the queues are
> >>not being released.  I suspect that
> >>I hit an OS limit and further sends fail.  My guess is that gpend
> >>doesn't use the same queue as gpmap.
> >>
> >>Maybe the routines you mention below will help.  Otherwise, I might
> >>modify GEMPAK to force the use of
> >>parent PID. or even to always use the same queue.
> >>
> >>Mark
> >>
> >>Unidata GEMPAK Support wrote:
> >>
> >>
> >>
> >>>Mark,
> >>>
> >>>There are no flags for a program to run in batch mode- a controlling 
> >>>terminal or
> >>>lack thereof is determined in the routines.
> >>>
> >>>You didn't mention what errors you were seeing, but make sure that if you 
> >>>are running
> >>>to create a XW, GF, PS display that required contacting an X server, the 
> >>>environment from
> >>>within the spawned shell has the display access, as well as the full 
> >>>GEMPAK environment.
> >>>
> >>>Also, you may be able to utilize the gpmap_gf or gpmap_xw etc. to 
> >>>eliminate the message queues
> >>>if you don't require separate program runs for overlays.
> >>>
> >>>Steve Chiswell
> >>>Unidata User SUpport
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>Institution: Global Weather Dynamics
> >>>>Package Version: GEMPAK5.8.3a
> >>>>Operating System: Linux
> >>>>Hardware Information: HP Pavillion Desktop
> >>>>Inquiry: Hi,
> >>>>
> >>>>My application runs fine from a shell script.
> >>>>I call gpmap a number of times and then call gpend.
> >>>>I have a problem when I launch the c-shell script from a java program 
> >>>>(the java program executes /bin/csh with the script as an argument).  I 
> >>>>see comments which indicate that there are two ways to determine the 
> >>>>message queue ID in the function "cgetmq.c".  It looks like I need to 
> >>>>force the program into "batch mode".
> >>>>
> >>>>Is there a parameter which I can set somewhere, or is it always detected 
> >>>>by isatty?
> >>>>
> >>>>Any suggestions would be greatly appreciated.
> >>>>
> >>>>Mark Hughes
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>Ticket Details
> >>>===================
> >>>Ticket ID: OUP-365834
> >>>Department: Support GEMPAK
> >>>Priority: Normal
> >>>Status: Closed
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >Ticket Details
> >===================
> >Ticket ID: OUP-365834
> >Department: Support GEMPAK
> >Priority: Normal
> >Status: Closed
> >
> >
> >
> 
> 
> # usage: decode_bufr YYMMDD HHMM [18|24] areaText GAREA PROJ
> if (!($?NAWIPS)) then
> echo "FAIL"
> exit
> endif
> 
> if (!($?GEMPAK)) then
> source $NAWIPS/Gemenviron
> endif
> 
> cd $NAWIPS/gempak/data/sigwx/bufrfiles
> 
> # draw the maps
> 
> #Hi-level chart...
> set mapName=$5$1$2-HI.ps
> drawMap.tst ps $mapName $5 $6
> 
> $NAWIPS/bin/linux/gpend
> echo SUCCESS
> # usage: drawMap DEVICE plotName GAREA PROJECTION
> 
> # draw the map
> 
> gpmap << EOF
> PROJ   =  $4
> GAREA  =  $3
> MAP        =  1
> SATFIL         =
> RADFIL         =
> IMCBAR         =
> LATLON         =  2/10/1/1/10;10
> PANEL  =  0
> TITLE  =
> TEXT   =  1
> CLEAR  =  yes
> DEVICE         =  $1 | $2
> LUTFIL   =
> STNPLT   =
> VGFILE         =
> AFOSFL         =
> AWPSFL         =
> LINE   = 17
> WATCH    =
> WARN     =
> HRCN     =
> ISIG     =
> LTNG     =
> ATCF     =
> AIRM     =
> NCON     =
> CSIG     =
> SVRL     =
> WSTM   =
> WOU      =
> WCN      =
> WCP      =
> ENCY     =
> RUN
> MSCALE   = 0
> 
> e
> EOF
> 
> 


Ticket Details
===================
Ticket ID: OUP-365834
Department: Support GEMPAK
Priority: Normal
Status: Closed