24小时热门版块排行榜    

查看: 534  |  回复: 3
当前主题已经存档。
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

beefly

专家顾问 (职业作家)

地沟油冶炼专家

[交流] 【交流】pc-gamess for linux出现semget failed问题的解决办法

如果多次杀死pc-gamess的进程,经常会导致后面的pc-gamess任务无法正常提交,在输出文件中出现如下的出错信息:

p0_30545:  p4_error: semget failed for setnum: 8

这是某些通信端口没有正常关闭造成的。在网上找到了解决办法:把以下命令(两行星号之间)存成可执行的脚本文件,并运行。

这个脚本仅对pc-gamess有效,对gamess-us不起作用。

*******************
#! /bin/sh
# courtesy of Jarek Nieplocha, to clean ipc's
# Modified by Bill Gropp to apply only to calling user
ipccmd=ipcrm
for arg in "$@" ; do
   case $arg in
        -help|-u|-us*|-h)
        echo "cleanipcs [-show] [-echo]"
        exit 1
        ;;
        -echo)
        set -x
        ;;
        -show)
        ipccmd="echo ipcrm"
        ;;
        *)
        if [ -n "$arg" ] ; then
              echo "Unrecognized argument $arg"
            exit 1
        fi
        ;;
   esac
done
#
# LINUX uses an incompatible form of the ipcrm command!  Try to detect this
# An earlier version looked at the output of ipcrm, but that output
# keeps changing.  The following code from Ralf Wildenhues attempts to
# use the Linux /proc interface.
#statvalue=`ipcrm 2>&1`
#if [ $? != 0 ] ; then
#    if [ "$statvalue" = 'usage: ipcrm [shm | msg | sem] id' ] ; then
#        UseLinux=1
#    fi
#fi
#if [ $UseLinux = 0 ] ; then
if [ x`uname -s` = xLinux ] ; then
    # try to use /proc interface if possible
    # and hope it does not change too often
    if [ -r /proc/sysvipc/shm  ] ; then
            cat /proc/sysvipc/shm \
        | gawk '{if ($8 == uid) printf("%s %s\n", comm, $2)}' uid=$UID comm="$ipccmd shm " \
        | sh > /dev/null
    else
        ipcs -m \
        | gawk '{if ($3 == name) printf("%s %s\n", comm, $2)}' name=$LOGNAME comm="$ipccmd shm " \
        | sh > /dev/null
    fi
    if [ -r /proc/sysvipc/sem ] ; then
            cat /proc/sysvipc/sem \
        | gawk '{if ($5 == uid) printf("%s %s\n", comm, $2)}' uid=$UID comm="$ipccmd sem " \
        | sh > /dev/null
    else
        ipcs -s \
        | gawk '{if ($3 == name) printf("%s %s\n", comm, $2)}' name=$LOGNAME comm="$ipccmd sem " \
        | sh > /dev/null
    fi
else
    $ipccmd `ipcs | awk '{if ((($1 == "m" || ($1 == "s") && ($5 == "'$LOGNAME'") print sprintf("-%s %s",$1,$2) }'`
fi
#
# Here is the old LINUX code
#    #
#    # For LINUX, we need this instead:
#    ipcs -m | gawk '{if ($3 == name) printf("%s %s\n", comm, $2)}' name=$LOGNAME comm="$ipccmd shm " | sh > /dev/null
#    ipcs -s | gawk '{if ($3 == name) printf("%s %s\n", comm, $2)}' name=$LOGNAME comm="$ipccmd sem " | sh > /dev/null
#
# mpirun could call this for systems that use SYSV shared memory features,
# just to keep them friendly.

*******************

[ Last edited by mingdong on 2009-9-14 at 16:58 ]
回复此楼

» 猜你喜欢

beefly《西太平洋大学现代英汉词典》[bi:fli]牛肉一般地
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snoopyzhao

至尊木虫 (职业作家)

pc gamess 与 gamess us 之间有啥区别……

话说俺用过一段时间的 gamess us,呵呵
3楼2008-12-02 12:22:47
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 4 个回答

marklee1975

木虫 (小有名气)

   虽然没有遇见过你提到的问题但是还是顶一下,呵呵,头一次在这个论坛里看见用PC GAMESS的!
2楼2008-12-02 11:54:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见