Commit b6b1da35 authored by iker_martin's avatar iker_martin
Browse files

Bugfix to compute cpus per node when using Slurm functions. In addition, Slurm...

Bugfix to compute cpus per node when using Slurm functions. In addition, Slurm functions will be checked before Slurm Env variables, as those do not change after a new allocation.
parent f1398303
......@@ -22,14 +22,14 @@ void MAM_check_hosts() {
int not_filled = 1;
#if MAM_USE_SLURM
not_filled = MAM_I_slurm_getenv_hosts_info();
not_filled = MAM_I_slurm_getjob_hosts_info();
if(not_filled) {
if(mall->nodelist != NULL) {
free(mall->nodelist);
mall->nodelist = NULL;
}
not_filled = MAM_I_slurm_getjob_hosts_info();
not_filled = MAM_I_slurm_getenv_hosts_info();
}
#endif
if(not_filled) {
......@@ -281,7 +281,7 @@ int MAM_I_slurm_getjob_hosts_info() {
last_record = j_info->job_array[j_info->record_count - 1];
mall->num_nodes = last_record.num_nodes;
mall->num_cpus = last_record.num_cpus;
mall->num_cpus = last_record.num_cpus / last_record.num_nodes;
mall->nodelist_len = strlen(last_record.nodes)+1;
mall->nodelist = (char *) malloc(mall->nodelist_len * sizeof(char));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment