|
I am trying to run a python script that will perform multiple calculations on a set of structures pulled from the simmate database. I've looked through the documentation to do this in python with simmate, but when I run the calculations, they are still running in the folders "simmate-task-********". To be able to effectively parse through this data, I need to know the structure and type of calculation for each. When testing in spyder is does make the variable that I want (my directory name) but in reality the directories that the calculations are running are still random. I've tried this two ways, one is commented out: |
Replies: 1 comment
how to set directoryYou are doing things correctly! (and don't worry -- I have a good guess as to why you're having issues below) For others that end up in this thread here are the docs. And examples: # OPTION 1
status = relax_workflow.run_cloud(
directory = structure.formula_reduced+"_relax",
...
)
# OPTION 2
status = relax_workflow.run_cloud(
directory = Path(structure.formula_reduced+"_relax")
...
)The "hidden" issue that you're seeingBut because you're still seeing other jobs run that don't have directory set, I'm guessing these are OLD jobs you submitted. So did you submit a bunch of workflows before submitting the ones that had directory set? Or are you sharing a database with someone else that is submitting jobs? If either of these happened, your worker is picking up old or other jobs and NOT the one you just submitted and expected. Check to see what the queue looks like and clear it if you'd like with some of these commands: # check the commands available and their descriptions
simmate engine --help
# see what the job queue looks like (i.e. see if old jobs are hanging around!)
simmate engine show-stats
# delete all the jobs in the queue so you can have a clean slate
# BUT do not do this if you're sharing a queue with others! It'll delete ALL jobs
simmate engine delete-allbest-practiceIt's risky to set your directory name because you might accidentally overwrite old runs. Make sure none of your structures have a matching reducing formula! And also if you ever want to 'retry' this script, it will write over your first attempt and vasp might mistake things as a continuation calc with old files. It's better to leave folders with their random unique names and then check the database for where your desired folder is: from simmate.database import connect
from simmate.database.workflow_results import Relaxation
results = Relaxation.objects.to_dataframe()
results .to_csv("my_relax_results.csv")There will be a 'directory' column that tells you where to find your files for a given structure. There will be a lot of other columns for you too (such as chemical formula, density, etc.) |
how to set directory
You are doing things correctly! (and don't worry -- I have a good guess as to why you're having issues below)
For others that end up in this thread here are the docs. And examples:
The "hidden" issue that you're seeing
But because you're still seeing other jobs run that don't have directory set, I'm guessing these are OLD jobs you submitted. So did you submit a bunch of workflows before submitting the ones that had directory set? Or are you sharing a…