# Extracting timing information for the static collective write/read algorithms.
# The processes register their information and continue. # Actual printing of timing information happens at file close. # Triggered by MCA parameter at runtime This commit was SVN r27442.
Этот коммит содержится в:
родитель
240d56feeb
Коммит
95d38fdaf5
@ -31,7 +31,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#define DEBUG_ON 0
|
||||
#define TIME_BREAKDOWN 0
|
||||
|
||||
|
||||
|
||||
typedef struct local_io_array {
|
||||
@ -93,6 +93,10 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
MPI_Request *send_req=NULL, *recv_req=NULL;
|
||||
/* MPI_Request *grecv_req=NULL, *gsend_req=NULL; */
|
||||
|
||||
double read_time = 0.0, start_read_time = 0.0, end_read_time = 0.0;
|
||||
double rcomm_time = 0.0, start_rcomm_time = 0.0, end_rcomm_time = 0.0;
|
||||
double read_exch = 0.0, start_rexch = 0.0, end_rexch = 0.0;
|
||||
print_entry nentry;
|
||||
#if DEBUG_ON
|
||||
MPI_Aint gc_in;
|
||||
#endif
|
||||
@ -346,6 +350,9 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
#endif
|
||||
|
||||
if(mca_io_ompio_coll_timing_info)
|
||||
start_rexch = MPI_Wtime();
|
||||
|
||||
for (index = 0; index < cycles; index++){
|
||||
|
||||
|
||||
@ -436,6 +443,8 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
if(mca_io_ompio_coll_timing_info)
|
||||
start_rcomm_time = MPI_Wtime();
|
||||
|
||||
ret = MCA_PML_CALL(irecv(receive_buf,
|
||||
bytes_to_read_in_cycle,
|
||||
@ -448,6 +457,11 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(mca_io_ompio_coll_timing_info){
|
||||
end_rcomm_time = MPI_Wtime();
|
||||
rcomm_time += end_rcomm_time - start_rcomm_time;
|
||||
}
|
||||
|
||||
|
||||
if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank) {
|
||||
for (i=0;i<fh->f_procs_per_group; i++){
|
||||
@ -459,6 +473,7 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
if (bytes_remaining[i]){ /*Remaining bytes in the current entry of
|
||||
the global offset array*/
|
||||
if (bytes_remaining[i] <= bytes_per_process[i]){
|
||||
|
||||
blocklen_per_process[i][disp_index[i] - 1] = bytes_remaining[i];
|
||||
displs_per_process[i][disp_index[i] - 1] =
|
||||
global_iov_array[sorted[current_index[i]]].offset +
|
||||
@ -678,6 +693,8 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
fh->f_io_array[i].length);
|
||||
}
|
||||
#endif
|
||||
if(mca_io_ompio_coll_timing_info)
|
||||
start_read_time = MPI_Wtime();
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
if (OMPI_SUCCESS != fh->f_fbtl->fbtl_preadv (fh, NULL)) {
|
||||
@ -686,6 +703,13 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if(mca_io_ompio_coll_timing_info){
|
||||
end_read_time = MPI_Wtime();
|
||||
read_time += end_read_time - start_read_time;
|
||||
}
|
||||
|
||||
|
||||
#if DEBUG_ON
|
||||
printf("************Cycle: %d, Aggregator: %d ***************\n",
|
||||
index+1,fh->f_rank);
|
||||
@ -727,6 +751,9 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
if(mca_io_ompio_coll_timing_info)
|
||||
start_rcomm_time = MPI_Wtime();
|
||||
|
||||
for (i=0;i<fh->f_procs_per_group; i++){
|
||||
ompi_datatype_create_hindexed(disp_index[i],
|
||||
blocklen_per_process[i],
|
||||
@ -760,6 +787,11 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(mca_io_ompio_coll_timing_info){
|
||||
end_rcomm_time = MPI_Wtime();
|
||||
rcomm_time += end_rcomm_time - start_rcomm_time;
|
||||
}
|
||||
|
||||
position += bytes_to_read_in_cycle;
|
||||
|
||||
if (!(fh->f_flags & OMPIO_CONTIGUOUS_MEMORY)) {
|
||||
@ -798,6 +830,7 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
receive_buf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != recv_req){
|
||||
free(recv_req);
|
||||
recv_req = NULL;
|
||||
@ -841,6 +874,24 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
}
|
||||
}
|
||||
if(mca_io_ompio_coll_timing_info){
|
||||
end_rexch = MPI_Wtime();
|
||||
read_exch += end_rexch - start_rexch;
|
||||
nentry.time[0] = read_time;
|
||||
nentry.time[1] = rcomm_time;
|
||||
nentry.time[2] = read_exch;
|
||||
if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank)
|
||||
nentry.aggregator = 1;
|
||||
else
|
||||
nentry.aggregator = 0;
|
||||
nentry.nprocs_for_coll = mca_fcoll_static_num_io_procs;
|
||||
if (!ompi_io_ompio_full_print_queue(coll_read_time)){
|
||||
ompi_io_ompio_register_print_entry(coll_read_time,
|
||||
nentry);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#define DEBUG_ON 0
|
||||
#define TIME_BREAKDOWN 0
|
||||
|
||||
|
||||
typedef struct local_io_array{
|
||||
OMPI_MPI_OFFSET_TYPE offset;
|
||||
@ -89,6 +89,13 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
|
||||
ompi_datatype_t *types[3];
|
||||
ompi_datatype_t *io_array_type=MPI_DATATYPE_NULL;
|
||||
/*----------------------------------------------*/
|
||||
|
||||
double write_time = 0.0, start_write_time = 0.0, end_write_time = 0.0;
|
||||
double comm_time = 0.0, start_comm_time = 0.0, end_comm_time = 0.0;
|
||||
double exch_write = 0.0, start_exch = 0.0, end_exch = 0.0;
|
||||
print_entry nentry;
|
||||
|
||||
|
||||
|
||||
#if DEBUG_ON
|
||||
MPI_Aint gc_in;
|
||||
@ -350,6 +357,10 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(mca_io_ompio_coll_timing_info)
|
||||
start_exch = MPI_Wtime();
|
||||
|
||||
|
||||
for (index = 0; index < cycles; index++){
|
||||
if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank) {
|
||||
@ -669,6 +680,9 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
|
||||
bytes_to_write_in_cycle,
|
||||
fh->f_procs_per_group);
|
||||
#endif
|
||||
if(mca_io_ompio_coll_timing_info)
|
||||
start_comm_time = MPI_Wtime();
|
||||
|
||||
global_buf = (char *) malloc (global_count);
|
||||
if (NULL == global_buf){
|
||||
opal_output(1, "OUT OF MEMORY");
|
||||
@ -792,7 +806,13 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if(mca_io_ompio_coll_timing_info){
|
||||
end_comm_time = MPI_Wtime();
|
||||
comm_time += end_comm_time - start_comm_time;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank) {
|
||||
fh->f_io_array = (mca_io_ompio_io_array_t *) malloc
|
||||
(entries_per_aggregator * sizeof (mca_io_ompio_io_array_t));
|
||||
@ -836,20 +856,20 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TIME_BREAKDOWN
|
||||
start_ptime = MPI_Wtime();
|
||||
#endif
|
||||
if(mca_io_ompio_coll_timing_info)
|
||||
start_write_time = MPI_Wtime();
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
if (OMPI_SUCCESS != fh->f_fbtl->fbtl_pwritev (fh, NULL)) {
|
||||
opal_output (1, "WRITE FAILED\n");
|
||||
ret = OMPI_ERROR;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
if(mca_io_ompio_coll_timing_info){
|
||||
end_write_time = MPI_Wtime();
|
||||
write_time += end_write_time - start_write_time;
|
||||
}
|
||||
#if TIME_BREAKDOWN
|
||||
end_ptime = MPI_Wtime();
|
||||
tpw = end_ptime - start_ptime;
|
||||
#endif
|
||||
|
||||
}
|
||||
if (NULL != send_req){
|
||||
@ -877,6 +897,23 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
}
|
||||
}
|
||||
if(mca_io_ompio_coll_timing_info){
|
||||
end_exch = MPI_Wtime();
|
||||
exch_write += end_exch - start_exch;
|
||||
nentry.time[0] = write_time;
|
||||
nentry.time[1] = comm_time;
|
||||
nentry.time[2] = exch_write;
|
||||
if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank)
|
||||
nentry.aggregator = 1;
|
||||
else
|
||||
nentry.aggregator = 0;
|
||||
nentry.nprocs_for_coll = mca_fcoll_static_num_io_procs;
|
||||
if (!ompi_io_ompio_full_print_queue(coll_write_time)){
|
||||
ompi_io_ompio_register_print_entry(coll_write_time,
|
||||
nentry);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
exit:
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user