Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Use slurm C language API instead of calling binaries #100

Open
pisarukv opened this issue May 2, 2019 · 5 comments
Open

Use slurm C language API instead of calling binaries #100

pisarukv opened this issue May 2, 2019 · 5 comments

Comments

@pisarukv
Copy link
Contributor

pisarukv commented May 2, 2019

First all we will need to create go binding for slurm c lib

@sashayakovtseva sashayakovtseva changed the title Using SLURM c api instead calling binaries Use slurm C language API instead of calling binaries May 2, 2019
@sashayakovtseva sashayakovtseva added this to the Terrible Arrival milestone May 13, 2019
@sashayakovtseva sashayakovtseva self-assigned this May 13, 2019
@sashayakovtseva
Copy link
Contributor

I was able to generate Go binding, see sashayakovtseva/go-slurm, but returned info is always empty. Attempts to disable munge auth, run C code directly led to no success. Switching tasks.

@sashayakovtseva sashayakovtseva removed this from the Terrible Arrival milestone May 20, 2019
@sashayakovtseva sashayakovtseva removed their assignment May 20, 2019
@ct-clmsn
Copy link

ct-clmsn commented Jun 20, 2019

@sashayakovtseva @cali4888 this may seem like a roundabout solution, but would providing a fuse-plugin that polls slurm on demand - like a webservice - to provide the slurm data through a file interface be unreasonable?

For clarity, an ls operation on the 'slurm machine directory' kicks off a query using the slurm C library for number of nodes, each node gets a file in the directory, a cat or file read on a machine file prints out the slurm data for that node). This would be similar to how linux shows data about a system in /proc or /sys.

@pisarukv
Copy link
Contributor Author

Not sure, that I am fully understand all benefits of such plugin. Can you give us a little bit more details why it could be useful in operator?

@ct-clmsn
Copy link

ct-clmsn commented Jul 2, 2019

@cali4888 apologies for the delay responding. cgo code might get a little ugly. Having a /proc or /sys directory dynamically update with slurm information would mean queries to slurm, from go, would be file reads (and the files could be json or yaml formatted). The fuse-plugin would be in C and your slurm-client code would reside in that plugin.

overhead probably isn't something ya'll are concerned with but, the memory management aspect of cgo integration might be worth considering: https://www.cockroachlabs.com/blog/the-cost-and-complexity-of-cgo/

@pisarukv
Copy link
Contributor Author

pisarukv commented Jul 3, 2019

@ct-clmsn thanks for clarifications :) Yeah, agree with you, i'm also not a big fan of cgo. Such plugin could be a good solution at this place. Actually right now we are thinking how we can make operator more generic. We are actively looking into pmix as a possible solution. So that's why we are not rushing with migrating from direct calls to binaries.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants