# Bc\_num\_hours set value in min

**URL:** <https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301>\
**Category:** Get Help\
**Created:** [February 28, 2024, 11:40pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301 "2024-02-28T23:40:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 28, 2024, 11:40pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/1 "2024-02-28T23:40:05Z")

</div>

I’m using bc\_num\_hours in my form but it looks like it’s requesting time in minutes.

My submit.yml.erb

script:  
native:

- “–job-name”
- “\<%= job\_name %\>”
- “-n”
- “\<%= bc\_num\_slots %\>”
- “–partition”
- “\<%= auto\_queues %\>”
- “–time”
- “\<%= bc\_num\_hours %\>”

It’s what I see in job\_script\_options.json  
{  
“job\_name”: “sys/dashboard/dev/submit-ansys-job”,  
“workdir”: “ondemand/data/sys/dashboard/batch\_connect/dev/submit-ansys-job/output/1ad36bbd-26cc-4ea8-8426-5614c465964a”,  
“output\_path”: “/ondemand/data/sys/dashboard/batch\_connect/dev/submit-ansys-job/output/1ad36bbd-26cc-4ea8-8426-5614c465964a/output.log”,  
“shell\_path”: “/bin/bash”,  
“queue\_name”: “sky”,  
“qos”: “lowprio\_8job”,  
“native”: [  
“–job-name”,  
“lalala”,  
“-n”,  
“1”,  
“–partition”,  
“sky”,  
“–time”,  
“24”  
],  
“wall\_time”: 86400,  
“email\_on\_started”: true  
}

And on the dashboard time requested 24 minutes instead of 24 hours.

 ![Screenshot from 2024-02-28 15-02-24](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/f/f34a0efe35dd7a90d30b005daff511fc2548407c.png)

Another thing is it possible by using - auto\_queues filed let user pick a multiple partitions instead of one?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 29, 2024, 3:22pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/2 "2024-02-29T15:22:40Z")

</div>

> [@ssofya](#):
>
> - “-n”
> - “\<%= bc\_num\_slots %\>”
> - “–partition”
> - “\<%= auto\_queues %\>”
> - “–time”
> - “\<%= bc\_num\_hours %\>”

You should not be setting these in the submit line. That is, you do not need these 4 lines at all.

Fields that start with `bc_` or `auto_` that we distribute know how to submit themselves. They’re automatic flag generation seems to be overridden by what you’re providing.

So for example `bc_num_hours` knows what flags to use (i.e., `--time` on slurm) and knows how to translate itself to the right time unit for your scheduler.

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 29, 2024, 8:21pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/3 "2024-02-29T20:21:04Z")

</div>

Yes, I see! it worked. Thank you.

Is it possible with with bc\_num\_slots filed submit to a multiple partitions?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 29, 2024, 8:23pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/4 "2024-02-29T20:23:28Z")

</div>

> [@ssofya](#):
>
> Is it possible with with bc\_num\_slots filed submit to a multiple partitions?

Maybe? We (OSC) don’t really use partitions - or at least we don’t have users specify them (we have slurm filters that will put you in the right partition based on resources requested & the project used).

What would the equivalent `sbatch` command look like?

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 29, 2024, 8:55pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/5 "2024-02-29T20:55:03Z")

</div>

For the multiple partitions it would be

–partition=sky,epyc,smp

But I need to give users option to choose a few from the list not just one.

And one more question about bc\_num\_slots. My understanding it suppose to be CPU. But I think it’s being ignored in my submit from. If I request 48 it should run on 2 nodes because each has 32 CPUs, but it runs only on 1.

I don’t see it in json file:  
{  
“job\_name”: “sys/dashboard/dev/submit-ansys-job”,  
“workdir”: “ondemand/data/sys/dashboard/batch\_connect/dev/submit-ansys-job/output/5d7ea5b2-6940-4f17-9069-7f736a82b6d2”,  
“output\_path”: “ondemand/data/sys/dashboard/batch\_connect/dev/submit-ansys-job/output/5d7ea5b2-6940-4f17-9069-7f736a82b6d2/output.log”,  
“shell\_path”: “/bin/bash”,  
“queue\_name”: “sky”,  
“qos”: “lowprio\_8job”,  
“native”: [  
“–job-name”,  
“lalala”  
],  
“wall\_time”: 86400,  
“email\_on\_started”: true  
}

