[GE users] semaphore leftovers

Reuti reuti at staff.uni-marburg.de
Thu Feb 10 15:37:49 GMT 2005


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some special characters may be displayed incorrectly. ]

Proof of concept:

You find a small code snippet (no error checking etc.) to create a logfile of 
all the semget()s during a job for dynamically linked applications. Compiled 
with:

gcc -shared -o ipc_wrapper.so ipc_wrapper.c -ldl -lc

Loaded in the .bashrc with:

export LD_PRELOAD=/home/reuti/ipc_wrapper/ipc_wrapper.so

After the job a loop in stop_proc_args over all the used nodes (well, rsh must 
be used here as qrsh is no longer allowed), and using the local $TMPDIR on the 
node (which reflects the nodename) all of the stuff belonging to this job could 
be deleted.

The demo is only for semaphores, just as a test.

Is this an idea to be further followed? - Reuti

 

Quoting John Hearns <john.hearns at streamline-computing.com>:

> On Wed, 2005-02-09 at 18:38 -0600, David Farrell wrote:
> 
> > > But instead of a cron job, the cleanipcs could be put in the 
> > > stop_proc_args or
> > > queue_epilog.
> > Yes this is MPICH, I will give this bit a try. The issue here is that 
> > the users tend to use ctrl-C sorts to kill a job when running in 
> > interactive mode, 
> David,
>     there is a simple solution to this.
> It involves cutting off the left thumb and fourth finger of offending
> users.
> 
> 
> Seriously though, putting some sort of cleanipcs script in the stop_proc
> is a good idea.
> I looked at this briefly myself.
> As I recall, the problem I found was that you can deal with the shared
> memory segments. Either you can parse the output of ipcs -m
> or grep /proc/sysvipc/shm 
> and delete the relevant segments.
> 
> The problem I found was the semaphore queues, which you can't associate
> with a particular process ID.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
> For additional commands, e-mail: users-help at gridengine.sunsource.net
> 




    [ Part 2, Text/PLAIN (Name: "ipc_wrapper.c") ~831 bytes. ]
    [ Unable to print this part. ]


    [ Part 3: "Attached Text" ]

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net



More information about the gridengine-users mailing list