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

resrc: Add resource API context support #236

Merged
merged 2 commits into from
Mar 2, 2017
Merged

resrc: Add resource API context support #236

merged 2 commits into from
Mar 2, 2017

Conversation

dongahn
Copy link
Member

@dongahn dongahn commented Feb 28, 2017

Add resource API context support + some minor cleanup

Add get_resrc_reqst and move the logic to fill resrc_reqst to
this function.

Enhance readability of schedule_job which has grown somewhat large.

More importantly, being ready to encode resource aggregate
info without having to modify the main schedule_job function.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 72.998% when pulling fb002e3 on dongahn:resrc_api_context into 7b95852 on flux-framework:master.

@codecov-io
Copy link

codecov-io commented Feb 28, 2017

Codecov Report

Merging #236 into master will increase coverage by 0.24%.
The diff coverage is 71.75%.

@@            Coverage Diff            @@
##           master    #236      +/-   ##
=========================================
+ Coverage   55.05%   55.3%   +0.24%     
=========================================
  Files          25      25              
  Lines        5184    5204      +20     
  Branches     1168    1181      +13     
=========================================
+ Hits         2854    2878      +24     
+ Misses       1626    1616      -10     
- Partials      704     710       +6
Impacted Files Coverage Δ
resrc/resrc.h 100% <ø> (ø)
resrc/resrc_reqst.c 75.29% <100%> (ø)
resrc/resrc_flow.c 32.79% <52.5%> (+0.6%)
sched/sched.c 56.11% <66.66%> (-0.19%)
sched/sched_backfill.c 78.52% <68.42%> (+0.29%)
sched/rsreader.c 78.67% <70.58%> (+0.64%)
sched/sched_fcfs.c 78.75% <71.42%> (+0.54%)
resrc/resrc_tree.c 71.22% <72.72%> (-0.28%)
resrc/resrc.c 70.87% <82.14%> (+2.21%)
src/common/libutil/shortjansson.h 61.66% <0%> (-3.49%)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b95852...ab17a1a. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 72.998% when pulling fb002e3 on dongahn:resrc_api_context into 7b95852 on flux-framework:master.

ok (((resrc = resrc_create_cluster ("cluster")) != 0),
"cluster resource creation succeeded");
ok ((resrc_generate_hwloc_resources (resrc, topology, NULL, NULL) != 0),
/* Generate teh hardware hiearchy of resources using hwloc reader */
Copy link
Contributor

Choose a reason for hiding this comment

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

teh -> the

Copy link
Member

Choose a reason for hiding this comment

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

also hiearchy -> hierarchy :-)

@lipari
Copy link
Contributor

lipari commented Mar 2, 2017

@dongahn, looks great! I'm ready to merge once typos are fixed. There are 4 misspelled "hiearchy" in tresrc.c.

@dongahn
Copy link
Member Author

dongahn commented Mar 2, 2017

Got it. Will work on this and push.

Add resource API context support to streamline our future scheduling
improvements which includes upcoming scheduler-driven aggregate updates work.

Add resrc_api.h where resrc_api_init () and resrc_api_fini () are declared.
resrc_api_init () creates and initializes an instance of the resource APIs
which are implemented across resrc, resrc_tree, resrc_flow, and resrc_reqst.

Once the context is returned from resrc_api_init (), the caller must pass
it as an opaque handle to certain API calls in the resrc and friends.
This allows these APIs to act on the specific API instance.

Define struct resrc_api_ctx in resrc_api_internal.h which should only
be included om resource API internal implementation files

Over time, resrc_api will add some other API-level functions that will
allow an API instance to be specialized.

Add, delete and revise some API calls and internals as part of this commit, as well:
    - Add query routines into resrc tree/flow APIs to allow users to fetch
      the roots of constructed graphs using the resource API context;
    - Clean up rsreader APIs and sched internals a bit using these new routines
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 72.998% when pulling ab17a1a on dongahn:resrc_api_context into 7b95852 on flux-framework:master.

@dongahn
Copy link
Member Author

dongahn commented Mar 2, 2017

Ok. Ready.

@lipari lipari merged commit cd04bbd into flux-framework:master Mar 2, 2017
@grondo grondo mentioned this pull request Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants