24小时热门版块排行榜    

查看: 574  |  回复: 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的回帖

marklee1975

木虫 (小有名气)

   虽然没有遇见过你提到的问题但是还是顶一下,呵呵,头一次在这个论坛里看见用PC GAMESS的!
2楼2008-12-02 11:54:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snoopyzhao

至尊木虫 (职业作家)

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

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

lei0736

荣誉版主 (职业作家)

优秀版主

4楼2009-06-13 21:49:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 beefly 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 311求调剂 +9 冬十三 2026-03-15 10/500 2026-03-17 22:53 by lbsjt
[硕博家园] 湖北工业大学 生命科学与健康学院-课题组招收2026级食品/生物方向硕士 +3 1喜春8 2026-03-17 5/250 2026-03-17 17:18 by ber川cool子
[考研] 332求调剂 +6 Zz版 2026-03-13 6/300 2026-03-17 17:03 by ruiyingmiao
[考研] 【0856】化学工程(085602)313 分,本科学科评估A类院校化学工程与工艺,诚求调剂 +7 小刘快快上岸 2026-03-11 8/400 2026-03-17 16:57 by ruiyingmiao
[考研] 一志愿苏州大学材料工程(085601)专硕有科研经历三项国奖两个实用型专利一项省级立项 +6 大火山小火山 2026-03-16 8/400 2026-03-17 15:05 by 无懈可击111
[考研] 211本,11408一志愿中科院277分,曾在中科院自动化所实习 +6 Losir 2026-03-12 7/350 2026-03-17 12:09 by danranxie
[考研] 289求调剂 +6 步川酷紫123 2026-03-11 6/300 2026-03-17 10:23 by Sammy2
[考研] 283求调剂 +3 听风就是雨; 2026-03-16 3/150 2026-03-17 07:41 by 热情沙漠
[考研] [导师推荐]西南科技大学国防/材料导师推荐 +3 尖角小荷 2026-03-16 6/300 2026-03-16 23:21 by 尖角小荷
[考研] 化学调剂0703 +8 啊我我的 2026-03-11 8/400 2026-03-16 17:23 by 我的船我的海
[考研] 环境工程调剂 +6 大可digkids 2026-03-16 6/300 2026-03-16 17:16 by barlinike
[考研] 中科院材料273求调剂 +4 yzydy 2026-03-15 4/200 2026-03-16 15:59 by Gaodh_82
[考研] 288求调剂 +4 奇点0314 2026-03-14 4/200 2026-03-14 23:04 by JourneyLucky
[考研] 材料与化工 323 英一+数二+物化,一志愿:哈工大 本人本科双一流 +4 自由的_飞翔 2026-03-13 5/250 2026-03-14 19:39 by hmn_wj
[考研] 297求调剂 +4 学海漂泊 2026-03-13 4/200 2026-03-14 11:51 by 热情沙漠
[考研] 【0703化学调剂】-一志愿华中师范大学-六级475 +5 Becho359 2026-03-11 5/250 2026-03-14 11:35 by 哦哦123
[考研] 337一志愿华南理工0805材料求调剂 +7 mysdl 2026-03-11 9/450 2026-03-13 22:43 by JourneyLucky
[考研] 一志愿中科院,化学方向,295求调剂 +4 一氧二氮 2026-03-11 4/200 2026-03-13 22:35 by JourneyLucky
[考研] 311求调剂 +3 冬十三 2026-03-13 3/150 2026-03-13 20:41 by JourneyLucky
[考研] 321求调剂(食品/专硕) +3 xc321 2026-03-12 6/300 2026-03-13 08:45 by xc321
信息提示
请填处理意见