[torqueusers] mom_priv/config - comment lines longer than 120 chars

Craig Macdonald craigm at dcs.gla.ac.uk
Fri May 9 04:01:22 MDT 2008


In our new setup, I added comments in mom_priv config, essentially to 
detail new options (just a C&P from the documentation)
{{{
#8. The tmpdir mom config option sets the directory basename for a 
per-job temporary directory.  Before the job is launched, MOM will 
append the jobid to the tmpdir base-name and create the directory.  
After the job completes and exits, MOM will recursively delete that 
temporary directory. The env variable TMPDIR will be set for all 
pro/epilog scripts, the job script, and TM tasks.
# Directory creation and removal is done as the job owner and group, so 
the owner must have write permission to create the directory. If the 
directory already exists and is owned by the job owner, it will not be 
deleted after the job. If the directory already exists and is NOT owned 
by the job owner, the job start will be rejected.
$tmpdir /scratch
}}}

However, this caused problems, which can be seem from pbsnodes output
{{{
trnode24
     state = offline
     np = 3
     properties = x64,smp,rack1
     ntype = cluster
     status = arch=x86_64,opsys=linux,uname=Linux trnode24 2.6.18-53.el5 
#1 SMP Mon Nov 12 02:14:55 EST 2007 x86_64,sessions=? 0,nsessions=? 
0,nusers=0,idletime=41148,totmem=6142300kb,availmem=6053668kb,physmem=4048504kb,ncpus=4,loadave=0.00,gres=the:directory 
already exists and is NOT owned by the job owner,the job start will be 
rejected.+the:directory. If the directory already exists and is owned by 
the job owner,it will not be deleted after the job. If+e:job script,and 
TM tasks.+OM:will recursively delete that temporary directory. The env 
variable TMPDIR will be set for all pro/epilog scripts,th+ched:,MOM will 
append the jobid to the tmpdir base-name and create the directory.  
After the job completes and 
exits,M,netload=103292634,size=120860444kb:120921428kb,state=free,jobs=? 
0,rectime=1210325412
}}}
(torque 2.1.9)

Looks odd doesnt it ;-)

Inspection of the mom_main.c shows that the problem is that fgets() is 
used to limit the line size read to 120 characters, and lines starting 
with comments are ignored.
However, if a line is longer than this, then not all of the line will be 
identified as a comment, and will instead be identified as node 
attributes. Ideally, a comment should only end once a newline has been 
identified, and subsequent calls to fgets should check to see if a new 
line is identified.

Workaround - dont put comments longer than 120 chars in mom_priv/config.

Not sure how this affects non-comment lines.

C


More information about the torqueusers mailing list