Skip to content
Snippets Groups Projects
Commit e1b77d53 authored by Ramon Nou's avatar Ramon Nou
Browse files

Adapt to SLURM version (hostlist pointer)

parent 9ed93496
No related branches found
No related tags found
1 merge request!126Resolve "Root issues and stage-out with SPANK"
Pipeline #4454 passed
......@@ -117,7 +117,7 @@ main(int argc, char* argv[]) {
ADM_transfer_t tx;
ret = ADM_transfer_datasets(server, job, sources, sources_len, targets,
targets_len, limits, limits_len, mapping, &tx);
targets_len, limits, limits_len, mapping, &tx, false);
if(ret != ADM_SUCCESS) {
fprintf(stderr,
......
......@@ -117,7 +117,7 @@ main(int argc, char* argv[]) {
ADM_transfer_t tx;
ret = ADM_transfer_datasets(server, job, sources, sources_len, targets,
targets_len, limits, limits_len, mapping, &tx);
targets_len, limits, limits_len, mapping, &tx, false);
if(ret != ADM_SUCCESS) {
fprintf(stderr,
......
......@@ -121,7 +121,7 @@ main(int argc, char* argv[]) {
ADM_transfer_t tx;
ret = ADM_transfer_datasets(server, job, sources, sources_len, targets,
targets_len, limits, limits_len, mapping, &tx);
targets_len, limits, limits_len, mapping, &tx, false);
if(ret != ADM_SUCCESS) {
......
......@@ -117,7 +117,7 @@ main(int argc, char* argv[]) {
ADM_transfer_t tx;
ret = ADM_transfer_datasets(server, job, sources, sources_len, targets,
targets_len, limits, limits_len, mapping, &tx);
targets_len, limits, limits_len, mapping, &tx, false);
if(ret != ADM_SUCCESS) {
fprintf(stderr,
......
......@@ -117,7 +117,7 @@ main(int argc, char* argv[]) {
ADM_transfer_t tx;
ret = ADM_transfer_datasets(server, job, sources, NSOURCES, targets,
NTARGETS, limits, NLIMITS, mapping, &tx);
NTARGETS, limits, NLIMITS, mapping, &tx, false);
if(ret != ADM_SUCCESS) {
fprintf(stderr,
......
......@@ -44,6 +44,11 @@
#include <sys/stat.h>
#include <fcntl.h>
#if SLURM_VERSION_NUMBER > SLURM_VERSION_NUM(23,0,0)
#define POINTER *
#else
#define POINTER
#endif
/**
* Slurm SPANK plugin to handle the ADMIRE adhoc storage CLI. Options are
* forwarded to scord on srun, salloc and sbatch. See the struct spank_option
......@@ -805,7 +810,7 @@ slurm_spank_user_init(spank_t sp, int ac, char** av) {
slurm_debug("%s: %s: job id: %d", plugin_name, __func__, jobid);
/* list of job nodes */
hostlist_t* hostlist = get_slurm_hostlist(sp);
hostlist_t POINTER hostlist = get_slurm_hostlist(sp);
if(!hostlist) {
slurm_error("%s: failed to retrieve hostlist", plugin_name);
return -1;
......@@ -1060,7 +1065,7 @@ slurm_spank_exit(spank_t sp, int ac, char** av) {
slurm_info("%s: %s: job id: %d", plugin_name, __func__, jobid);
/* list of job nodes */
hostlist_t* hostlist = get_slurm_hostlist(sp);
hostlist_t POINTER hostlist = get_slurm_hostlist(sp);
if(!hostlist) {
slurm_info("%s: failed to retrieve hostlist", plugin_name);
return -1;
......
......@@ -32,7 +32,7 @@
extern const char plugin_name[];
hostlist_t *
hostlist_t POINTER
get_slurm_hostlist(spank_t sp) {
/* get list of nodes. /!\ at this point env SLURM_NODELIST is
......@@ -72,7 +72,7 @@ get_slurm_hostlist(spank_t sp) {
slurm_debug("%s: SLURM_NODELIST=%s", plugin_name, nodelist);
hostlist_t * hl = NULL;
hostlist_t POINTER hl = NULL;
hl = slurm_hostlist_create(nodelist);
if(!hl) {
......@@ -84,7 +84,7 @@ get_slurm_hostlist(spank_t sp) {
}
scord_nodelist_t
scord_nodelist_create(hostlist_t* hostlist) {
scord_nodelist_create(hostlist_t POINTER hostlist) {
ADM_node_t* nodes = NULL;
char* host = NULL;
......
......@@ -29,8 +29,12 @@
#include <slurm/spank.h>
#include <scord/types.h>
hostlist_t *
#if SLURM_VERSION_NUMBER > SLURM_VERSION_NUM(23,0,0)
#define POINTER *
#else
#define POINTER
#endif
hostlist_t POINTER
get_slurm_hostlist(spank_t sp);
typedef struct scord_nodelist {
......@@ -39,7 +43,7 @@ typedef struct scord_nodelist {
}* scord_nodelist_t;
scord_nodelist_t
scord_nodelist_create(hostlist_t* hostlist);
scord_nodelist_create(hostlist_t POINTER hostlist);
int
scord_nodelist_get_nodecount(scord_nodelist_t nodelist);
......
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