Usar qdel para eliminar todos mis trabajos a la vez, no uno a la vez


Esta es una pregunta bastante simple, pero no he podido encontrar una respuesta.

Tengo un gran número de trabajos que se ejecutan en un clúster (>20) y me gustaría eliminarlos todos y comenzar de nuevo.

De acuerdo con este sitio Debería ser capaz de hacer:

qdel -u netid

Para deshacerse de todos ellos, pero en mi caso que devuelve:

qdel: invalid option -- 'u'
usage: qdel [{ -a | -c | -p | -t | -W delay | -m message}] [<JOBID>[<JOBID>]|'all'|'ALL']...
   -a -c, -m, -p, -t, and -W are mutually exclusive

Lo que obviamente indica que el comando no funciona.

Solo para comprobar, lo hice:

qstat -u <username>

Y consigo una lista de todos mis trabajos, pero:

qdel -u <username>

También falla.

Author: Gabriel, 2015-03-04

9 answers

Encontró la respuesta enterrada en un viejo supercluster.org thread:

qselect -u <username> | xargs qdel

Funcionó perfectamente.

 53
Author: Gabriel,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-10 01:02:24

No puede comentar, pero construyendo sobre lo que Gabriel respondió:

qselect -u <username> | xargs qdel

qselect -u <username> -s <state> | xargs qdel

<state> sería R solo para ejecutar trabajos.

Qselect le permitirá seleccionar el trabajo basado en otros criterios, como ressources asked (-l), destination queue (-q) ...

qdel -u <username>

Solo funcionará con SGE

 29
Author: Y. Boursin,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-09-14 12:05:17

A veces un simple grep/cut también puede ayudar: qstat | grep $USER | cut -d. -f1 | xargs qdel

De esta manera también podemos grep en una palabra clave en particular para los trabajos y eliminarlos.

HTH

 9
Author: asifzuba,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-04-21 01:17:27

Otra posibilidad es hacer qdel all. Elimina todos los trabajos de todos. Cuando no tiene acceso al trabajo de otras personas, solo elimina sus trabajos.

No es la solución más hermosa, pero seguramente es la más corta!

 2
Author: pl-94,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-04-14 15:21:04
# Delete all jobs owned by the current user.
# 
# Command breakdown:
# ------------------
#
# qselect
# -u selects all jobs that belong to the current user
# -s EHQRTW selects all job states except for Complete
#
# xargs
# --no-run-if-empty Do not run qdel if the result set is empty
#                   to avoid triggering a usage error.
#
# qdel
# -a delete jobs asynchronously
#
# The backslashes are a trick to avoid matching any shell aliases.

\qselect -u $(whoami) -s EHQRTW | \xargs --no-run-if-empty \qdel -a
 2
Author: Jason,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-10-17 17:37:07
qstat | cut -d. -f1 | sed "s;   \(.*\) 0;qdel \1;" | bash

El poder de Sed.

 0
Author: MrMimic,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-06-13 08:24:43

Intenta

$ qdel {id1..id2}

Por ejemplo:

$ qdel {1148613..1148650}
 0
Author: CiaranWelsh,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-12-14 15:35:14

Para UGE:

Qstat-u | gawk '{print} 1}' / xargs qdel

 0
Author: teng_wenxuan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-06-29 13:35:07

Simplemente use el siguiente comando:

qdel all           

Cancelará todos los trabajos que se ejecuten en el clúster.

 -1
Author: Viral Solanki,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-27 07:17:54