Thanks Andrew,

It’s a good idea, but I need access to the data base, because I have a 
migratrion data scripts that use SQL-query. For this reason I need to know the 
equivalence between jobs_states <-> numerical identifier.


From: Andrew Carton 
Sent: Tuesday, December 11, 2012 5:06 PM
To: slurm-dev 
Subject: [slurm-dev] Re: Job state codes

Alfonso,

I would use the C interface in slurmdb.h rather than directly accessing the 
mysql backend. 

Basically, because it is available, and has abstractions to deal with the 
slurmdb model directly, rather than trying to reverse engineer the database 
schema.

Also, depending on physical architecture, some people may not have a mysql 
database deployed, for their accounting records. I believe their are additional 
implementations of a plain text file and a PostgreSQL in addition to mySQL....

Perhaps you want your tool to be portable, across other slurm deployments / 
configurations? In which case having a dependency on the Slurmdb C interface 
may be a better solution.

But if you want to deal with the mysql database backend directly, these numbers 
in the mySQL database may map to this C enum in the slurmdb.h, where the first 
entry is 0.

enum job_states {
  JOB_PENDING,    /* queued waiting for initiation */
  JOB_RUNNING,    /* allocated resources and executing */
  JOB_SUSPENDED,    /* allocated resources, execution suspended */
  JOB_COMPLETE,   /* completed execution successfully */
  JOB_CANCELLED,    /* cancelled by user */
  JOB_FAILED,   /* completed execution unsuccessfully */
  JOB_TIMEOUT,    /* terminated on reaching time limit */
  JOB_NODE_FAIL,    /* terminated on node failure */
  JOB_PREEMPTED,    /* terminated due to preemption */
  JOB_END     /* not a real state, last entry in table */
};

Of course you can double check by doing a:

select state,id_job from cluster_job_table where state=0;
select state,id_job from cluster_job_table where state=1;
select state,id_job from cluster_job_table where state=2;
....

and then sacct -j id_job in the command line and it will translate a job for 
you as a string to see the translation

Andrew.

On 11/12/12 15:36, Alfonso Pardo wrote: 
  Hello,

  We are developing a graphical stadistics tool. For this tool we need obtain 
the jobs states from Slurm data base (mysql).

  Could you say me the description of the diferents numerical jobs status?


  This is the numerical job status:

  mysql> select distinct state from cluster_job_table;
  +-------+
  | state |
  +-------+
  |     3 |
  |     4 |
  |     5 |
  |     7 |
  |     6 |
  +-------+
  Alfonso Pardo Díaz

  Researcher / System Administrator at CETA-Ciemat 
  c/ Sola nº 1; 10200 Trujillo, ESPAÑA
  Tel: +34 927 65 93 17 Fax: +34 927 32 32 37 


  ---------------------------- Confidencialidad: Este mensaje y sus ficheros 
adjuntos se dirige exclusivamente a su destinatario y puede contener 
información privilegiada o confidencial. Si no es vd. el destinatario indicado, 
queda notificado de que la utilización, divulgación y/o copia sin autorización 
está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje 
por error, le rogamos que nos lo comunique inmediatamente respondiendo al 
mensaje y proceda a su destrucción. Disclaimer: This message and its attached 
files is intended exclusively for its recipients and may contain confidential 
information. If you received this e-mail in error you are hereby notified that 
any dissemination, copy or disclosure of this communication is strictly 
prohibited and may be unlawful. In this case, please notify us by a reply and 
delete this email and its contents immediately. ---------------------------- 

 

Reply via email to