Getting started - command line interface
This example illustrates a sample workflow using the pre-implemented dummy engine. To make use of it please configure the .strucscan configuration file and copy it in your home directory. You can use the template that comes by default with the repository and link the absolute paths to the structure and resource repository to the default ones from the repository.
[1]:
! cat ../.strucscan
PROJECT_PATH: "data" # corresponds to the top node of your data tree
STRUCTURES_PATH: "structures"
RESOURCE_PATH: "resources"
DEBUG: FALSE # Default: FALSE
STRUCT_FILE_FORMAT: cfg # Default: cfg
SLEEP_TIME: 45 # Default: 45
In general, you might want to adapt the .strucscan to your own structure and resource directory and set up a resource directory accordingly. For now, you do not need to worry about it and we will discuss it later. This example demonstrates how to use strucscan with the command line interface.
The input YAML
All information about the calculations you want to perform is handed over to strucscan in form of a YAML file, just as with using strucscan via the Jupyter notebook interface. It requires the same mandatory keys and allows optional ones just as the input dictionary. Optional keys are set to the default value if left out. Each value needs to be of type string unless it is a boolean. The mandatory and optional keys should be already known from the first example. To get started we have a look
at an example input YAML for our dummy engine:
[2]:
! cat dummy.yaml
species: 'Al'
engine: 'dummy'
machine: 'dummy'
initial atvolume: 'default'
ncores: '1'
nnodes: '1'
queuename: 'none'
properties: 'static atomic total eos'
prototypes: 'fcc.cfg'
potential: 'none'
settings: 'none'
verbose: True
When comparing to the syntax of the input dictionary used by the Jupyter notebook interface, the similarity should be clear. In the input YAML, we only set the verbose tag already to True, so we have a little more insight.
[3]:
from strucscan.resources.inputyaml import DUMMY
DUMMY().EXAMPLE
[3]:
{'species': 'Al',
'engine': 'dummy',
'machine': 'dummy',
'initial atvolume': 'default',
'ncores': '1',
'nnodes': '1',
'queuename': 'none',
'properties': 'static atomic total eos',
'prototypes': 'fcc.cfg',
'potential': 'none',
'settings': 'none'}
Command line interface
By defining the input YAML properly the first step is already done. The next and last step is only to call strucscan from command line and let it do the work for us:
[4]:
! strucscan dummy.yaml
Data tree path: /home/users/pietki8q/git/strucscan-master/data
Structure repository: /home/users/pietki8q/git/strucscan-master/structures
Resource repository: /home/users/pietki8q/git/strucscan-master/resources
Optional key 'monitor' not provided. Default value will be used: True
Optional key 'submit' not provided. Default value will be used: True
Optional key 'collect' not provided. Default value will be used: True
key: : your input what strucscan reads
----------------------------------------------------------------------------------------------------
species : Al Al
engine : dummy dummy
machine : dummy dummy
initial atvolume : default default
ncores : 1 1
nnodes : 1 1
queuename : none none
properties : static atomic total eos static atomic total eos_total
prototypes : fcc.cfg fcc.cfg
potential : none none
settings : none none
verbose : True True
monitor : (not set) True
submit : (not set) True
collect : (not set) True
>> Initializing:
Initialized Al static
Initialized Al static
Initialized Al atomic
Initialized Al total
Initialized Al eos_total
4 jobs in JobList:
------------------------------------------------------------------------------------------------------------------
#: jobpath prototype path
------------------------------------------------------------------------------------------------------------------
0: DUMMY/Al/static__fcc__Al unaries/bulk/fcc.cfg
1: DUMMY/Al/eos_total__fcc__Al DUMMY/Al/total__fcc__Al/final.cfg
2: DUMMY/Al/total__fcc__Al DUMMY/Al/atomic__fcc__Al/final.cfg
3: DUMMY/Al/atomic__fcc__Al DUMMY/Al/static__fcc__Al/final.cfg
#: jobpath id status start end
------------------------------------------------------------------------------------------------------------------
0 DUMMY/Al/static__fcc__Al None does not exist
1 DUMMY/Al/eos_total__fcc__Al None does not exist
2 DUMMY/Al/total__fcc__Al None does not exist
3 DUMMY/Al/atomic__fcc__Al None does not exist
>> Entering loop:
Submitted: static__fcc__Al
Submitted: atomic__fcc__Al
#: jobpath id status start end
------------------------------------------------------------------------------------------------------------------
0 DUMMY/Al/static__fcc__Al None finished 06/22/2022 09:58
1 DUMMY/Al/eos_total__fcc__Al None does not exist
2 DUMMY/Al/total__fcc__Al None does not exist
3 DUMMY/Al/atomic__fcc__Al None finished 06/22/2022 09:58
Submitted: total__fcc__Al
#: jobpath id status start end
------------------------------------------------------------------------------------------------------------------
0 DUMMY/Al/static__fcc__Al None finished 06/22/2022 09:58
1 DUMMY/Al/eos_total__fcc__Al None does not exist
2 DUMMY/Al/total__fcc__Al None finished 06/22/2022 09:59
3 DUMMY/Al/atomic__fcc__Al None finished 06/22/2022 09:58
Submitted: eos_total__fcc__Al
#: jobpath id status start end
------------------------------------------------------------------------------------------------------------------
0 DUMMY/Al/static__fcc__Al None finished 06/22/2022 09:58
1 DUMMY/Al/eos_total__fcc__Al None finished 06/22/2022 09:59
2 DUMMY/Al/total__fcc__Al None finished 06/22/2022 09:59
3 DUMMY/Al/atomic__fcc__Al None finished 06/22/2022 09:58
Finished.
[ ]: