[torquedev] [Bug 118] Dynamic Consumable Generic Resources dose not work as documented

bugzilla-daemon at supercluster.org bugzilla-daemon at supercluster.org
Fri Nov 11 01:29:26 MST 2011


http://www.clusterresources.com/bugzilla/show_bug.cgi?id=118

--- Comment #5 from Robert Oostenveld <r.oostenveld at donders.ru.nl> 2011-11-11 01:29:26 MST ---
Don't know what it does, but it is a function that is declared and defined
further down in the mom_main.c code. It says

/*
** Check the request against the format of the line read from
** the config file.  If it is a static value, there should be
** no params.  If it is a shell escape, the parameters (if any)
** should match the command line for the system call.
*/

char *conf_res(

  char               *resline,        /* I */
  struct rm_attribute *attr)    /* I */
...

Quickly browsing the code, the relevant stuff seems that it checks whether
resline[0] is equal to '!'. It then parses the remainder and calls
popen(ret_string, "r")) which is a system-call that executes the requested
command.

The shell script that I have it calling by specifying in the mom_priv/config
matlab !/opt/cluster/matlabfree
is the following

--------------------------------------------------------
#!/bin/bash
#
# This scrip is used for torque to count the number of free floating network
licenses.
#
# Please note that it contains a variable with the number of DCCN licenses,
this
# should be updated whenever the number of licenses that we can use on the
campus-wide
# license server changes.
#
#
# 10nov2011 - roboos: created
# 11nov2011 - roboos: added fcdc and FCDC to the search terms

MATLABAVAIL=100
MATLABINUSE=`/opt/cluster/lmstat -f MATLAB | awk '/mentat/; /fcdc/; /dccn/;
/FCDC/; /DCCN/' | uniq | wc -l`

let MATLABFREE="$MATLABAVAIL"-"$MATLABINUSE"

if [ $MATLABFREE -lt 0 ] ; then
MATLABFREE=0
fi

echo $MATLABFREE

exit 0
--------------------------------------------------------

With the suggested patch it works, i.e pbsnodes reports correctly the number
that is is reported by the shell script (and I also see that the number varies
over time as the number of floating network licenses changes).

Note however that this does not mean that my goals are met. I still have an
issue that 
qsub -l other=matlab
or 
qsub -W x=GRES:matlab
as explained in the documentation on
http://www.clusterresources.com/torquedocs21/2.1jobsubmission.shtml don't seem
to pay any attention to this matlab resource (which I have defined on only a
single node so far). But that is something that falls outside the scope of this
bug...

-- 
Configure bugmail: http://www.clusterresources.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the torquedev mailing list