aiidateam / aiida-workgraph

Efficiently design and manage flexible workflows with AiiDA, featuring an interactive GUI, checkpoints, provenance tracking, and remote execution capabilities.
https://aiida-workgraph.readthedocs.io/en/latest/
MIT License
10 stars 5 forks source link

Awaitable task is not listed in `verdi process list` #260

Open agoscinski opened 3 months ago

agoscinski commented 3 months ago

The code

import asyncio

@task.awaitable()
async def some_sleep():
    await asyncio.sleep(10)
    return orm.Int(0)

@task.calcfunction
def some():
    return orm.Int(0)
wg = WorkGraph()

some_sleep_task = wg.add_task(some_sleep, name='some_sleep_task')
some_task = wg.add_task(some, name='some_task')

wg.run()

Gives me first the output

2496  2s ago     WorkGraph<WorkGraph>                                        ⏵ Waiting         Waiting for child processes: some_sleep_task
2497  0s ago     some                                                        ⏹ Finished [0]

Then when everything is finished

2496  13s ago    WorkGraph<WorkGraph>                                        ⏹ Finished [0]
2497  12s ago    some                                                        ⏹ Finished [0]

I am missing the some_sleep_task

superstar54 commented 3 months ago

Yes, only AiiDA processes are listed. The following tasks have a process:

Other tasks will not:

superstar54 commented 3 months ago

But you can still visualize the state of the non-AiiDA process tasks in the GUI using web app.