Comments (1)
In fact, I have found the answers and it is split in 2.
- state
The state for partition is not represented internally in slurm (cf slurm.h) as for the job. In slurm.h, you see :
/* Partition state flags /
#define PARTITION_SUBMIT 0x01 / Allow job submission to partition /
#define PARTITION_SCHED 0x02 / Allow job startup from partition */
/* Actual partition states based upon state flags */
#define PARTITION_DOWN (PARTITION_SUBMIT)
#define PARTITION_UP (PARTITION_SUBMIT | PARTITION_SCHED)
#define PARTITION_DRAIN (PARTITION_SCHED)
#define PARTITION_INACTIVE 0x00
So in pyslurm the state_up value means : 0 => INACTIVE, 1=>DOWN, 2=>DRAIN,3=>UP
- Flags
In the value of flags of the partition you have in fact all flags that are represented. From slurm.h :
/* Current partition state information and used to set partition options- using slurm_update_partition(). /
#define PART_FLAG_DEFAULT 0x0001 / Set if default partition /
#define PART_FLAG_HIDDEN 0x0002 / Set if partition is hidden /
#define PART_FLAG_NO_ROOT 0x0004 / Set if user root jobs disabled /
#define PART_FLAG_ROOT_ONLY 0x0008 / Set if only root can submit jobs /
#define PART_FLAG_REQ_RESV 0x0010 / Set if reservation is required /
/ Used with slurm_update_partition() to clear flags associated with existing - partitions. For example, if a partition is currently hidden and you want
- to make it visible then set flags to PART_FLAG_HIDDEN_CLR and call
- slurm_update_partition(). /
#define PART_FLAG_DEFAULT_CLR 0x0100 / Clear DEFAULT partition flag /
#define PART_FLAG_HIDDEN_CLR 0x0200 / Clear HIDDEN partition flag /
#define PART_FLAG_NO_ROOT_CLR 0x0400 / Clear NO_ROOT partition flag /
#define PART_FLAG_ROOT_ONLY_CLR 0x0800 / Clear ROOT_ONLY partition flag /
#define PART_FLAG_REQ_RESV_CLR 0x1000 / Clear RES_REQ partition flag */
- using slurm_update_partition(). /
So, flags is holding the value for DEFAULT, HIDDEN, NO_ROOT, REQ_RESV (i suppose that it is the shared flag of scontrol show partition).
I ended up wrapping pyslurm in the following code (processed_part_dict hold the values of the partition dictionnary) :
state=processed_part_dict["state"]
if state == 0:
final_state = "(0, 'INACTIVE')"
elif state == 1:
final_state = "(1, 'DOWN')"
elif state == 2:
final_state = "(2, 'DRAIN')"
elif state == 3:
final_state = "(3, 'UP')"
else:
final_state = "(-1, 'UNKNOW')"
logger.error("SoapSlurm.py - list_partitions - unknown partition state :"+str(state))
processed_part_dict["state"]=final_state
# Now dealing with the flag
flags = processed_part_dict["flags"]
for flag in boolean_fields:
processed_part_dict[flag] = False
if ( flags | 65534 ) == 65535:
processed_part_dict["defaultPartition"] = True
if ( flags | 65533 ) == 65535:
processed_part_dict["hidden"] = True
if ( flags | 65531 ) == 65535:
processed_part_dict["noRoot"] = True
if ( flags | 65527 ) == 65535:
processed_part_dict["rootOnly"] = True
if ( flags | 65519 ) == 65535:
processed_part_dict["shared"] = True
from pyslurm.
Related Issues (20)
- pyslurm throw KeyError 5039 when statistics().get() called HOT 2
- symbol lookup error: undefined symbol: data_init HOT 7
- Installation fails for v22.5.x HOT 2
- Submittion of a batch job will be failed when argument "work_dir" contains a "_" HOT 1
- Unclear that `Jobs.load()` returns a dictionary. HOT 2
- Missing `Job` fields compared to the docs HOT 2
- slurmdbd: Implement Association API
- ValueError: invalid literal for int() with base 10: 'milton.m' HOT 1
- Copy/Paste error in Job class memory property HOT 1
- Cannot seem to get allocated gres info from Node HOT 4
- Node in Nodes collection do not report a MIXED state, only IDLE or ALLOCATED HOT 5
- A job is found with JobFilter if it is running on start_time HOT 6
- question: install on cluster without slurm-devel package and without root access HOT 2
- job mem returns as "None" HOT 3
- error: ‘KILL_JOB_ARRAY’ undeclared HOT 1
- Slurm 23.11 support HOT 3
- pyslurm is installation failed HOT 2
- Particular value of gres is causing cstr to crash HOT 1
- [guidance request] 'gres' : 'gpu' does not have the same behavior as when using bash HOT 2
- Problem in setup.py get_version() - packaging.version object is missing .major and .minor attributes in earlier module versions under Python 3.6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyslurm.