idmtools_platform_local.internals.task_functions.general_task module

idmtools local platform task tools.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

idmtools_platform_local.internals.task_functions.general_task.run_task(command: str, current_job: JobStatus, experiment_uuid: str, simulation_path: str, simulation_uuid: str) Status

Executes the command and record its status in the database.

Parameters:
  • command – command to run

  • current_job – The JobStatus object to update

  • experiment_uuid – experiment id

  • simulation_path – Base root of the simulation execution path

  • simulation_uuid – Simulation Id

Returns:

(Status) Status of the job. This is determine by the system return code of the process

idmtools_platform_local.internals.task_functions.general_task.extract_status(experiment_uuid: str, return_code: int, simulation_uuid) Status

Extract status from a completed process.

Parameters:
  • experiment_uuid – Id of experiment(needed to update job info)

  • return_code – Return Code for item

  • simulation_uuid – Simulation id of the task

Returns:

(Status) Status of the job

idmtools_platform_local.internals.task_functions.general_task.get_current_job(experiment_uuid, simulation_uuid, command)

Get our current job running.

Parameters:
  • experiment_uuid – Experiment to lookup

  • simulation_uuid – Simulation to lookup

  • command – Command we are running.

Returns:

Current job.

idmtools_platform_local.internals.task_functions.general_task.is_canceled(current_job)

Has the job been marked as canceled?

Parameters:

current_job – Job to check

Returns:

True if canceled, false otherwise.

idmtools_platform_local.internals.task_functions.general_task.execute_simulation(command, experiment_uuid, simulation_uuid)

Runs our task and updates status.

Parameters:
  • command – Command string to execute

  • experiment_uuid – Experiment id of task

  • simulation_uuid – Simulation id of task

Returns:

Task result