Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing a grouping feature to organize flow operations #114

Merged
merged 156 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from 151 commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
9ff7c74
Enables the creation and registering of groups.
b-butler May 22, 2019
ebfca36
Adding function to create group CL arg.
b-butler May 30, 2019
b6edd34
First functioning group submit.
b-butler Jun 3, 2019
93a35e6
Adding support for groups in run command.
b-butler Jun 4, 2019
48c89f2
Adding script support for group option.
b-butler Jun 4, 2019
d2e7d9a
Adding support for command options.
b-butler Jun 4, 2019
78373d5
Adding new methods to FlowGroup.
b-butler Jun 12, 2019
d542d55
Adding bundling, exec_mode, op group conversion.
b-butler Jun 17, 2019
59e9336
Changed JobOperation implimentation.
b-butler Jun 25, 2019
28d9b34
Integration of operation and group execution path.
b-butler Jun 26, 2019
080abe3
Adding group support for run command.
b-butler Jun 26, 2019
191e8c6
Adding support for groups in submit function.
b-butler Jun 26, 2019
6530e1b
Adding requested revisions
b-butler Jun 30, 2019
2ccfaeb
Changing _verify_group_compatibility logic.
b-butler Jul 1, 2019
1d97f5b
Adding after condition for groups.
b-butler Jul 2, 2019
8c58b26
Working on fixing bugs unit tests reveal.
b-butler Jul 9, 2019
1b5b878
Changing run behavior always to exec mode.
b-butler Jul 9, 2019
be46aae
Changing groups behavior to pass tests.
b-butler Jul 10, 2019
c024270
Added small changes in tests to match new implementations.
b-butler Jul 10, 2019
6799e08
Fixing error in retrieving function path.
b-butler Jul 10, 2019
38347b6
Adding '--exec' option to `_main_script` test.
b-butler Jul 10, 2019
f9d9813
Changing yield from to yield with a for loop for py2.
b-butler Jul 10, 2019
a8a549c
Raising error if operation is added to group twice.
b-butler Jul 11, 2019
c074f55
Changing way group operations are joined for getting id.
b-butler Jul 11, 2019
d956c12
Adding regex support for selecting groups and operations
b-butler Jul 12, 2019
64ca5ab
Making groups resubmit safe
b-butler Jul 22, 2019
e25fe3d
Test main_submit and change dynamic tests
b-butler Aug 2, 2019
201314d
Remove redundant expansion of operation names in _main_run
b-butler Aug 9, 2019
6e2d608
test_main_submit for groups with with multiple calls.
b-butler Aug 13, 2019
9700f77
Change `FlowGroup.get_id` to `FlowGroup._generate_id`
b-butler Aug 14, 2019
d7df58b
Singleton `FlowGroup`s and move directives to `FlowGroup`s
b-butler Aug 14, 2019
5c8de16
Remove group specific status.
b-butler Aug 14, 2019
45ef91c
Move schedule status checks to group level.
b-butler Aug 19, 2019
a28b862
Fix cmd-operations.
csadorf Aug 29, 2019
3a524a4
Initial check for prior group submission
b-butler Aug 30, 2019
c2996b1
Create two paths for gathering JobOperations
b-butler Aug 30, 2019
e165321
Remove obsolete doc-string entry.
csadorf Aug 30, 2019
accc0b3
Fix JobOperation.__repr__().
csadorf Aug 30, 2019
fa8664f
Flip the FlowOperation constructor calls.
csadorf Aug 30, 2019
3e279a5
Reorganize the FlowGroup exec mode exception flow.
csadorf Aug 30, 2019
b74530d
Refactor run-cmd generation and fix one bug.
csadorf Aug 30, 2019
a140790
Misc. improvements and optimizations.
csadorf Aug 30, 2019
37adda7
Change finding of FlowGroup path to use stack.
b-butler Aug 30, 2019
06dde88
Keep track of module path during FlowProject object instantiation..
csadorf Aug 30, 2019
3005c35
Change test strings to match new output and new pathfinding method
b-butler Aug 30, 2019
429ec3e
Removing test_group files from branch.
b-butler Sep 4, 2019
f014d67
Refactor run logic in FlowGroups.
b-butler Sep 4, 2019
cf7f416
Adding path and entrypoint attributes to FlowProject.
b-butler Sep 4, 2019
e036139
Addressing new path/entrypoint motif with test_templates
b-butler Sep 5, 2019
b707ad5
`FlowGroup` and `JobOperation` __repr__ methods fix/add
b-butler Sep 5, 2019
daabf0d
Update flow/errors.py
b-butler Sep 5, 2019
f0e42ca
Update docstring JobOperation.
b-butler Sep 5, 2019
9f97ccf
Setup FlowProject._entrypoint as a dict
b-butler Sep 5, 2019
b46e437
Using yield from to iterate over operations FlowGroups
b-butler Sep 5, 2019
2f8fb09
Move cmd evaluation to when it is asked for.
b-butler Sep 5, 2019
7611b48
Change add_operation of FlowProject to make group as well
b-butler Sep 5, 2019
16f44ea
Adding entrypoint argument to derived classes for tests
b-butler Sep 5, 2019
4c71372
Reverting make_bundles
b-butler Sep 5, 2019
cc3fc01
Fixing docstring for next_operation
b-butler Sep 5, 2019
a188859
Fixing store_bundled bug
b-butler Sep 5, 2019
ab85817
str check in JobOperation cmd property
b-butler Sep 5, 2019
1fe7a2a
Callable directive support for entrypoints.
b-butler Sep 5, 2019
0fe3694
Using _collect_operations for _register_groups
b-butler Sep 5, 2019
bdac061
Order statuses after grabbing all operation statuses
b-butler Sep 5, 2019
738e9a9
Change operations to OrderedDict in _gather_flow_groups
b-butler Sep 6, 2019
9a3efd8
Add documentation
b-butler Oct 31, 2019
73247f2
Add error catching back to test
b-butler Oct 31, 2019
98069e9
Make eligible_for_submission not user facing
b-butler Jan 16, 2020
b6721c5
Add fork whitelisting from directives
b-butler Jan 16, 2020
7868988
Merge branch 'master' into groups
b-butler Jan 31, 2020
420266d
Fix errors introduced by merge.
b-butler Jan 31, 2020
ce5b70e
Fix typos and style errors
b-butler Jan 31, 2020
242aa71
Cleanup ``FlowGroup`` some
b-butler Jan 31, 2020
be074e3
Change ``FlowGroup.intersects`` to ``FlowGroup.isdisjoint``
b-butler Jan 31, 2020
9e999aa
Fix typo in function name
b-butler Jan 31, 2020
05fbcc1
Move checking of conflicting group names earlier
b-butler Jan 31, 2020
d635b83
Remove ability to specify exec and run command generation
b-butler Feb 1, 2020
869bdf7
Remove exec mode
b-butler Feb 2, 2020
093371c
Remove cmd_prefix and get_prefix from templates
b-butler Feb 2, 2020
c0d4266
All submitted jobs to ignore_conditions
b-butler Feb 2, 2020
80577df
Use `FlowGroup.create_run_job_operations` for run
b-butler Feb 3, 2020
9d12359
Add operation specific directives
b-butler Feb 3, 2020
2e02a53
Add operations to `FlowProject._GROUP_NAMES`
b-butler Feb 3, 2020
f698999
Change group registering logic
b-butler Feb 3, 2020
c2a6dd6
Submission resource aggregation and group default directives
b-butler Feb 7, 2020
71fa088
Change Stampede2Environment for group parallel jobs
b-butler Feb 7, 2020
17af8ec
Fix bug in correctly handling directives with Groups
b-butler Feb 10, 2020
6c62ce2
Fix group decorator to work with directives
b-butler Feb 10, 2020
ad90478
Make function for resolving FlowGroup directives
b-butler Feb 10, 2020
b1dbdd9
Update flow/project.py
b-butler Feb 11, 2020
3d24889
Fix submission resource aggregation bug
b-butler Feb 12, 2020
12f8268
Create FlowGroupEntry class
b-butler Feb 13, 2020
89bbf26
Convert groups branch to pytest
b-butler Feb 13, 2020
141846e
Remove directives from FlowGroups
b-butler Feb 13, 2020
dfa078d
Add return type documentation.
b-butler Feb 13, 2020
f24422f
Make default_directives required for create_run_job_operations
b-butler Feb 13, 2020
12b629c
Update creation of submission JobOperations
b-butler Feb 13, 2020
5d99a58
Add tests for directives handling
b-butler Feb 13, 2020
94fbab4
fix FlowGroupEntry bug and add documentation
b-butler Feb 13, 2020
a839f82
Fix bug in FlowProject._resolve_directives
b-butler Feb 13, 2020
34818d1
Fix bug on submission command generation
b-butler Feb 13, 2020
7099e8c
Apply suggestions from code review
b-butler Feb 17, 2020
4db0a8b
Remove ``ScriptError`` (wasn't used).
b-butler Feb 17, 2020
41fe27c
Add get_id back to ``JobOperation`` and id property
b-butler Feb 17, 2020
da46f51
Update *Operation docstrings and ``FlowGroup`` docstrings
b-butler Feb 17, 2020
9d5e774
Change _flow_group to _flow_groups
b-butler Feb 17, 2020
dd13329
Remove redundant calls to .keys() for dict
b-butler Feb 17, 2020
4d79dfa
Modify `~FlowGroupEntry~.with_directives` function
b-butler Feb 17, 2020
23cbc22
Change default parameter values ``FlowGroup.__init__``
b-butler Feb 17, 2020
302d1ce
Change entrpoint priority
b-butler Feb 17, 2020
3b6f613
Move to string logic into IgnoreConditions
b-butler Feb 17, 2020
f2aab3a
Style changes
b-butler Feb 17, 2020
6942f92
Remove redundant deprecated call
b-butler Feb 17, 2020
94adc2f
Change group test project class names
b-butler Feb 17, 2020
23fde7c
Merge branch 'master' into groups
b-butler Feb 17, 2020
bead718
Fix bug in submission cmd string generation
b-butler Feb 17, 2020
2bb298b
Apply suggestions from code review
b-butler Feb 18, 2020
ee97036
Return function after FlowGroupEntry decorator
b-butler Feb 18, 2020
eb2c7eb
Add FlowGroup to docs
b-butler Feb 18, 2020
8a74ac2
Remove get calls in get_status functions
b-butler Feb 18, 2020
e7b1670
Edit docstrings and change argument name
b-butler Feb 18, 2020
ec7b7a2
Fix bug with get_status
b-butler Feb 18, 2020
fe69407
Used define_test_project for groups too
b-butler Feb 18, 2020
9991800
Update tests for using groups
b-butler Feb 18, 2020
d3c1894
Fix entrypoint for group tests
b-butler Feb 18, 2020
5e32098
Don't evaluate entrypoint in run_cmd until necessary
b-butler Feb 18, 2020
31fee5a
Change tests to use mock_project more fully
b-butler Feb 18, 2020
f4ca176
Fix next_operations tests for new project class
b-butler Feb 18, 2020
404bf84
Remove op5 from test project definition
b-butler Feb 18, 2020
871510e
Fix error from inconistent naming
b-butler Feb 19, 2020
1cf6c6b
Fix errors with testing
b-butler Feb 19, 2020
aee0fe0
Fix error on CI.
b-butler Feb 19, 2020
12fd2b8
Revert "Fix error on CI."
b-butler Feb 19, 2020
f28e386
Use __file__ to determine entrypoint for tests
b-butler Feb 19, 2020
98ff1f1
Remove group specific test project
b-butler Feb 19, 2020
3ac8463
Apply suggestions from code review
b-butler Feb 19, 2020
00328e8
Update FlowGroup and FlowProject API docs
b-butler Feb 19, 2020
dcc697e
Rename methods for creating JobOperation from FlowGroup
b-butler Feb 19, 2020
a61e57b
Revert previous changes __init__.py and errors.py
b-butler Feb 19, 2020
60c31d1
make FlowGroupEntry.with_directives take a single dict
b-butler Feb 19, 2020
b2320d5
Change cmd error checking to init : JobOperation
b-butler Feb 19, 2020
a07aace
Update docstrings, help strings, and comments
b-butler Feb 19, 2020
a9e2351
Only add --ignore-conditions when necessary
b-butler Feb 19, 2020
a3633c7
Fix error where groups were not run in parallel
b-butler Feb 19, 2020
351f481
Fix test to work with python 3.5
b-butler Feb 19, 2020
4b3c2bd
Change test_main_status to not be order sensitive for operations
b-butler Feb 19, 2020
f41f09a
Update flow/project.py
b-butler Feb 19, 2020
ee45c0d
Fix FlowGroup.options and __repr__
b-butler Feb 20, 2020
0d61ef2
Add comment explaining use of lazy cmd in JopOperation
b-butler Feb 20, 2020
02ecd0e
Make TestGroupProject.test_flowgroup_repr not run in Python 3.5
b-butler Feb 20, 2020
3165989
Make test_flowgroup_repr not order dependent
b-butler Feb 20, 2020
1ab20b0
Update flow/project.py
b-butler Feb 21, 2020
d312619
Update FlowGroup API docs
b-butler Feb 21, 2020
8b80519
Update template tests
b-butler Feb 21, 2020
b63c252
final changes
b-butler Feb 21, 2020
a82a77d
change changelog
b-butler Feb 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The FlowProject
FlowProject.label
FlowProject.labels
FlowProject.main
FlowProject.make_group
FlowProject.next_operation
FlowProject.next_operations
FlowProject.operation
Expand Down Expand Up @@ -139,3 +140,16 @@ flow.get_environment()
----------------------

.. autofunction:: get_environment

The FlowGroup
----------

.. autoclass:: flow.project.FlowGroup

.. automethod:: flow.project.FlowGroup.add_operation

.. automethod:: flow.project.FlowGroup.complete

.. automethod:: flow.project.FlowGroup.eligible

.. automethod:: flow.project.FlowGroup.isdisjoint
b-butler marked this conversation as resolved.
Show resolved Hide resolved
14 changes: 9 additions & 5 deletions flow/environments/xsede.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Stampede2Environment(DefaultSlurmEnvironment):
template = 'stampede2.sh'
cores_per_node = 48
mpi_cmd = 'ibrun'
offset_counter = 0

@classmethod
def add_args(cls, parser):
Expand Down Expand Up @@ -84,13 +85,16 @@ def _get_mpi_prefix(cls, operation, parallel):
"""
if operation.directives.get('nranks'):
if parallel:
return '{} -n {} -o {} task_affinity '.format(
cls.mpi_cmd, operation.directives['nranks'],
operation.directives['np_offset'])
prefix = '{} -n {} -o {} task_affinity '.format(
cls.mpi_cmd, operation.directives['nranks'],
cls.offset_counter)
cls.offset_counter += operation.directives['nranks']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It concerns me that doing multiple submissions from this class could result in a script beginning with offset_counter > 0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submissions won't use the counter. This only used within run and as far as that goes, I can't see where you would want to reset the offset when running in parallel.

else:
return '{} -n {} '.format(cls.mpi_cmd, operation.directives['nranks'])
prefix = '{} -n {} '.format(cls.mpi_cmd,
operation.directives['nranks'])
else:
return ''
prefix = ''
return prefix
b-butler marked this conversation as resolved.
Show resolved Hide resolved


class BridgesEnvironment(DefaultSlurmEnvironment):
Expand Down
Loading