XBT_PRIVATE double smpi_process_simulated_elapsed(void);
XBT_PRIVATE void smpi_process_set_sampling(int s);
XBT_PRIVATE int smpi_process_get_sampling(void);
-XBT_PRIVATE void smpi_process_set_replaying(int s);
-XBT_PRIVATE int smpi_process_get_replaying(void);
+XBT_PRIVATE void smpi_process_set_replaying(bool s);
+XBT_PRIVATE bool smpi_process_get_replaying(void);
XBT_PRIVATE void smpi_deployment_register_process(const char* instance_id, int rank, int index, MPI_Comm**, xbt_bar_t*);
XBT_PRIVATE void smpi_deployment_cleanup_instances(void);
// If we are in replay - perform an ugly hack
// tell SimGrid we are not in replay for a while, because we need the buffers to be copied for the following calls
- int replaying = 0; //cache data to set it back again after
+ bool replaying = false; //cache data to set it back again after
if(smpi_process_get_replaying()){
- replaying=1;
- smpi_process_set_replaying(0);
+ replaying=true;
+ smpi_process_set_replaying(false);
}
if(smpi_privatize_global_variables){ //we need to switch as the called function may silently touch global variables
}
xbt_free(leader_list);
- if(replaying==1)
- smpi_process_set_replaying(1);
+ if(replaying)
+ smpi_process_set_replaying(true);
}
int smpi_comm_attr_delete(MPI_Comm comm, int keyval){
char state;
int sampling; /* inside an SMPI_SAMPLE_ block? */
char* instance_id;
- int replaying; /* is the process replaying a trace */
+ bool replaying; /* is the process replaying a trace */
xbt_bar_t finalization_barrier;
int return_value;
smpi_trace_call_location_t* trace_call_loc;
if(temp_bar != NULL) data->finalization_barrier = temp_bar;
data->index = index;
data->instance_id = instance_id;
- data->replaying = 0;
+ data->replaying = false;
//xbt_free(simcall_process_get_data(proc));
simdata_process_t simdata = static_cast<simdata_process_t>(simcall_process_get_data(proc));
process_data[index_to_process_data[index]]->state = SMPI_INITIALIZED;
}
-void smpi_process_set_replaying(int value){
+void smpi_process_set_replaying(bool value){
int index = smpi_process_index();
if ((index != MPI_UNDEFINED) && (process_data[index_to_process_data[index]]->state != SMPI_FINALIZED))
process_data[index_to_process_data[index]]->replaying = value;
}
-int smpi_process_get_replaying(){
+bool smpi_process_get_replaying(){
int index = smpi_process_index();
if (index != MPI_UNDEFINED)
return process_data[index_to_process_data[index]]->replaying;
- else return _xbt_replay_is_active();
+ else return (_xbt_replay_is_active() != 0);
}
int smpi_global_size(void)
/* First initializes everything */
smpi_process_init(argc, argv);
smpi_process_mark_as_initialized();
- smpi_process_set_replaying(1);
+ smpi_process_set_replaying(true);
int rank = smpi_process_index();
TRACE_smpi_init(rank);