pyiron/pyiron_atomistics

Cannot run metadynamics calculation

Vishwa-adi opened this issue · 3 comments

Please pull the required files from (https://gitlab.mpcdf.mpg.de/samsstud/nobel-prize-project.git) to use Metadynamics and get_job.
The below command was used in the cluster with pyiron/latest (Python3.10) kernel.

from src.metadynamics_1d import Metadynamics
from src.base import get_job
from pyiron_atomistics import Project

pr = Project('Metadynamics')

def add_hydrogen(structure, number:int, pr=pr):
    """
    Add hydrogen atoms randomly in the interstitial sites of the structure and 
    returns the whole structure.
    
    Keyword arguments:
    structure : Array of structure
    number(int) : Number of Hydrogen atoms to be added randomly
    
    Returns: structure
    """
    struc = structure.copy()
    pos = structure.analyse.get_voronoi_vertices()
    index = random.sample(range(0, pos.shape[0]), number)
    
    return struc + pr.create.structure.atoms(elements= number*['H'], 
                            positions=pos[index, :].reshape(-1,3), 
                            cell=struc.cell)

lmp = get_job(pr,add_hydrogen(pr.create.structure.bulk('Ni', cubic=True).repeat(3), 1), job_name=f"test1", run=False)
lmp.calc_md(temperature=300, n_ionic_steps=100000, n_print=1000)
lmp.interactive_open()
meta = lmp.create_job(Metadynamics, f"meta_test1")
meta.input.axis = 0
meta.server.queue = "cm"
meta.server.core = 1 
meta.run()

This gives an error after running the above code.
2024-02-01 11:25:11,173 - pyiron_log - WARNING - Job aborted

The job meta_test1 was saved and received the ID: 21580415


ValueError Traceback (most recent call last)
Cell In[5], line 8
6 meta.server.queue = "cm"
7 meta.server.core = 1
----> 8 meta.run()

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/utils/deprecate.py:171, in Deprecator.__deprecate_argument..decorated(*args, **kwargs)
161 if kw in self.arguments:
162 warnings.warn(
163 message_format.format(
164 "{}.{}({}={})".format(
(...)
169 stacklevel=2,
170 )
--> 171 return function(*args, **kwargs)

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/jobs/job/generic.py:729, in GenericJob.run(self, delete_existing_job, repair, debug, run_mode, run_again)
727 self._run_if_repair()
728 elif status == "initialized":
--> 729 self._run_if_new(debug=debug)
730 elif status == "created":
731 self._run_if_created()

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/jobs/job/generic.py:1244, in GenericJob._run_if_new(self, debug)
1236 def _run_if_new(self, debug=False):
1237 """
1238 Internal helper function the run if new function is called when the job status is 'initialized'. It prepares
1239 the hdf5 file and the corresponding directory structure.
(...)
1242 debug (bool): Debug Mode
1243 """
-> 1244 run_job_with_status_initialized(job=self, debug=debug)

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/jobs/job/runfunction.py:91, in run_job_with_status_initialized(job, debug)
89 else:
90 job.save()
---> 91 job.run()

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/utils/deprecate.py:171, in Deprecator.__deprecate_argument..decorated(*args, **kwargs)
161 if kw in self.arguments:
162 warnings.warn(
163 message_format.format(
164 "{}.{}({}={})".format(
(...)
169 stacklevel=2,
170 )
--> 171 return function(*args, **kwargs)

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/jobs/job/generic.py:731, in GenericJob.run(self, delete_existing_job, repair, debug, run_mode, run_again)
729 self._run_if_new(debug=debug)
730 elif status == "created":
--> 731 self._run_if_created()
732 elif status == "submitted":
733 run_job_with_status_submitted(job=self)

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/jobs/job/generic.py:1255, in GenericJob._run_if_created(self)
1246 def _run_if_created(self):
1247 """
1248 Internal helper function the run if created function is called when the job status is 'created'. It executes
1249 the simulation, either in modal mode, meaning waiting for the simulation to finish, manually, or submits the
(...)
1253 int: Queue ID - if the job was send to the queue
1254 """
-> 1255 return run_job_with_status_created(job=self)

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/jobs/job/runfunction.py:138, in run_job_with_status_created(job)
136 run_job_with_runmode_non_modal(job=job)
137 elif job.server.run_mode.queue:
--> 138 job.run_if_scheduler()
139 elif job.server.run_mode.interactive:
140 job.run_if_interactive()

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/jobs/job/generic.py:774, in GenericJob.run_if_scheduler(self)
767 def run_if_scheduler(self):
768 """
769 The run if queue function is called by run if the user decides to submit the job to and queing system. The job
770 is submitted to the queuing system using subprocess.Popen()
771 Returns:
772 int: Returns the queue ID for the job.
773 """
--> 774 return run_job_with_runmode_queue(job=self)

File /cmmc/ptmp/pyironhb/mambaforge/envs/pyiron_latest/lib/python3.10/site-packages/pyiron_base/jobs/job/runfunction.py:416, in run_job_with_runmode_queue(job)
414 job._logger.warning("Job aborted")
415 job.status.aborted = True
--> 416 raise ValueError("run_queue.sh crashed")
417 state.logger.debug("submitted %s", job.job_name)
418 job._logger.debug("job status: %s", job.status)

ValueError: run_queue.sh crashed

This error was not observed during (Sept~Dec 2023).

Hi @Vishwa-adi, it seems like the submission to the queue failed. This might be related to cmfe being replaced right now - I have to check the slurm scripts.

pmrv commented

For now just replace 'cm' with 'cmti'. I've created a PR for the resources already, but want to double check with Christoph.

I merged the mentioned PR and applied the changes on the cluster. I hope this issue is fixed with this and, thus, I close - reopen if the problem persists.