My submit.yml.erb  
script:  
native:

- “–job-name”
- “\<%= job\_name %\>”

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 29, 2024, 9:23pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/6 "2024-02-29T21:23:25Z")

</div>

You can check your `/var/log/ondemand-nginx/$USER/error.log` to see the exact sbatch command you issue.

For whatever reason `bc_num_slots` uses `-N` (`--nodes`) for Slurm. It was before my time, but since it’s called `slots` they tried (erroneously) to translate that slot concept to Slurm. At that time we were a torque/moab shop and it’s unclear to me why they translated it like that.

You can even see by the label that they knew that it was processors on one system and nodes on another.

> <https://github.com/OSC/ondemand/blob/4587cd0fdf71a2d8434a4da1d0a2e97ae898cc71/apps/dashboard/app/lib/smart_attributes/attributes/bc_num_slots.rb#L37-L44>

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 29, 2024, 9:50pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/7 "2024-02-29T21:50:45Z")

</div>

I don’t see this information in error.log as well. It feels like it’s completely ignored.

App 23784 output: [2024-02-29 13:40:23 -0800] INFO "execve = [{"SLURM\_CONF"=\>  
"/etc/slurm/slurm.conf"}, "/bin/sbatch", "-D", "ondemand/  
data/sys/dashboard/batch\_connect/dev/submit-ansys-job/output/34c2dd94-a7a9-43fe-89  
e6-dac1178e254d", "–mail-type", "BEGIN", "-J", "sys/dashboard/dev/submit-  
ansys-job", "-o", "ondemand/data/sys/dashboard/batch\_connec  
t/dev/submit-ansys-job/output/34c2dd94-a7a9-43fe-89e6-dac1178e254d/output.log",   
"-p", "sky", "-t", "24:00:00", "–qos", "lowprio\_8job", "–export",   
“NONE", "–job-name", "lalala", "–license", "mech\_1@slurmdb:1,anshpc@slur  
mdb:8", "–parsable", "-M", "viking"]”

I will just use a different field something like num\_core in meantime.

Do you have any experience with specifying license during your job submission from ondemand?  
Should something like this work?  
script:  
native:

- “–job-name”
- “\<%= job\_name %\>”  
\<%-  
license = if solver == “Ansys”  
“mech\_1@slurmdb:1,anshpc@slurmdb:8”  
else  
“meba@slurmdb:1,anshpc@slurmdb:8”  
end  
-%\>
- “–license”
- “\<%= license %\>”

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 29, 2024, 9:57pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/8 "2024-02-29T21:57:11Z")

</div>

> [@ssofya](#):
>
> Do you have any experience with specifying license during your job submission from ondemand?  
> Should something like this work?

Yes, as a quick glance I think that’s correct. Here’s what we do for Ansys in our production app.

> <https://github.com/OSC/bc_osc_ansys_workbench/blob/e4fe440ad2c5cc4867a9d8850ed676e89c8db601/submit.yml.erb#L28-L30>

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 29, 2024, 9:58pm UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/9 "2024-02-29T21:58:49Z")

</div>

> [@ssofya](#):
>
> “–license”

OK - at a less quick glance - this may need to be pluralized to `licenses`. I’d have to consult the sbatch documentation on the same given the link I just posted uses licenses plural.

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [March 1, 2024, 12:35am UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/10 "2024-03-01T00:35:12Z")

</div>

I was able to submit both ways –license and –licenses. So all good. Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [August 28, 2024, 12:36am UTC](https://discourse.openondemand.org/t/bc-num-hours-set-value-in-min/3301/11 "2024-08-28T00:36:09Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
