void TRACE_smpi_alloc()
{
- keys = xbt_dict_new_homogeneous(xbt_free);
+ keys = xbt_dict_new_homogeneous(xbt_dynar_free_voidp);
process_category = xbt_dict_new_homogeneous(xbt_free);
}
static double smpi_os(double size)
{
- if (!smpi_os_values)
- smpi_os_values =
- parse_factor(sg_cfg_get_string("smpi/os"));
-
+ if (!smpi_os_values) {
+ smpi_os_values = parse_factor(sg_cfg_get_string("smpi/os"));
+ smpi_register_static(smpi_os_values, xbt_dynar_free_voidp);
+ }
unsigned int iter = 0;
s_smpi_factor_t fact;
double current=0.0;
static double smpi_ois(double size)
{
- if (!smpi_ois_values)
- smpi_ois_values =
- parse_factor(sg_cfg_get_string("smpi/ois"));
-
+ if (!smpi_ois_values) {
+ smpi_ois_values = parse_factor(sg_cfg_get_string("smpi/ois"));
+ smpi_register_static(smpi_ois_values, xbt_dynar_free_voidp);
+ }
unsigned int iter = 0;
s_smpi_factor_t fact;
double current=0.0;
static double smpi_or(double size)
{
- if (!smpi_or_values)
- smpi_or_values =
- parse_factor(sg_cfg_get_string("smpi/or"));
-
+ if (!smpi_or_values) {
+ smpi_or_values = parse_factor(sg_cfg_get_string("smpi/or"));
+ smpi_register_static(smpi_or_values, xbt_dynar_free_voidp);
+ }
unsigned int iter = 0;
s_smpi_factor_t fact;
double current=0.0;
data->benching = !sample_enough_benchs(data);
XBT_DEBUG("XXXX Re-entering the benched nest %s. %s",loc, (data->benching?"more benching needed":"we have enough data, skip computes"));
}
- free(loc);
+ xbt_free(loc);
}
int smpi_sample_2(int global, const char *file, int line)
xbt_assert(samples, "Y U NO use SMPI_SAMPLE_* macros? Stop messing directly with smpi_sample_* functions!");
data = xbt_dict_get(samples, loc);
XBT_DEBUG("sample2 %s",loc);
- free(loc);
+ xbt_free(loc);
if (data->benching==1) {
// we need to run a new bench
xbt_assert(samples, "Y U NO use SMPI_SAMPLE_* macros? Stop messing directly with smpi_sample_* functions!");
data = xbt_dict_get(samples, loc);
XBT_DEBUG("sample3 %s",loc);
+ xbt_free(loc);
if (data->benching==0) {
THROW_IMPOSSIBLE;
smpi_comm_destroy(MPI_COMM_WORLD);
MPI_COMM_WORLD = MPI_COMM_NULL;
for (i = 0; i < count; i++) {
+ smpi_group_destroy(smpi_comm_group(process_data[i]->comm_self));
smpi_comm_destroy(process_data[i]->comm_self);
xbt_os_timer_free(process_data[i]->timer);
simcall_rdv_destroy(process_data[i]->mailbox);
if ((*type)->has_subtype == 1){
((s_smpi_subtype_t *)(*type)->substruct)->subtype_free(type);
+ xbt_free((*type)->substruct);
}
xbt_free(*type);
int communicator_size = 0;
static int active_processes = 0;
-xbt_dynar_t *reqq;
+xbt_dynar_t *reqq = NULL;
MPI_Datatype MPI_DEFAULT_TYPE, MPI_CURRENT_TYPE;
/*initialize the number of active processes */
active_processes = smpi_process_count();
- reqq=xbt_new0(xbt_dynar_t,active_processes);
+ if (!reqq) {
+ reqq=xbt_new0(xbt_dynar_t,active_processes);
- for(i=0;i<active_processes;i++){
- reqq[i]=xbt_dynar_new(sizeof(MPI_Request),NULL);
+ for(i=0;i<active_processes;i++){
+ reqq[i]=xbt_dynar_new(sizeof(MPI_Request),NULL);
+ }
}
}
double sim_time= 1.;
/* One active process will stop. Decrease the counter*/
active_processes--;
+ XBT_DEBUG("There are %lu elements in reqq[*]",
+ xbt_dynar_length(reqq[smpi_comm_rank(MPI_COMM_WORLD)]));
+ xbt_dynar_free(&reqq[smpi_comm_rank(MPI_COMM_WORLD)]);
if(!active_processes){
/* Last process alive speaking */
/* end the simulated timer */
- xbt_dynar_free(reqq);
sim_time = smpi_process_simulated_elapsed();
XBT_INFO("Simulation time %g", sim_time);
_xbt_replay_action_exit();
+ xbt_free(reqq);
+ reqq = NULL;
}
return PMPI_Finalize();
}
surf_model_exit(surf_network_model);
surf_network_model = NULL;
- if (smpi_bw_factor)
- xbt_dynar_free(&smpi_bw_factor);
- if (smpi_lat_factor)
- xbt_dynar_free(&smpi_lat_factor);
+ xbt_dict_free(&gap_lookup);
+ xbt_dynar_free(&smpi_bw_factor);
+ xbt_dynar_free(&smpi_lat_factor);
}
static void smpi_gap_append(double size, const link_CM02_t link,
xbt_replay_reader_t reader = xbt_replay_reader_new(argv[1]);
while ((evt=xbt_replay_reader_get(reader))) {
if (!strcmp(argv[0],evt[0])) {
- action_fun function =
- (action_fun)xbt_dict_get(action_funs, evt[1]);
+ action_fun function = (action_fun)xbt_dict_get(action_funs, evt[1]);
function(evt);
- free(evt);
} else {
XBT_WARN("%s: Ignore trace element not for me",
xbt_replay_reader_position(reader));
}
+ free(evt);
}
xbt_replay_reader_free(&reader);
}
}
-
+ MPI_Type_free(&columntype);
MPI_Finalize();
return 0;
}
fflush(stdout);
}
+ MPI_Type_free(&type);
+ MPI_Type_free(&type2);
MPI_Finalize();
return 0;
}
/* Clean up the type */
MPI_Type_free( &mystruct );
+ MPI_Type_free( &type2 );
MPI_Finalize( );
return 0;
}
}
-
+ MPI_Type_free(&columntype);
MPI_Finalize();
return 0;
}