Regarding Workchain Not Executing After Modification

Hi everyone,

I was designing some workchains for my VASP calculations, and what I noticed was that every time I changed something and restarted the daemon, it still seemed to execute an older version of the script. Am I supposed to do something apart from restarting the daemon?

Thank you,
Rushik

AFAIK, restarting the daemon should pick up the latest version of your module. A few things to check:

  • Make sure your package is installed in editable mode (pip install -e .), and double-check that the installed path is actually pointing to the source files you’re editing.

  • You might want to clear any cached files (e.g., __pycache__ folders) in the package. Not likely the root cause, but worth trying.

If that doesn’t help:

  • Which version of AiiDA are you using?

  • Are you running verdi daemon restart? In some versions, it’s more reliable to use verdi daemon stop followed by verdi daemon start. The behavior changed in certain versions of aiida-core (I don’t remember exactly when).

I would also like to mention to check for any rogue daemons that might be lurking. I’ve had this issue several times where I’m working on the supercomputer and I forget to shut down my daemons. I then get logged into another login node and start up some daemons. The old daemons are still running on the other login node and will sometimes execute the jobs.

The first part, I think I am doing correctly and I am also deleting cached files. For the version, I am using, aiida 2.6.3 and I mostly do verdi daemon restart.

I think this might be an issue then, how do you remove the daemons from other login nodes then?

This is the script I’m using on my server. You’ll have to modify it based on how your server is configured.

#!/usr/bin/env python3
import os
import subprocess


def main():

    # Get a list of login nodes
    nodes = [x.split(':')[0][1:] for x in subprocess.check_output(['pdsh', '-g', '-login', 'uptime']).decode('utf-8').split('\n')]

    for node in nodes[:-1]:
        print(node)
        for item in subprocess.check_output(['ssh', node, 'ps', '-x', '|', 'grep', 'verdi']).decode().split('\n'):
            print(item)


if __name__ == "__main__":
    main()

It will print out the name of the node and any line in the return that has verdi included. I then go in by hand and kill the workers but that could be automated if you wanted as well.