[Documentation] Explain serial and parallel submission
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
Línea de trabajo
No se nombra ningún archivo de documentación ni punto de entrada. Empieza por localizar la documentación de uso del executor y, después, utiliza los ejemplos proporcionados de SingleNodeExecutor para explicar el envío serial y paralelo, el orden de las dependencias, los tiempos de espera variables y max_workers; se considera terminado cuando quedan claros el orden de envío recomendado y el comportamiento de ejecución resultante.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This can be illustrated with the following examples:
from time import sleep
from executorlib import SingleNodeExecutor
def wait_function(i, j, dependency):
sleep(i)
return [i, j]
def get_results(future_lst):
"""sort results based on time of completion"""
result_lst, tmp_lst = [], []
while len(future_lst) > 0:
for f in future_lst:
if f.done():
result_lst.append(f.result())
else:
tmp_lst.append(f)
future_lst = tmp_lst
tmp_lst = []
return result_lst
with SingleNodeExecutor(max_workers=2) as exe:
future_lst = []
for i in range(5):
f = None
for j in range(4):
f = exe.submit(wait_function, i=i, j=j, dependency=f)
future_lst.append(f)
print(get_results(future_lst=future_lst))
>>> [[0, 0], [1, 0], [2, 0], [3, 0], [0, 1], [1, 1], [4, 0], [2, 1], [0, 2], [3, 1], [1, 2], [2, 2], [0, 3], [4, 1], [1, 3], [3, 2], [2, 3], [4, 2], [3, 3], [4, 3]]
The wait time of the tasks depends only on the i parameter. In addition, functions with increasing j parameter depend on each other, so [1, 1] can only be executed once [1, 0] is completed. Given the structure of the loops the functions are submitted as follows:
[
[0, 0], [1, 0], [2, 0], [3, 0], [4, 0],
[0, 1], [1, 1], [2, 1], [3, 1], [4, 1],
[0, 2], [1, 2], [2, 2], [3, 2], [4, 2],
[0, 3], [1, 3], [2, 3], [3, 3], [4, 3],
]
But the execution order differs, starting with [0, 0], [1, 0], [2, 0], [3, 0] followed by [0, 1], [1, 1] and [4, 0]. The reason is the varying wait time. [0, 0], [1, 0], [2, 0], [3, 0], [4, 0] wait 0 seconds while [0, 1], [1, 1], [2, 1], [3, 1], [4, 1] wait 1 second and so on. Finally, only two tasks can be executed at the same time as the number of workers is restricted to max_workers=2.
In analogy:
with SingleNodeExecutor(max_workers=2) as exe:
future_lst = []
for j in range(4):
f = None
for i in range(5):
f = exe.submit(wait_function, i=i, j=j, dependency=f)
future_lst.append(f)
print(get_results(future_lst=future_lst))
>>> [[0, 0], [0, 1], [0, 2], [0, 3], [1, 0], [1, 1], [1, 2], [1, 3], [2, 1], [2, 0], [2, 2], [2, 3], [3, 0], [3, 1], [3, 2], [3, 3], [4, 0], [4, 1], [4, 2], [4, 3]]
Here the execution is transposed:
[
[0, 0], [0, 1], [0, 2], [0, 3],
[1, 0], [1, 1], [1, 2], [1, 3],
[2, 0], [2, 1], [2, 2], [2, 3],
[3, 0], [3, 1], [3, 2], [3, 3],
[4, 0], [4, 1], [4, 2], [4, 3],
]
As the executed tasks have the same run time the execution order equals the submission order, which is the recommended case.
- Lenguaje dominante
- Python
- Estrellas
- 77
- Forks
- 7
- Merge medio
- 10 h 32 min
- PR fusionados (30 d)
- 12
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pyiron/executorlib
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pyiron/executorlib#1054 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pyiron/executorlib#1032 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pyiron/executorlib#1005 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
pyiron/executorlib#1049 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
pyiron/executorlib#999 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de pyiron/executorlib
Issues similares
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
kristofdegrave/homeassistant-smart-charging#1413 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
nasa/earthdata-varinfo#113 ·
-
curriculum documentation quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
githubnext/gh-aw-workshop#3849 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día