Setting limit for number of cores and tasks per node

I’m attempting to fully use dynamic form widgets and no JS in my OOD app. Currently, I have it configured for number_fields to take in cores_per_task and tasks_per_node. The maximum number of cores per node is 24 cores, so I want to define a limit for the product of cores_per_task and tasks_per_node to be less than or equal to 24. Any ideas on how I can achieve this?

Hi and welcome!

I don’t think the dynamic javascript can do products or similar calculations, it can just set mins and maxes. So it would appear you’d have to write your own javascript to do that.

That said - I’d consider removing one of those from the form entirely just to simplify the user experience. My gut feeling is that they’re only interested in how many cores they have access to while interacting with the application, and the application itself deals with parallelism (as opposed to invoking srun or similar).

2 Likes

Hey Jeff!

So we’re actually trying to support workflows where users do need to differentiate between ntasks-per-node and cpus-per-task

Currently, in OOD, we have one field that gets passed to --ntasks-per-node (we use Slurm). But there are some use cases where it matters if people use --ntasks-per-node or --cpus-per-task.

  • Some users have a TensorFlow workflow where they have multiple threads submitting to one GPU. In normal batch jobs, --ntasks-per-node=1 and --cpus-per-task=N works for them, whereas --ntasks-per-node=N does not. We’d like to have that same level of support in our Jupyter OOD app.
  • On the other hand, we have people running MPI apps like ANSYS through an OOD Interactive Desktop, and they do need --ntasks-per-node=N

Are these use cases anyone else has addressed?

OSC uses --ntasks-per-node exclusively to request cores.

I wonder why. I always have to remind myself of the distinction whenever an issue like this comes up.

In any case - if you need multiplication or similar behavior to set boundaries when given user input, then it seems like you’ve got to write the javascript for it.

1 Like