[LON-CAPA-cvs] cvs: loncom /debugging_tools delete_semaphores_shmemesesg.pl

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 13 Jan 2003 21:23:50 -0000


albertel		Mon Jan 13 16:23:50 2003 EDT

  Added files:                 
    /loncom/debugging_tools	delete_semaphores_shmemesesg.pl 
  Log:
  - commiting Martin Seigerts delete shared memeory scripts
    - fixes the 
  
  Starting httpd: Ouch! ap_mm_create(1048576, "/var/run/httpd.mm.8000") failed
  Error: MM: mm:core: failed to acquire semaphore (No space left on device): OS: Invalid argument
  
  error message
  
  

Index: loncom/debugging_tools/delete_semaphores_shmemesesg.pl
+++ loncom/debugging_tools/delete_semaphores_shmemesesg.pl
#!/usr/bin/perl
#
# delete_semaphores.pl: delete leftover semaphores from crashed MPI programs
#
$IPCRM="/usr/bin/ipcrm";
$IPCS="/usr/bin/ipcs";
@SEMAPHORES=`$IPCS -s`;

for ($i = 3; $i < $#SEMAPHORES; $i++) {
  @line = split(' ',$SEMAPHORES[$i]);
  $semid = $line[1];
# print "$semid\n";
  system("$IPCRM sem $semid");
}

@SHMEMSEGS=`$IPCS -m`;

for ($i = 3; $i < $#SHMEMSEGS; $i++) {
  @line = split(' ',$SHMEMSEGS[$i]);
  $shmid = $line[1];
# print "$shmid\n";
  system("$IPCRM shm $shmid");
}