Skip to content
Snippets Groups Projects
Commit 0aee63d0 authored by Moe Jette's avatar Moe Jette
Browse files

given a job credential, return:

the node list, count of allocated nodes, and number of processors allocated per node 
parent 77124f36
No related branches found
No related tags found
No related merge requests found
...@@ -1064,7 +1064,7 @@ slurm_cred_print(slurm_cred_t cred) ...@@ -1064,7 +1064,7 @@ slurm_cred_print(slurm_cred_t cred)
info("Cred: job_mem %u", cred->job_mem ); info("Cred: job_mem %u", cred->job_mem );
info("Cred: task_mem %u", cred->task_mem ); info("Cred: task_mem %u", cred->task_mem );
info("Cred: Nodes %s", cred->nodes ); info("Cred: Nodes %s", cred->nodes );
info("Cred: alloc_lps_cnt %d", cred->alloc_lps_cnt ); info("Cred: alloc_lps_cnt %u", cred->alloc_lps_cnt );
info("Cred: alloc_lps: "); info("Cred: alloc_lps: ");
for (i=0; i<cred->alloc_lps_cnt; i++) for (i=0; i<cred->alloc_lps_cnt; i++)
info("alloc_lps[%d] = %u ", i, cred->alloc_lps[i]); info("alloc_lps[%d] = %u ", i, cred->alloc_lps[i]);
...@@ -1074,6 +1074,18 @@ slurm_cred_print(slurm_cred_t cred) ...@@ -1074,6 +1074,18 @@ slurm_cred_print(slurm_cred_t cred)
} }
int slurm_cred_get_alloc_lps(slurm_cred_t cred, char **nodes,
uint32_t *alloc_lps_cnt, uint32_t **alloc_lps)
{
if ((cred == NULL) || (nodes == NULL) ||
(alloc_lps_cnt == NULL) || (alloc_lps == NULL))
return EINVAL;
*nodes = cred->nodes;
*alloc_lps_cnt = cred->alloc_lps_cnt;
*alloc_lps = cred->alloc_lps;
return SLURM_SUCCESS;
}
static void static void
_verifier_ctx_init(slurm_cred_ctx_t ctx) _verifier_ctx_init(slurm_cred_ctx_t ctx)
......
...@@ -267,6 +267,11 @@ int slurm_cred_get_signature(slurm_cred_t cred, char **datap, int *len); ...@@ -267,6 +267,11 @@ int slurm_cred_get_signature(slurm_cred_t cred, char **datap, int *len);
*/ */
void slurm_cred_print(slurm_cred_t cred); void slurm_cred_print(slurm_cred_t cred);
/*
* Get count of allocated LPS (processors) by node
*/
int slurm_cred_get_alloc_lps(slurm_cred_t cred, char **nodes,
uint32_t *alloc_lps_cnt, uint32_t **alloc_lps);
#ifdef DISABLE_LOCALTIME #ifdef DISABLE_LOCALTIME
extern char * timestr (const time_t *tp, char *buf, size_t n); extern char * timestr (const time_t *tp, char *buf, size_t n);
#endif #endif
......
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