Mentions légales du service

Skip to content
Snippets Groups Projects
Commit bd3ee28e authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

control: Fix warning/error outputs

parent 2e84ce54
No related branches found
No related tags found
1 merge request!290Add a pause field to the chamctxt to detect potential deadlock
...@@ -70,7 +70,7 @@ int chameleon_sequence_destroy(CHAM_context_t *chamctxt, RUNTIME_sequence_t *seq ...@@ -70,7 +70,7 @@ int chameleon_sequence_destroy(CHAM_context_t *chamctxt, RUNTIME_sequence_t *seq
int chameleon_sequence_wait(CHAM_context_t *chamctxt, RUNTIME_sequence_t *sequence) int chameleon_sequence_wait(CHAM_context_t *chamctxt, RUNTIME_sequence_t *sequence)
{ {
if ( chamctxt->runtime_paused ) { if ( chamctxt->runtime_paused ) {
chameleon_warning("chameleon_sequence_wait()", "CHAMELEON was paused, so it is resumed and it will be paused after the wait"); chameleon_warning("chameleon_sequence_wait", "CHAMELEON was paused, so it is resumed and it will be paused after the wait");
RUNTIME_resume( chamctxt ); RUNTIME_resume( chamctxt );
} }
RUNTIME_sequence_wait( chamctxt, sequence ); RUNTIME_sequence_wait( chamctxt, sequence );
......
...@@ -137,7 +137,7 @@ int __chameleon_finalize(void) ...@@ -137,7 +137,7 @@ int __chameleon_finalize(void)
{ {
CHAM_context_t *chamctxt = chameleon_context_self(); CHAM_context_t *chamctxt = chameleon_context_self();
if (chamctxt == NULL) { if (chamctxt == NULL) {
chameleon_error("CHAMELEON_Finalize()", "CHAMELEON not initialized"); chameleon_error("CHAMELEON_Finalize", "CHAMELEON not initialized");
return CHAMELEON_ERR_NOT_INITIALIZED; return CHAMELEON_ERR_NOT_INITIALIZED;
} }
RUNTIME_flush(); RUNTIME_flush();
...@@ -191,11 +191,11 @@ int CHAMELEON_Pause(void) ...@@ -191,11 +191,11 @@ int CHAMELEON_Pause(void)
{ {
CHAM_context_t *chamctxt = chameleon_context_self(); CHAM_context_t *chamctxt = chameleon_context_self();
if (chamctxt == NULL) { if (chamctxt == NULL) {
chameleon_error("CHAMELEON_Pause()", "CHAMELEON not initialized"); chameleon_error("CHAMELEON_Pause", "CHAMELEON not initialized");
return CHAMELEON_ERR_NOT_INITIALIZED; return CHAMELEON_ERR_NOT_INITIALIZED;
} }
if ( chamctxt->runtime_paused ) { if ( chamctxt->runtime_paused ) {
chameleon_warning("CHAMELEON_Pause()", "CHAMELEON already paused"); chameleon_warning("CHAMELEON_Pause", "CHAMELEON already paused");
return CHAMELEON_SUCCESS; return CHAMELEON_SUCCESS;
} }
chamctxt->runtime_paused = CHAMELEON_TRUE; chamctxt->runtime_paused = CHAMELEON_TRUE;
...@@ -219,11 +219,11 @@ int CHAMELEON_Resume(void) ...@@ -219,11 +219,11 @@ int CHAMELEON_Resume(void)
{ {
CHAM_context_t *chamctxt = chameleon_context_self(); CHAM_context_t *chamctxt = chameleon_context_self();
if (chamctxt == NULL) { if (chamctxt == NULL) {
chameleon_error("CHAMELEON_Resume()", "CHAMELEON not initialized"); chameleon_error("CHAMELEON_Resume", "CHAMELEON not initialized");
return CHAMELEON_ERR_NOT_INITIALIZED; return CHAMELEON_ERR_NOT_INITIALIZED;
} }
if ( !chamctxt->runtime_paused ) { if ( !chamctxt->runtime_paused ) {
chameleon_warning("CHAMELEON_Resume()", "CHAMELEON was already resumed"); chameleon_warning("CHAMELEON_Resume", "CHAMELEON was already resumed");
return CHAMELEON_SUCCESS; return CHAMELEON_SUCCESS;
} }
chamctxt->runtime_paused = CHAMELEON_FALSE; chamctxt->runtime_paused = CHAMELEON_FALSE;
...@@ -246,10 +246,10 @@ int CHAMELEON_Distributed_start(void) ...@@ -246,10 +246,10 @@ int CHAMELEON_Distributed_start(void)
{ {
CHAM_context_t *chamctxt = chameleon_context_self(); CHAM_context_t *chamctxt = chameleon_context_self();
if (chamctxt == NULL) { if (chamctxt == NULL) {
chameleon_error("CHAMELEON_Finalize()", "CHAMELEON not initialized"); chameleon_error("CHAMELEON_Finalize", "CHAMELEON not initialized");
return CHAMELEON_ERR_NOT_INITIALIZED; return CHAMELEON_ERR_NOT_INITIALIZED;
} }
RUNTIME_barrier (chamctxt); RUNTIME_barrier( chamctxt );
return CHAMELEON_SUCCESS; return CHAMELEON_SUCCESS;
} }
...@@ -268,10 +268,10 @@ int CHAMELEON_Distributed_stop(void) ...@@ -268,10 +268,10 @@ int CHAMELEON_Distributed_stop(void)
{ {
CHAM_context_t *chamctxt = chameleon_context_self(); CHAM_context_t *chamctxt = chameleon_context_self();
if (chamctxt == NULL) { if (chamctxt == NULL) {
chameleon_error("CHAMELEON_Finalize()", "CHAMELEON not initialized"); chameleon_error("CHAMELEON_Finalize", "CHAMELEON not initialized");
return CHAMELEON_ERR_NOT_INITIALIZED; return CHAMELEON_ERR_NOT_INITIALIZED;
} }
RUNTIME_barrier (chamctxt); RUNTIME_barrier( chamctxt );
return CHAMELEON_SUCCESS; return CHAMELEON_SUCCESS;
} }
...@@ -291,7 +291,7 @@ int CHAMELEON_Comm_size() ...@@ -291,7 +291,7 @@ int CHAMELEON_Comm_size()
{ {
CHAM_context_t *chamctxt = chameleon_context_self(); CHAM_context_t *chamctxt = chameleon_context_self();
if (chamctxt == NULL) { if (chamctxt == NULL) {
chameleon_error("CHAMELEON_Comm_size()", "CHAMELEON not initialized"); chameleon_error("CHAMELEON_Comm_size", "CHAMELEON not initialized");
return -1; return -1;
} }
...@@ -314,7 +314,7 @@ int CHAMELEON_Comm_rank() ...@@ -314,7 +314,7 @@ int CHAMELEON_Comm_rank()
{ {
CHAM_context_t *chamctxt = chameleon_context_self(); CHAM_context_t *chamctxt = chameleon_context_self();
if (chamctxt == NULL) { if (chamctxt == NULL) {
chameleon_error("CHAMELEON_Comm_rank()", "CHAMELEON not initialized"); chameleon_error("CHAMELEON_Comm_rank", "CHAMELEON not initialized");
return -1; return -1;
} }
...@@ -337,7 +337,7 @@ int CHAMELEON_GetThreadNbr( ) ...@@ -337,7 +337,7 @@ int CHAMELEON_GetThreadNbr( )
{ {
CHAM_context_t *chamctxt = chameleon_context_self(); CHAM_context_t *chamctxt = chameleon_context_self();
if (chamctxt == NULL) { if (chamctxt == NULL) {
chameleon_error("CHAMELEON_GetThreadNbr()", "CHAMELEON not initialized"); chameleon_error("CHAMELEON_GetThreadNbr", "CHAMELEON not initialized");
return -1; return -1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment