Skip to content

Commit

Permalink
Integrate max for threads
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmflynn committed Nov 2, 2023
1 parent d829348 commit a931bbe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion pyflask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ def send_preview(path):
def get_cpu_count():
from psutil import cpu_count

return {"physical": cpu_count(logical=False)}
physical = cpu_count(logical=False)
logical = cpu_count()

return dict(
physical=physical,
logical=logical
)


@api.route("/server_shutdown", endpoint="shutdown")
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/src/stories/pages/uploads/UploadsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,12 @@ export class UploadsPage extends Page {
const promise = onServerOpen(() => {
return fetch(new URL("cpus", baseUrl))
.then((res) => res.json())
.then(({ physical }) => {
.then(({ physical, logical }) => {
console.log(physical);

dandiSchema.properties.number_of_jobs.max = physical;

dandiSchema.properties.number_of_threads.max = logical / physical;

// NOTE: API Keys and Dandiset IDs persist across selected project
return (this.form = new JSONSchemaForm({
results: globalState,
Expand Down

0 comments on commit a931bbe

Please sign in to comment.