# ValueError: Error occurred validating port 'inputs': input \`metadata.options.resources\` is not valid for the \`SlurmScheduler\` scheduler

**URL:** <https://aiida.discourse.group/t/valueerror-error-occurred-validating-port-inputs-input-metadata-options-resources-is-not-valid-for-the-slurmscheduler-scheduler/142>\
**Category:** General Usage\
**Created:** [November 2, 2023, 7:18pm UTC](https://aiida.discourse.group/t/valueerror-error-occurred-validating-port-inputs-input-metadata-options-resources-is-not-valid-for-the-slurmscheduler-scheduler/142 "2023-11-02T19:18:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ezio](https://avatars.discourse-cdn.com/v4/letter/e/76d3ee/32.png) [@Ezio](https://aiida.discourse.group/u/Ezio)\
**Post date:** [November 2, 2023, 7:18pm UTC](https://aiida.discourse.group/t/valueerror-error-occurred-validating-port-inputs-input-metadata-options-resources-is-not-valid-for-the-slurmscheduler-scheduler/142/1 "2023-11-02T19:18:25Z")

</div>

Hi Community,  
I hope you all doing well. Apology if you find this question a bit naive.  
I am trying to use aiida-vasp plugin to run my calculations. So, while doing some initial tests to run simple vasp calculations, my vasp workchain keeps getting ‘Excepted’. So as per the documentation, I used the following commands to check the source of the error:

1. verdi config set logging.aiida\_loglevel DEBUG
2. verdi daemon restart
3. python vasp\_test.py

To which I found the following error:  
_ValueError: Error occurred validating port ‘inputs’: input `metadata.options.resources` is not valid for the `SlurmScheduler` scheduler: these parameters were not recognized: num\_machine_

So, I cannot figure out how to solve this. Is this due to some parameter in my Python file, or it is something else?

My python file is as follow:

```auto

# In[9]:

#verdi daemon start

# In[10]:

"""An example call script that performs a single VASP calculations."""
import numpy as np

from aiida import load_profile
from aiida.common.extendeddicts import AttributeDict
from aiida.engine import submit
from aiida.orm import Bool, Code, Str
from aiida.plugins import DataFactory, WorkflowFactory

load_profile()

def get_structure():
    """
    Set up Si primitive cell
    
    Si
      5.431
        0.0000000000000000 0.5000000000000000 0.5000000000000000
        0.5000000000000000 0.0000000000000000 0.5000000000000000
        0.5000000000000000 0.5000000000000000 0.0000000000000000
    Si
      2
    Direct
      0.8750000000000000 0.8750000000000000 0.875000000000000
      0.1250000000000000 0.1250000000000000 0.125000000000000
      
    """
    
    structure_data = DataFactory('core.structure')
    alat = 5.431
    lattice = np.array([[.5, 0, .5], [.5, .5, 0], [0, .5, .5]]) * alat
    structure = structure_data(cell=lattice)
    for pos_direct in ([0.875, 0.875, 0.875], [0.125, 0.125, 0.125]):
        pos_cartesian = np.dot(pos_direct, lattice)
        structure.append_atom(position=pos_cartesian, symbols='Si')
    return structure

def main(code_string, incar, kmesh, structure, potential_family, potential_mapping, options):
    # First we need to fetch the Aiida datatypes which will house the inputs to our calculation
    dict_data = DataFactory('core.dict')
    kpoints_data = DataFactory('core.array.kpoints')
    
    # Then we set theee workchain you would like to call
    workchain = WorkflowFactory('vasp.vasp')
    
    #And finally we declare the options, settings and input containers
    settings = AttributeDict()
    inputs = AttributeDict()
    
    # Organize settings
    settings.parser_settings = {'output_params': ['total_energies', 'maximum_force']}
    
    # Set inputs for the following WorkChain execution
    #Set code
    inputs.code = Code.get_from_string(code_string)
    # Set structure
    inputs.structure = structure
    #Set k-points grid density
    kpoints = kpoints_data()
    kpoints.set_kpoints_mesh(kmesh)
    inputs.kpoints = kpoints
    # Set parameters
    inputs.parameters = dict_data(dict=incar)
    # Set potentials and their mapping
    inputs.potential_family = Str(potential_family)
    inputs.potential_mapping = dict_data(dict=potential_mapping)
    # Set options
    inputs.options = dict_data(dict=options)
    #333 Set settings
    inputs.settings = dict_data(dict=settings)
    # Set workchain related inputs, in this casee, give more explicit output to report
    inputs.verbose = Bool(True)
    # Suuubmit the requested workchain with the supplied inputs
    output = submit(workchain, **inputs)
    print(output)
    
if __name__ == ' __main__':
    # Code_string is chosen among the list given by 'verdi code list'
    CODE_STRING = 'vasp@narval'
    
    # POSCAR equivalent
    # Set silicon struture
    STRUCTURE = get_structure()
    
    # INCAR equivalent
    # Set input parameters
    INCAR = {'incar': {'prec': 'NORMAL', 'encut': 200, 'ediff': 1E-4, 'ialgo': 38, 'ismear': -5, 'sigma': 0.1}}
    
    # KPOINTS equivalent
    # Set kpoint mesh
    KMESH = [9, 9, 9]
    
    # POTCAR quivalent
    # Potential_family is chosen among the list given by 'vardi dat vasp-potcar listfamilies'
    POTENTIAL_FAMILY = 'PBE.54'
    # The potential mapping selects which potential to use, here we use the standard for silicon, this could for
    # instance be {'Si': 'Si_GW'} to use the GW ready potential instead
    POTENTIAL_MAPPING = {'Si': 'Si'}
    
    # Jobfile equivalent
    #In options, we typically set scheduler options.
    # AttributeDict is just a special dictionary with the extra benefit that you can set and get the key contents 
    # with mydict.mykey instead of mydict['mykey']
    OPTIONS = AttributeDict()
    OPTIONS.account = ''
    OPTIONS.qos = ''
    OPTIONS.resources = {'num_machine': 1, 'num_mpiprocs_per_machine': 1}
    OPTIONS.queue_name = ''
    OPTIONS.max_wallclock_seconds = 3600
    OPTIONS.max_memory_kb = 10240000
    
    main(CODE_STRING, INCAR, KMESH, STRUCTURE, POTENTIAL_FAMILY, POTENTIAL_MAPPING, OPTIONS)

```

---

<div class="post-metadata">

**Author:** ![jusong.yu](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/jusong.yu/32/3_2.png) [@jusong.yu](https://aiida.discourse.group/u/jusong.yu)\
**Post date:** [November 2, 2023, 8:11pm UTC](https://aiida.discourse.group/t/valueerror-error-occurred-validating-port-inputs-input-metadata-options-resources-is-not-valid-for-the-slurmscheduler-scheduler/142/2 "2023-11-02T20:11:45Z")

</div>

Hi Ezio,

I think there is a typo in the options resource setting, the key for the number of machines is ‘num\_machines’. You can find the scheduler documentation on [Batch Job Schedulers — AiiDA 2.4.0.post0 documentation](https://aiida.readthedocs.io/projects/aiida-core/en/latest/topics/schedulers.html?highlight=num_machines)

Let me know if this solve the problem.

Best,  
Jason

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/aiida/original/1X/c417197d3750949351575d03ed03f5e2ad32e649.png) [@system](https://aiida.discourse.group/u/system)\
**Post date:** [November 3, 2023, 5:50pm UTC](https://aiida.discourse.group/t/valueerror-error-occurred-validating-port-inputs-input-metadata-options-resources-is-not-valid-for-the-slurmscheduler-scheduler/142/3 "2023-11-03T17:50:55Z")

</div>

This topic was automatically closed 4 hours after the last reply. New replies are no longer allowed.
