Commit b39e1324 authored by iker_martin's avatar iker_martin
Browse files

Minor bugfix por spawned processes. Changes in the Debug prints

parent f2a58467
...@@ -57,8 +57,8 @@ void MAM_Comm_main_structures(MPI_Comm comm, int rootBcast) { ...@@ -57,8 +57,8 @@ void MAM_Comm_main_structures(MPI_Comm comm, int rootBcast) {
MPI_Bcast(MPI_BOTTOM, 1, mall->struct_type, rootBcast, comm); MPI_Bcast(MPI_BOTTOM, 1, mall->struct_type, rootBcast, comm);
if(mall->nodelist == NULL) { if(mall->nodelist == NULL) {
mall->nodelist = calloc(mall->nodelist_len+1, sizeof(char)); mall->nodelist = malloc((mall->nodelist_len) * sizeof(char));
mall->nodelist[mall->nodelist_len] = '\0'; mall->nodelist[mall->nodelist_len-1] = '\0';
} }
MPI_Bcast(mall->nodelist, mall->nodelist_len, MPI_CHAR, rootBcast, comm); MPI_Bcast(mall->nodelist, mall->nodelist_len, MPI_CHAR, rootBcast, comm);
} }
......
...@@ -24,6 +24,9 @@ void MAM_check_hosts() { ...@@ -24,6 +24,9 @@ void MAM_check_hosts() {
#if MAM_USE_SLURM #if MAM_USE_SLURM
not_filled = MAM_I_slurm_getjob_hosts_info(); not_filled = MAM_I_slurm_getjob_hosts_info();
if(not_filled) { if(not_filled) {
#if MAM_DEBUG >= 2
DEBUG_FUNC("WARNING - RMS info retriever failed with slurm functions. Trying with ENV variables", mall->myId, mall->numP);
#endif
if(mall->nodelist != NULL) { if(mall->nodelist != NULL) {
free(mall->nodelist); free(mall->nodelist);
mall->nodelist = NULL; mall->nodelist = NULL;
...@@ -276,7 +279,7 @@ int MAM_I_slurm_getjob_hosts_info() { ...@@ -276,7 +279,7 @@ int MAM_I_slurm_getjob_hosts_info() {
if(tmp == NULL) return 1; if(tmp == NULL) return 1;
jobId = atoi(tmp); jobId = atoi(tmp);
err = slurm_load_job(&j_info, jobId, 1); err = slurm_load_job(&j_info, jobId, 1); // FIXME Valgrind Not freed
if(err) return err; if(err) return err;
last_record = j_info->job_array[j_info->record_count - 1]; last_record = j_info->job_array[j_info->record_count - 1];
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
void def_malleability_times(MPI_Datatype *new_type); void def_malleability_times(MPI_Datatype *new_type);
void init_malleability_times() { void init_malleability_times() {
#if MAM_DEBUG #if MAM_DEBUG >= 4
DEBUG_FUNC("Initializing recording structure", mall->myId, mall->numP); fflush(stdout); MPI_Barrier(mall->comm); DEBUG_FUNC("Initializing recording structure", mall->myId, mall->numP); fflush(stdout); MPI_Barrier(mall->comm);
#endif #endif
...@@ -17,7 +17,7 @@ void init_malleability_times() { ...@@ -17,7 +17,7 @@ void init_malleability_times() {
reset_malleability_times(); reset_malleability_times();
def_malleability_times(&mall_conf->times->times_type); def_malleability_times(&mall_conf->times->times_type);
#if MAM_DEBUG #if MAM_DEBUG >= 4
DEBUG_FUNC("Initialized recording structure", mall->myId, mall->numP); fflush(stdout); MPI_Barrier(mall->comm); DEBUG_FUNC("Initialized recording structure", mall->myId, mall->numP); fflush(stdout); MPI_Barrier(mall->comm);
#endif #endif
} }
...@@ -31,7 +31,7 @@ void reset_malleability_times() { ...@@ -31,7 +31,7 @@ void reset_malleability_times() {
} }
void free_malleability_times() { void free_malleability_times() {
#if MAM_DEBUG #if MAM_DEBUG >= 4
DEBUG_FUNC("Freeing recording structure", mall->myId, mall->numP); fflush(stdout); DEBUG_FUNC("Freeing recording structure", mall->myId, mall->numP); fflush(stdout);
#endif #endif
if(mall_conf->times != NULL) { if(mall_conf->times != NULL) {
...@@ -41,7 +41,7 @@ void free_malleability_times() { ...@@ -41,7 +41,7 @@ void free_malleability_times() {
} }
free(mall_conf->times); free(mall_conf->times);
} }
#if MAM_DEBUG #if MAM_DEBUG >= 4
DEBUG_FUNC("Freed recording structure", mall->myId, mall->numP); fflush(stdout); DEBUG_FUNC("Freed recording structure", mall->myId, mall->numP); fflush(stdout);
#endif #endif
} }
...@@ -51,6 +51,8 @@ void free_malleability_times() { ...@@ -51,6 +51,8 @@ void free_malleability_times() {
* *
* This function is intended to be called when a reconfiguration has ended. * This function is intended to be called when a reconfiguration has ended.
* It is designed to provide the necessary information for the user to perform data redistribution. * It is designed to provide the necessary information for the user to perform data redistribution.
*
* Null values can be passed if there is no interest in retreiving particular times
* *
* Parameters: * Parameters:
* - double *sp_time: A pointer where the spawn time will be saved. * - double *sp_time: A pointer where the spawn time will be saved.
...@@ -61,11 +63,11 @@ void free_malleability_times() { ...@@ -61,11 +63,11 @@ void free_malleability_times() {
*/ */
void MAM_Retrieve_times(double *sp_time, double *sy_time, double *asy_time, double *user_time, double *mall_time) { void MAM_Retrieve_times(double *sp_time, double *sy_time, double *asy_time, double *user_time, double *mall_time) {
malleability_times_t *times = mall_conf->times; malleability_times_t *times = mall_conf->times;
*sp_time = times->spawn_time; if(sp_time != NULL) *sp_time = times->spawn_time;
*sy_time = times->sync_end - times->sync_start; if(sy_time != NULL) *sy_time = times->sync_end - times->sync_start;
*asy_time = times->async_end - times->async_start; if(asy_time != NULL) *asy_time = times->async_end - times->async_start;
*user_time = times->user_end - times->user_start; if(user_time != NULL) *user_time = times->user_end - times->user_start;
*mall_time = times->malleability_end - times->malleability_start; if(mall_time != NULL) *mall_time = times->malleability_end - times->malleability_start;
} }
void malleability_times_broadcast(int root) { void malleability_times_broadcast(int root) {
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#include "../MAM_DataStructures.h" #include "../MAM_DataStructures.h"
//--------------PRIVATE CONSTANTS------------------// //--------------PRIVATE CONSTANTS------------------//
#define MAM_HOSTFILE_NAME1 "MAM_HF_ID" // Constant size name (15) #define MAM_HOSTFILE_NAME1 "MAM_HF_ID" // Constant size name (9) -- Part of SIZE1
#define MAM_HOSTFILE_NAME2 "_S" // Constant size name (2) #define MAM_HOSTFILE_NAME2 "_S" // Constant size name (2) -- Part of SIZE1
#define MAM_HOSTFILE_NAME3 ".tmp" // Constant size name (4) #define MAM_HOSTFILE_NAME3 ".tmp" // Constant size name (4) -- Part of SIZE2
#define MAM_HOSTFILE_SIZE1 15 // 11 Chars + 4 Digits #define MAM_HOSTFILE_SIZE1 15 // 11 Chars + 4 Digits
#define MAM_HOSTFILE_SIZE2 8 // 4 Chars + 3 Digits + \0 #define MAM_HOSTFILE_SIZE2 8 // 4 Chars + 3 Digits + \0
#define MAM_HOSTFILE_SIZE MAM_HOSTFILE_SIZE1 + MAM_HOSTFILE_SIZE2 //23 = 15 Chars + 7 Digits + \0 #define MAM_HOSTFILE_SIZE MAM_HOSTFILE_SIZE1 + MAM_HOSTFILE_SIZE2 //23 = 15 Chars + 7 Digits + \0
......
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