pyiron.base.server package

Submodules

pyiron.base.server.generic module

class pyiron.base.server.generic.Server(host=None, queue=None, cores=1, threads=1, run_mode='modal', new_hdf=True)[source]

Bases: pyiron.base.generic.template.PyironObject

Generic Server object to handle the execution environment for the job

Parameters:
  • host (str) – hostname of the local machine
  • queue (str) – queue name of the currently selected queue
  • cores (int) – number of cores
  • run_mode (str) – mode of the job [‘modal’, ‘non_modal’, ‘queue’, ‘manual’]
  • new_hdf (bool) – create a new HDF5 file [True/False] - default=True
.. attribute:: send_to_db

boolean option to decide which jobs should be store in the external/public database.

.. attribute:: structure_id

the structure ID to be linked to an external/public database.

.. attribute:: host

the hostname of the current system.

.. attribute:: queue

the que selected for a current simulation.

.. attribute:: cores

the number of cores selected for the current simulation.

.. attribute:: run_time

the run time in seconds selected for the current simulation.

.. attribute:: run_mode

the run mode of the job [‘modal’, ‘non_modal’, ‘queue’, ‘manual’]

.. attribute:: new_hdf

defines whether a subjob should be stored in the same HDF5 file or in a new one.

accept_crash
cores

The number of cores selected for the current simulation

Returns:number of cores
Return type:(int)
db_entry()[source]

connect all the info regarding the server into a single word that can be used e.g. as entry in a database

Returns:server info as single word
Return type:(str)
from_hdf(hdf, group_name=None)[source]

Recover Server object in HDF5 file

Parameters:
  • hdf – HDF5 object
  • group_name – node name in the HDF5 file
static list_queues()[source]

List the available Job scheduler provided by the system.

Returns:(list)
memory_limit
new_hdf

New_hdf5 defines whether a subjob should be stored in the same HDF5 file or in a new one.

Returns:[True / False]
Return type:(bool)
queue

The que selected for a current simulation

Returns:schedulers_name
Return type:(str)
queue_id

Get the queue ID - the ID in the queuing system is most likely not the same as the job ID.

Returns:queue ID
Return type:int
queue_list

List the available Job scheduler provided by the system.

Returns:(list)
queue_view

List the available Job scheduler provided by the system.

Returns:(pandas.DataFrame)
run_mode

Get the run mode of the job

Returns:[‘modal’, ‘non_modal’, ‘queue’, ‘manual’]
Return type:(str)
run_time

The run time in seconds selected for the current simulation

Returns:run time in seconds
Return type:(int)
send_to_db

Get the boolean option to decide which jobs should be store in the external/public database

Returns:[True/False]
Return type:bool
structure_id

Get the structure ID to be linked to an external/public database

Returns:structure ID
Return type:int
threads
to_hdf(hdf, group_name=None)[source]

Store Server object in HDF5 file

Parameters:
  • hdf – HDF5 object
  • group_name (str) – node name in the HDF5 file
static view_queues()[source]

List the available Job scheduler provided by the system.

Returns:(pandas.DataFrame)

pyiron.base.server.queuestatus module

pyiron.base.server.queuestatus.queue_check_job_is_waiting_or_running(item)[source]

Check if a job is still listed in the queue system as either waiting or running.

Parameters:item (int, GenericJob) – Provide either the job_ID or the full hamiltonian
Returns:[True/False]
Return type:bool
pyiron.base.server.queuestatus.queue_delete_job(item)[source]

Delete a job from the queuing system

Parameters:item (int, pyiron.base.job.generic.GenericJob) – Provide either the job_ID or the full hamiltonian
Returns:Output from the queuing system as string - optimized for the Sun grid engine
Return type:str
pyiron.base.server.queuestatus.queue_enable_reservation(item)[source]

Enable a reservation for a particular job within the queuing system

Parameters:item (int, pyiron.base.job.generic.GenericJob) – Provide either the job_ID or the full hamiltonian
Returns:Output from the queuing system as string - optimized for the Sun grid engine
Return type:str
pyiron.base.server.queuestatus.queue_info_by_job_id(job_id)[source]

Display the queuing system info of job by qstat | grep shell command as dictionary

Parameters:requested_id (int) – query for a specific job_id
Returns:Dictionary with the output from the queuing system - optimized for the Sun grid engine
Return type:dict
pyiron.base.server.queuestatus.queue_is_empty()[source]

Check if the queue table is currently empty - no more jobs to wait for.

Returns:True if the table is empty, else False - optimized for the Sun grid engine
Return type:bool
pyiron.base.server.queuestatus.queue_table(job_ids=[], project_only=True)[source]

Display the queuing system table as pandas.Dataframe

Parameters:
  • job_ids (list) – check for a specific list of job IDs - empty list by default
  • project_only (bool) – Query only for jobs within the current project - True by default
Returns:

Output from the queuing system - optimized for the Sun grid engine

Return type:

pandas.DataFrame

pyiron.base.server.queuestatus.wait_for_job(job, interval_in_s=5, max_iterations=100)[source]

Sleep until the job is finished but maximum interval_in_s * max_iterations seconds.

Parameters:
  • job (pyiron.base.job.generic.GenericJob) – Job to wait for
  • interval_in_s (int) – interval when the job status is queried from the database - default 5 sec.
  • max_iterations (int) – maximum number of iterations - default 100

pyiron.base.server.runmode module

Runmode class defines the different modes a pyiron job can be executed in

class pyiron.base.server.runmode.Runmode(mode='modal')[source]

Bases: object

Run mode describes how the job is going to be executed: - modal: the interactive run mode - non_modal: sending the job to the background on the same machine - queue: submit the job to the queuing system - manual: let the user manually execute the job - thread: internal job mode, which is selected when the master job is send to the queue. - interactive: the interactive run mode :param mode: [‘modal’, ‘non_modal’, ‘queue’, ‘manual’, ‘thread’, ‘interactive’] :type mode: str

mode

Get the run_mode of the job :returns: [‘modal’, ‘non_modal’, ‘queue’, ‘manual’, ‘thread’, ‘interactive’] :rtype: str

Module contents