Commit f69cc99b authored by iker_martin's avatar iker_martin
Browse files

Minor bugfix in MaM when no asynch communication is used

parent fe41880f
...@@ -26,6 +26,7 @@ int MAM_St_spawn_start(); ...@@ -26,6 +26,7 @@ int MAM_St_spawn_start();
int MAM_St_spawn_pending(int wait_completed); int MAM_St_spawn_pending(int wait_completed);
int MAM_St_red_start(); int MAM_St_red_start();
int MAM_St_red_pending(int *mam_state, int wait_completed); int MAM_St_red_pending(int *mam_state, int wait_completed);
int MAM_St_user_start(int *mam_state);
int MAM_St_user_pending(int *mam_state, int wait_completed, void (*user_function)(void *), void *user_args); int MAM_St_user_pending(int *mam_state, int wait_completed, void (*user_function)(void *), void *user_args);
int MAM_St_user_completed(); int MAM_St_user_completed();
int MAM_St_spawn_adapt_pending(int wait_completed); int MAM_St_spawn_adapt_pending(int wait_completed);
...@@ -210,6 +211,10 @@ int MAM_Checkpoint(int *mam_state, int wait_completed, void (*user_function)(voi ...@@ -210,6 +211,10 @@ int MAM_Checkpoint(int *mam_state, int wait_completed, void (*user_function)(voi
call_checkpoint = MAM_St_red_pending(mam_state, wait_completed); call_checkpoint = MAM_St_red_pending(mam_state, wait_completed);
break; break;
case MALL_USER_START:
call_checkpoint = MAM_St_user_start(mam_state);
break;
case MALL_USER_PENDING: case MALL_USER_PENDING:
call_checkpoint = MAM_St_user_pending(mam_state, wait_completed, user_function, user_args); call_checkpoint = MAM_St_user_pending(mam_state, wait_completed, user_function, user_args);
break; break;
...@@ -601,6 +606,13 @@ int MAM_St_red_pending(int *mam_state, int wait_completed) { ...@@ -601,6 +606,13 @@ int MAM_St_red_pending(int *mam_state, int wait_completed) {
} }
if(state != MALL_DIST_PENDING) { if(state != MALL_DIST_PENDING) {
state = MALL_USER_START;
return 1;
}
return 0;
}
int MAM_St_user_start(int *mam_state) {
if(MAM_Contains_strat(MAM_SPAWN_STRATEGIES, MAM_STRAT_SPAWN_INTERCOMM, NULL)) { if(MAM_Contains_strat(MAM_SPAWN_STRATEGIES, MAM_STRAT_SPAWN_INTERCOMM, NULL)) {
MPI_Intercomm_merge(mall->intercomm, MALLEABILITY_NOT_CHILDREN, &mall->tmp_comm); //El que pone 0 va primero MPI_Intercomm_merge(mall->intercomm, MALLEABILITY_NOT_CHILDREN, &mall->tmp_comm); //El que pone 0 va primero
} else { } else {
...@@ -610,8 +622,6 @@ int MAM_St_red_pending(int *mam_state, int wait_completed) { ...@@ -610,8 +622,6 @@ int MAM_St_red_pending(int *mam_state, int wait_completed) {
state = MALL_USER_PENDING; state = MALL_USER_PENDING;
*mam_state = MAM_USER_PENDING; *mam_state = MAM_USER_PENDING;
return 1; return 1;
}
return 0;
} }
int MAM_St_user_pending(int *mam_state, int wait_completed, void (*user_function)(void *), void *user_args) { int MAM_St_user_pending(int *mam_state, int wait_completed, void (*user_function)(void *), void *user_args) {
...@@ -874,7 +884,7 @@ int start_redistribution() { ...@@ -874,7 +884,7 @@ int start_redistribution() {
return MALL_DIST_PENDING; return MALL_DIST_PENDING;
} }
} }
return MALL_USER_PENDING; return MALL_USER_START;
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#define MAM_OK 0 #define MAM_OK 0
enum mall_inner_states{MALL_UNRESERVED, MALL_NOT_STARTED, MALL_RMS_COMPLETED, MALL_SPAWN_PENDING, MALL_SPAWN_SINGLE_PENDING, enum mall_inner_states{MALL_UNRESERVED, MALL_NOT_STARTED, MALL_RMS_COMPLETED, MALL_SPAWN_PENDING, MALL_SPAWN_SINGLE_PENDING,
MALL_SPAWN_SINGLE_COMPLETED, MALL_SPAWN_ADAPT_POSTPONE, MALL_SPAWN_COMPLETED, MALL_DIST_PENDING, MALL_DIST_COMPLETED, MALL_SPAWN_SINGLE_COMPLETED, MALL_SPAWN_ADAPT_POSTPONE, MALL_SPAWN_COMPLETED, MALL_DIST_PENDING, MALL_DIST_COMPLETED,
MALL_SPAWN_ADAPT_PENDING, MALL_USER_PENDING, MALL_USER_COMPLETED, MALL_SPAWN_ADAPTED, MALL_COMPLETED}; MALL_SPAWN_ADAPT_PENDING, MALL_USER_START, MALL_USER_PENDING, MALL_USER_COMPLETED, MALL_SPAWN_ADAPTED, MALL_COMPLETED};
enum mam_states{MAM_UNRESERVED, MAM_NOT_STARTED, MAM_PENDING, MAM_USER_PENDING, MAM_COMPLETED}; enum mam_states{MAM_UNRESERVED, MAM_NOT_STARTED, MAM_PENDING, MAM_USER_PENDING, MAM_COMPLETED};
enum mam_proc_states{MAM_PROC_CONTINUE, MAM_PROC_NEW_RANK, MAM_PROC_ZOMBIE}; enum mam_proc_states{MAM_PROC_CONTINUE, MAM_PROC_NEW_RANK, MAM_PROC_ZOMBIE};
......
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