Skip to content
Snippets Groups Projects
Commit dce2e514 authored by Simon Michnowicz's avatar Simon Michnowicz
Browse files

first checkin of role to set service to set semaphores for compute nodes

Former-commit-id: 3989dd2a
parent ffe9a936
No related branches found
No related tags found
No related merge requests found
Some program, i.e. GAMESS, needs a larger number of system semaphores than normal.
This program creates a systemd file that sets the value on startup, so that it is persistent
To set count:
echo 500 256000 64 10240 > /proc/sys/kernel/sem
We use a variable SEM_COUNT so users can override the default setting.
use
- { role: set_semaphore_count } #to use default value
- { role: set_semaphore_count, SEM_COUNT: "200 252000 24 20240" } #to use some other value (the ones here are nonsense for example only)
---
- name: set the value of the Semaphores
set_fact:
SEM_COUNT: "500 256000 64 10240"
when: SEM_COUNT is not defined
- name: test value
debug: msg="Value of semaphores is {{ SEM_COUNT }} " #"
- name: Template set_semaphores.service file
template: src=set_semaphores.service.j2 dest=/etc/systemd/system/set_semaphores.service
become: true
become_user: root
- name: enable and start set_semaphores service
service: name="set_semaphores" state=started enabled=true
[Unit]
Description=Increase maximum number of semaphores available on the system
After=network.target
[Service]
Type=simple
ExecStart=/bin/sh -c '/usr/bin/echo {{ SEM_COUNT }} > /proc/sys/kernel/sem'
[Install]
WantedBy=default.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment