Annotation of loncom/debugging_tools/delete_semaphores_shmemesesg.pl, revision 1.1
1.1 ! albertel 1: #!/usr/bin/perl
! 2: #
! 3: # delete_semaphores.pl: delete leftover semaphores from crashed MPI programs
! 4: #
! 5: $IPCRM="/usr/bin/ipcrm";
! 6: $IPCS="/usr/bin/ipcs";
! 7: @SEMAPHORES=`$IPCS -s`;
! 8:
! 9: for ($i = 3; $i < $#SEMAPHORES; $i++) {
! 10: @line = split(' ',$SEMAPHORES[$i]);
! 11: $semid = $line[1];
! 12: # print "$semid\n";
! 13: system("$IPCRM sem $semid");
! 14: }
! 15:
! 16: @SHMEMSEGS=`$IPCS -m`;
! 17:
! 18: for ($i = 3; $i < $#SHMEMSEGS; $i++) {
! 19: @line = split(' ',$SHMEMSEGS[$i]);
! 20: $shmid = $line[1];
! 21: # print "$shmid\n";
! 22: system("$IPCRM shm $shmid");
! 23: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>