Opened 10 years ago

Closed 6 years ago

#741 closed defect (fixed)

IZ3175: Empty boolean resource request becomes 0 when using JSV

Reported by: eddale Owned by:
Priority: normal Milestone:
Component: sge Version: 6.2u4
Severity: minor Keywords: Linux scheduling
Cc:

Description

[Imported from gridengine issuezilla http://gridengine.sunsource.net/issues/show_bug.cgi?id=3175]

        Issue #:      3175             Platform:     All      Reporter: eddale (eddale)
       Component:     gridengine          OS:        Linux
     Subcomponent:    scheduling       Version:      6.2u4       CC:
                                                                        [_] eddale
                                                                        [_] Remove selected CCs
        Status:       NEW              Priority:     P3
      Resolution:                     Issue type:    DEFECT
                                   Target milestone: ---
      Assigned to:    andreas (andreas)
      QA Contact:     andreas
          URL:
       * Summary:     Empty boolean resource request becomes 0 when using JSV
   Status whiteboard:
      Attachments:

     Issue 3175 blocks:
   Votes for issue 3175:


   Opened: Tue Nov 10 04:06:00 -0700 2009 
------------------------


If I submit a job with an empty boolean resoure request and a JSV modifies the resource request list, that empty boolean resource request is
returned as zero, which is evaluated as false.  Here's a command line transcript that exhibits the bug.

# This is my JSV
eddale@bass-comp0 ~$ cat test.pl
#!/usr/bin/perl

use strict;
use warnings;
no warnings qw/uninitialized/;

use Env qw(SGE_ROOT SGE_CELL);
use lib "$SGE_ROOT/util/resources/jsv";
use JSV qw( :DEFAULT jsv_sub_add_param jsv_sub_get_param jsv_send_env jsv_log_info jsv_is_param jsv_get_param );

jsv_on_start(sub {
   jsv_send_env();
});

jsv_on_verify(sub {
   jsv_sub_add_param('l_hard','h_rt','500');
   jsv_accept('Job is accepted');
   return;
});

jsv_main();

# No resource request, no JSV, no problem
eddale@bass-comp0 ~$ qsub -b y qstat -r
Your job 338257 ("qstat") has been submitted
eddale@bass-comp0 ~$ cat qstat.o338257
job-ID  prior   name       user         state submit/start at     queue                          slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
 338257 0.13241 qstat      eddale       r     11/10/2009 05:34:34 all.q@bass-comp6.cs.unc.edu        1
       Full jobname:     qstat
       Master Queue:     all.q@bass-comp6.cs.unc.edu
       Hard Resources:   h_rt=172800 (0.000000)
       Soft Resources:

# Empty boolean resource request is evaluated as true.  Still no JSV, no problem
eddale@bass-comp0 ~$ qsub -b y -l himem qstat -r
Your job 338258 ("qstat") has been submitted
eddale@bass-comp0 ~$ cat qstat.o338258
job-ID  prior   name       user         state submit/start at     queue                          slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
 338258 0.13241 qstat      eddale       r     11/10/2009 05:34:48 himem.q@bass-himem.cs.unc.edu      1
       Full jobname:     qstat
       Master Queue:     himem.q@bass-himem.cs.unc.edu
       Hard Resources:   h_rt=172800 (0.000000)
                         himem=TRUE (0.000000)
       Soft Resources:

# Now the JSV has been requested.  The empty boolean resource request has been
# converted to 0, which evaluates as false, causing the job to queue.
eddale@bass-comp0 ~$ qsub -b y -l himem -jsv /home/eddale/test.pl qstat -r
Your job 338259 ("qstat") has been submitted
eddale@bass-comp0 ~$ cat qstat.o338259
cat: qstat.o338259: No such file or directory
eddale@bass-comp0 ~$ qstat -r
job-ID  prior   name       user         state submit/start at     queue                          slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
 338259 0.13241 qstat      eddale       qw    11/10/2009 05:34:53                                    1
       Full jobname:     qstat
       Hard Resources:   himem=0.000000 (0.000000)
                         h_rt=500 (0.000000)
       Soft Resources:

# The boolean resource request has been specified explicitly as TRUE.
# The request remains TRUE after the JSV.
eddale@bass-comp0 ~$ qsub -b y -l himem=TRUE -jsv /home/eddale/test.pl qstat -r
Your job 338260 ("qstat") has been submitted
eddale@bass-comp0 ~$ cat qstat.o338260
job-ID  prior   name       user         state submit/start at     queue                          slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
 338260 0.06648 qstat      eddale       r     11/10/2009 05:36:18 himem.q@bass-himem.cs.unc.edu      1
       Full jobname:     qstat
       Master Queue:     himem.q@bass-himem.cs.unc.edu
       Hard Resources:   himem=TRUE (0.000000)
                         h_rt=500 (0.000000)
       Soft Resources:

# This is the output of the JSV logging
# Notice that the empty boolean resource request is interpreted as 0 when it
# is sent to the JSV.
eddale@bass-comp0 ~$ cat /tmp/jsv.log
/home/eddale/test.pl started on Tue Nov 10 05:47:03 2009

This file contains logging output from a GE JSV script. Lines beginning
with >>> contain the data which was send by a command line client or
sge_qmaster to the JSV script. Lines beginning with <<< contain data
which is send from this JSV script to the client or sge_qmaster

>>> START
<<< SEND ENV
<<< STARTED
>>> PARAM VERSION 1.0
>>> PARAM CONTEXT client
>>> PARAM CLIENT qsub
>>> PARAM USER eddale
>>> PARAM GROUP compsci
>>> PARAM CMDNAME qstat
>>> PARAM CMDARGS 1
>>> PARAM CMDARG0 -r
>>> PARAM b y
>>> PARAM l_hard h_rt=48:00:00,himem=0.000000
>>> PARAM M eddale@bass-comp0.cs.unc.edu
>>> PARAM N qstat
>>> PARAM p -1023
>>> BEGIN
<<< PARAM l_hard himem=0.000000,h_rt=500
<<< RESULT STATE ACCEPT Job is accepted
/home/eddale/test.pl is terminating on Tue Nov 10 05:47:03 2009
/home/eddale/test.pl started on Tue Nov 10 05:47:10 2009

This file contains logging output from a GE JSV script. Lines beginning
with >>> contain the data which was send by a command line client or
sge_qmaster to the JSV script. Lines beginning with <<< contain data
which is send from this JSV script to the client or sge_qmaster

>>> START
<<< SEND ENV
<<< STARTED
>>> PARAM VERSION 1.0
>>> PARAM CONTEXT client
>>> PARAM CLIENT qsub
>>> PARAM USER eddale
>>> PARAM GROUP compsci
>>> PARAM CMDNAME qstat
>>> PARAM CMDARGS 1
>>> PARAM CMDARG0 -r
>>> PARAM b y
>>> PARAM l_hard h_rt=48:00:00,himem=TRUE
>>> PARAM M eddale@bass-comp0.cs.unc.edu
>>> PARAM N qstat
>>> PARAM p -1023
>>> BEGIN
<<< PARAM l_hard himem=TRUE,h_rt=500
<<< RESULT STATE ACCEPT Job is accepted
/home/eddale/test.pl is terminating on Tue Nov 10 05:47:10 2009

   ------- Additional comments from reuti Tue Nov 10 05:23:28 -0700 2009 -------
AFAICS it's a problem of the client side JSV only. On the server side it seems to work as expected. Can you confirm this?

The question is, where the boolean request w/o parameter is expanded to resolve as TRUE. Workaround would be to check the content of the variable "himem" whether it reads
0.000000 (neither TRUE nor FALSE at this stage) and then setting it to TRUE in your jsv.

   ------- Additional comments from eddale Tue Nov 10 05:51:25 -0700 2009 -------
That's correct.  It seems to only happen when using a client-side JSV.

If I log the value of himem at the top of the jsv_on_verify function, I get "0.0000000" when TRUE isn't specified.  I get "TRUE" when it is.
 Here's the line I'm using:
 jsv_log_info(jsv_sub_get_param('l_hard','himem'));

If I explicitly set himem to TRUE inside the JSV using this line:
 jsv_sub_add_param('l_hard','himem','TRUE');
then I get the following output in the JSV logfile:
>>> START
<<< SEND ENV
<<< STARTED
>>> PARAM VERSION 1.0
>>> PARAM CONTEXT client
>>> PARAM CLIENT qsub
>>> PARAM USER eddale
>>> PARAM GROUP compsci
>>> PARAM CMDNAME qstat
>>> PARAM CMDARGS 1
>>> PARAM CMDARG0 -r
>>> PARAM b y
>>> PARAM l_hard h_rt=48:00:00,himem=0.000000
>>> PARAM M eddale@bass-comp0.cs.unc.edu
>>> PARAM N qstat
>>> PARAM p -1023
>>> BEGIN
<<< LOG INFO 0.000000
<<< PARAM l_hard himem=0.000000,h_rt=500
<<< PARAM l_hard himem=TRUE,h_rt=500
<<< RESULT STATE ACCEPT Job is accepted

Notice that l_hard and himem are specified twice.

   ------- Additional comments from eddale Tue Nov 10 05:59:57 -0700 2009 -------
didn't mean to change the version

Change History (1)

comment:1 Changed 6 years ago by dlove

  • Resolution set to fixed
  • Severity set to minor
  • Status changed from new to closed

Fixed by [3866]

Note: See TracTickets for help on using tickets.