Changeset 851 for branches/1.0/jobmond


Ignore:
Timestamp:
05/13/13 21:17:20 (11 years ago)
Author:
ramonb
Message:

jobmond.py:

  • implemented SLURM job's running node detection
  • fixed bug where incorrect commandline option would trigger traceback in usage()
  • see #162
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/jobmond/jobmond.py

    r837 r851  
    7070
    7171        print detail
    72         usage()
     72        usage( False )
    7373        sys.exit( 1 )
    7474
     
    13331333
    13341334                start_timestamp = self.getAttr( attrs, 'start_time' )
    1335                 nodes           = attrs[ 'alloc_node' ].split(',')
    1336 
    1337                 nodeslist       = do_nodelist( nodes )
     1335                nodes           = attrs[ 'nodes' ]
     1336
     1337                if not nodes:
     1338
     1339                    # This should not happen
     1340
     1341                    # Something wrong: running but 'nodes' returned empty by pyslurm
     1342                    # Possible pyslurm bug: abort/quit/warning
     1343
     1344                    err_msg = 'FATAL ERROR: job %s running but nodes returned empty: pyslurm bugged?' %job_id
     1345
     1346                    print err_msg
     1347                    debug_msg( 0, err_msg )
     1348                    sys.exit(1)
     1349
     1350                my_nodelist = [ ]
     1351
     1352                slurm_hostlist  = pyslurm.hostlist()
     1353                slurm_hostlist.create( nodes )
     1354                slurm_hostlist.uniq()
     1355
     1356                while slurm_hostlist.count() > 0:
     1357
     1358                    my_nodelist.append( slurm_hostlist.pop() )
     1359
     1360                slurm_hostlist.destroy()
     1361
     1362                del slurm_hostlist
     1363
     1364                nodeslist       = do_nodelist( my_nodelist )
    13381365
    13391366                if DETECT_TIME_DIFFS:
Note: See TracChangeset for help on using the changeset viewer.