seisflows.workflow.test_flow

This is a SeisFlows Test workflow class which is used to test out the underlying System machinery for a given set of modules.

TestFlow is intended for development and debugging purposes. It is used to ensure that these tasks are not done on large-scale, compute-intensive jobs.

Classes

TestFlow

TestFlow Workflow

Module Contents

class seisflows.workflow.test_flow.TestFlow(modules=None, workdir=os.getcwd(), path_output=None, **kwargs)

TestFlow Workflow

Test individual sub-modules in a ‘live’ testing environment in order to ensure SeisFlows works appropriately given an established system and solver.

Current functionality:
  • Submit a test function (‘hello world’) to the System

  • Monitor job queue for successful job completion

  • Submit an intentionally failing job and catch job failure

Note

You do not need to set System parameters ntask, nproc, tasktime, walltime. These will be overwritten by the setup task.

Parameters

Paths

type workdir:

str

param workdir:

working directory in which to perform a SeisFlows workflow. SeisFlows internal directory structure will be created here. Default cwd

type path_output:

str

param path_output:

path to directory used for permanent storage on disk. Results and expored scratch files are saved here.

***

_modules = None
path
property task_list

A task list which includes tests for most of the modules depending on whether they’re included in the module list or not.

check()

Run check functions for all underlying modules

setup()

Creates required directory structure

run()

Run through the task list which should consist of various test functions which are meant to ensure SeisFlows works in a live working environment without committing a large number of resources

test_system_print_hello_world()

Use the system to run a simple print function which names the currently running task id to check that task id printing works. Check that the output log messages show the correct task id and log statement

test_single_job_failure()

Test a single job run with built in failure to ensure that single job run call modifications work and can be caught.

test_partial_array_job_failure()

Test that partial array job failures will cause the entire main job to crash. Catch the resulting error to make sure Testflow can continue

test_array_job_rerun()

Test that partial array job failures will cause the entire main job to crash. The idea behind this function is that we want a job to fail once, and then pass on the second attempt. Because of the architecture of the failure recovery mechanism, we cannot incremenet a counter to check if the job has been rereun, so we check that the correct amount of log files has been produced