next step in making the print_queue functionality move to common/ompio
Этот коммит содержится в:
родитель
af67c8f239
Коммит
fe17410943
@ -19,7 +19,8 @@
|
||||
#
|
||||
|
||||
headers = \
|
||||
common_ompio_print_queue.h
|
||||
common_ompio_print_queue.h \
|
||||
common_ompio.h
|
||||
|
||||
sources = \
|
||||
common_ompio_print_queue.c
|
||||
|
27
ompi/mca/common/ompio/common_ompio.h
Обычный файл
27
ompi/mca/common/ompio/common_ompio.h
Обычный файл
@ -0,0 +1,27 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef MCA_COMMON_OMPIO_H
|
||||
#define MCA_COMMON_OMPIO_H
|
||||
|
||||
#include "ompi/mca/common/ompio/common_ompio_print_queue.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
|
||||
#endif /* MCA_COMMON_OMPIO_H */
|
@ -11,10 +11,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2011-2015 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
*
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -27,38 +24,13 @@
|
||||
#include "ompi/communicator/communicator.h"
|
||||
#include "ompi/datatype/ompi_datatype.h"
|
||||
|
||||
#include "common_ompio_print_queue.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
mca_common_ompio_print_queue *coll_write_time=NULL;
|
||||
mca_common_ompio_print_queue *coll_read_time=NULL;
|
||||
|
||||
/* Print queue related function implementations */
|
||||
int common_ompio_set_print_queue (mca_common_ompio_print_queue **q,
|
||||
int queue_type){
|
||||
int mca_common_ompio_initialize_print_queue( mca_common_ompio_print_queue **r){
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
|
||||
switch(queue_type) {
|
||||
|
||||
case WRITE_PRINT_QUEUE:
|
||||
*q = coll_write_time;
|
||||
break;
|
||||
case READ_PRINT_QUEUE:
|
||||
*q = coll_read_time;
|
||||
break;
|
||||
}
|
||||
|
||||
if (NULL == q){
|
||||
ret = OMPI_ERROR;
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int common_ompio_initialize_print_queue(void *r){
|
||||
|
||||
mca_common_ompio_print_queue *q;
|
||||
mca_common_ompio_print_queue *q=NULL;
|
||||
int ret = OMPI_SUCCESS;
|
||||
|
||||
q = (mca_common_ompio_print_queue *) malloc ( sizeof(mca_common_ompio_print_queue));
|
||||
@ -66,100 +38,74 @@ int common_ompio_initialize_print_queue(void *r){
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
q->first = 0;
|
||||
q->last = COMMON_OMPIO_QUEUESIZE - 1;
|
||||
q->last = MCA_COMMON_OMPIO_QUEUESIZE - 1;
|
||||
q->count = 0;
|
||||
|
||||
*r = ( void *) *q;
|
||||
return ret;
|
||||
}
|
||||
int common_ompio_register_print_entry (int queue_type,
|
||||
mca_common_ompio_print_entry x){
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_common_ompio_print_queue *q=NULL;
|
||||
|
||||
ret = common_ompio_set_print_queue(&q, queue_type);
|
||||
|
||||
if (ret != OMPI_ERROR){
|
||||
if (q->count >= COMMON_OMPIO_QUEUESIZE){
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
else{
|
||||
q->last = (q->last + 1) % COMMON_OMPIO_QUEUESIZE;
|
||||
q->entry[q->last] = x;
|
||||
q->count = q->count + 1;
|
||||
}
|
||||
}
|
||||
*r = q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int common_ompio_unregister_print_entry (int queue_type,
|
||||
mca_common_ompio_print_entry *x){
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_common_ompio_print_queue *q=NULL;
|
||||
ret = common_ompio_set_print_queue(&q, queue_type);
|
||||
if (ret != OMPI_ERROR){
|
||||
if (q->count <= 0){
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
else{
|
||||
*x = q->entry[q->first];
|
||||
q->first = (q->first+1) % COMMON_OMPIO_QUEUESIZE;
|
||||
q->count = q->count - 1;
|
||||
}
|
||||
int mca_common_ompio_register_print_entry ( mca_common_ompio_print_queue *q,
|
||||
mca_common_ompio_print_entry x)
|
||||
{
|
||||
if (q->count >= MCA_COMMON_OMPIO_QUEUESIZE){
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
else{
|
||||
q->last = (q->last + 1) % MCA_COMMON_OMPIO_QUEUESIZE;
|
||||
q->entry[q->last] = x;
|
||||
q->count = q->count + 1;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int common_ompio_empty_print_queue(int queue_type){
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_common_ompio_print_queue *q=NULL;
|
||||
ret = common_ompio_set_print_queue(&q, queue_type);
|
||||
|
||||
assert (ret != OMPI_ERROR);
|
||||
(void)ret; // silence compiler warning
|
||||
if (q->count == 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
int mca_common_ompio_unregister_print_entry ( mca_common_ompio_print_queue *q,
|
||||
mca_common_ompio_print_entry *x)
|
||||
{
|
||||
|
||||
if (q->count <= 0){
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
else{
|
||||
*x = q->entry[q->first];
|
||||
q->first = (q->first+1) % MCA_COMMON_OMPIO_QUEUESIZE;
|
||||
q->count = q->count - 1;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int common_ompio_full_print_queue(int queue_type){
|
||||
int mca_common_ompio_empty_print_queue(mca_common_ompio_print_queue *q)
|
||||
{
|
||||
if (q->count == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_common_ompio_print_queue *q=NULL;
|
||||
ret = common_ompio_set_print_queue(&q, queue_type);
|
||||
|
||||
assert ( ret != OMPI_ERROR);
|
||||
(void)ret; // silence compiler warning
|
||||
if (q->count < COMMON_OMPIO_QUEUESIZE)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
int mca_common_ompio_full_print_queue(mca_common_ompio_print_queue *q)
|
||||
{
|
||||
if (q->count < MCA_COMMON_OMPIO_QUEUESIZE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int common_ompio_print_time_info(int queue_type,
|
||||
char *name,
|
||||
mca_io_ompio_file_t *fh){
|
||||
int mca_common_ompio_print_time_info( mca_common_ompio_print_queue *q,
|
||||
char *name,
|
||||
struct mca_io_ompio_file_t *fh){
|
||||
|
||||
int i = 0, j=0, nprocs_for_coll = 0, ret = OMPI_SUCCESS, count = 0;
|
||||
double *time_details = NULL, *final_sum = NULL;
|
||||
double *final_max = NULL, *final_min = NULL;
|
||||
double *final_time_details=NULL;
|
||||
mca_common_ompio_print_queue *q=NULL;
|
||||
|
||||
ret = common_ompio_set_print_queue(&q, queue_type);
|
||||
|
||||
assert (ret != OMPI_ERROR);
|
||||
nprocs_for_coll = q->entry[0].nprocs_for_coll;
|
||||
time_details = (double *) malloc (4*sizeof(double));
|
||||
time_details = (double *) calloc (4,sizeof(double));
|
||||
if ( NULL == time_details){
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
@ -187,24 +133,13 @@ int common_ompio_print_time_info(int queue_type,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
final_time_details =
|
||||
(double *)malloc
|
||||
(fh->f_size * 4 * sizeof(double));
|
||||
final_time_details = (double *)calloc (fh->f_size, 4 * sizeof(double));
|
||||
if (NULL == final_time_details){
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
count = 4 * fh->f_size;
|
||||
for(i=0;i<count;i++){
|
||||
final_time_details[i] = 0.0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++){
|
||||
time_details[i] = 0.0;
|
||||
}
|
||||
|
||||
if (q->count > 0){
|
||||
@ -221,17 +156,18 @@ int common_ompio_print_time_info(int queue_type,
|
||||
}
|
||||
}
|
||||
|
||||
fh->f_comm->c_coll.coll_gather(time_details,
|
||||
4,
|
||||
MPI_DOUBLE,
|
||||
final_time_details,
|
||||
4,
|
||||
MPI_DOUBLE,
|
||||
0,
|
||||
fh->f_comm,
|
||||
fh->f_comm->c_coll.coll_gather_module);
|
||||
|
||||
ret = fh->f_comm->c_coll.coll_gather(time_details,
|
||||
4,
|
||||
MPI_DOUBLE,
|
||||
final_time_details,
|
||||
4,
|
||||
MPI_DOUBLE,
|
||||
0,
|
||||
fh->f_comm,
|
||||
fh->f_comm->c_coll.coll_gather_module);
|
||||
|
||||
if ( OMPI_SUCCESS != ret ) {
|
||||
}
|
||||
|
||||
if (!fh->f_rank){
|
||||
|
||||
|
@ -25,16 +25,11 @@
|
||||
|
||||
|
||||
#include "mpi.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
|
||||
OMPI_DECLSPEC extern int mca_io_ompio_coll_timing_info;
|
||||
struct mca_io_ompio_file_t;
|
||||
|
||||
#define COMMON_OMPIO_QUEUESIZE 2048
|
||||
|
||||
/* PRINT QUEUES*/
|
||||
#define WRITE_PRINT_QUEUE 1809
|
||||
#define READ_PRINT_QUEUE 2178
|
||||
/*---------------------------*/
|
||||
#define MCA_COMMON_OMPIO_QUEUESIZE 2048
|
||||
|
||||
/*To extract time-information */
|
||||
typedef struct {
|
||||
@ -44,34 +39,27 @@ typedef struct {
|
||||
}mca_common_ompio_print_entry;
|
||||
|
||||
typedef struct {
|
||||
mca_common_ompio_print_entry entry[COMMON_OMPIO_QUEUESIZE + 1];
|
||||
mca_common_ompio_print_entry entry[MCA_COMMON_OMPIO_QUEUESIZE + 1];
|
||||
int first;
|
||||
int last;
|
||||
int count;
|
||||
} mca_common_ompio_print_queue;
|
||||
|
||||
|
||||
OMPI_DECLSPEC extern mca_common_ompio_print_queue *coll_write_time;
|
||||
OMPI_DECLSPEC extern mca_common_ompio_print_queue *coll_read_time;
|
||||
OMPI_DECLSPEC int mca_common_ompio_register_print_entry (mca_common_ompio_print_queue *q,
|
||||
mca_common_ompio_print_entry x);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_unregister_print_entry (mca_common_ompio_print_queue *q,
|
||||
mca_common_ompio_print_entry *x);
|
||||
|
||||
OMPI_DECLSPEC int common_ompio_register_print_entry (int queue_type,
|
||||
mca_common_ompio_print_entry x);
|
||||
OMPI_DECLSPEC int mca_common_ompio_empty_print_queue(mca_common_ompio_print_queue *q);
|
||||
|
||||
OMPI_DECLSPEC int common_ompio_unregister_print_entry (int queue_type,
|
||||
mca_common_ompio_print_entry *x);
|
||||
OMPI_DECLSPEC int mca_common_ompio_full_print_queue(mca_common_ompio_print_queue *q);
|
||||
|
||||
OMPI_DECLSPEC int common_ompio_empty_print_queue(int queue_type);
|
||||
OMPI_DECLSPEC int mca_common_ompio_initialize_print_queue(mca_common_ompio_print_queue **q);
|
||||
|
||||
OMPI_DECLSPEC int common_ompio_full_print_queue(int queue_type);
|
||||
|
||||
OMPI_DECLSPEC int common_ompio_initialize_print_queue(mca_common_ompio_print_queue *q);
|
||||
|
||||
OMPI_DECLSPEC int common_ompio_print_time_info(int queue_type,
|
||||
char *name_operation,
|
||||
mca_io_ompio_file_t *fh);
|
||||
int common_ompio_set_print_queue (mca_common_ompio_print_queue **q,
|
||||
int queue_type);
|
||||
OMPI_DECLSPEC int mca_common_ompio_print_time_info( mca_common_ompio_print_queue *q,
|
||||
char *name_operation, struct mca_io_ompio_file_t *fh);
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
@ -52,9 +52,6 @@
|
||||
#endif
|
||||
#include "io_ompio.h"
|
||||
|
||||
mca_io_ompio_print_queue *coll_write_time=NULL;
|
||||
mca_io_ompio_print_queue *coll_read_time=NULL;
|
||||
|
||||
|
||||
static int mca_io_ompio_create_groups(mca_io_ompio_file_t *fh,
|
||||
size_t bytes_per_proc);
|
||||
@ -1179,256 +1176,6 @@ void mca_io_ompio_get_bytes_per_agg ( int *bytes_per_agg)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Print queue related function implementations */
|
||||
int ompi_io_ompio_set_print_queue (mca_io_ompio_print_queue **q,
|
||||
int queue_type){
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
|
||||
switch(queue_type) {
|
||||
|
||||
case WRITE_PRINT_QUEUE:
|
||||
*q = coll_write_time;
|
||||
break;
|
||||
case READ_PRINT_QUEUE:
|
||||
*q = coll_read_time;
|
||||
break;
|
||||
}
|
||||
|
||||
if (NULL == q){
|
||||
ret = OMPI_ERROR;
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ompi_io_ompio_initialize_print_queue(mca_io_ompio_print_queue *q){
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
q->first = 0;
|
||||
q->last = QUEUESIZE - 1;
|
||||
q->count = 0;
|
||||
return ret;
|
||||
}
|
||||
int ompi_io_ompio_register_print_entry (int queue_type,
|
||||
mca_io_ompio_print_entry x){
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_io_ompio_print_queue *q=NULL;
|
||||
|
||||
ret = ompi_io_ompio_set_print_queue(&q, queue_type);
|
||||
|
||||
if (ret != OMPI_ERROR){
|
||||
if (q->count >= QUEUESIZE){
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
else{
|
||||
q->last = (q->last + 1) % QUEUESIZE;
|
||||
q->entry[q->last] = x;
|
||||
q->count = q->count + 1;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompi_io_ompio_unregister_print_entry (int queue_type,
|
||||
mca_io_ompio_print_entry *x){
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_io_ompio_print_queue *q=NULL;
|
||||
ret = ompi_io_ompio_set_print_queue(&q, queue_type);
|
||||
if (ret != OMPI_ERROR){
|
||||
if (q->count <= 0){
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
else{
|
||||
*x = q->entry[q->first];
|
||||
q->first = (q->first+1) % QUEUESIZE;
|
||||
q->count = q->count - 1;
|
||||
}
|
||||
}
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int ompi_io_ompio_empty_print_queue(int queue_type){
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_io_ompio_print_queue *q=NULL;
|
||||
ret = ompi_io_ompio_set_print_queue(&q, queue_type);
|
||||
|
||||
assert (ret != OMPI_ERROR);
|
||||
(void)ret; // silence compiler warning
|
||||
if (q->count == 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int ompi_io_ompio_full_print_queue(int queue_type){
|
||||
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_io_ompio_print_queue *q=NULL;
|
||||
ret = ompi_io_ompio_set_print_queue(&q, queue_type);
|
||||
|
||||
assert ( ret != OMPI_ERROR);
|
||||
(void)ret; // silence compiler warning
|
||||
if (q->count < QUEUESIZE)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ompi_io_ompio_print_time_info(int queue_type,
|
||||
char *name,
|
||||
mca_io_ompio_file_t *fh){
|
||||
|
||||
int i = 0, j=0, nprocs_for_coll = 0, ret = OMPI_SUCCESS, count = 0;
|
||||
double *time_details = NULL, *final_sum = NULL;
|
||||
double *final_max = NULL, *final_min = NULL;
|
||||
double *final_time_details=NULL;
|
||||
mca_io_ompio_print_queue *q=NULL;
|
||||
|
||||
ret = ompi_io_ompio_set_print_queue(&q, queue_type);
|
||||
|
||||
assert (ret != OMPI_ERROR);
|
||||
nprocs_for_coll = q->entry[0].nprocs_for_coll;
|
||||
time_details = (double *) malloc (4*sizeof(double));
|
||||
if ( NULL == time_details){
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
|
||||
}
|
||||
|
||||
if (!fh->f_rank){
|
||||
|
||||
final_min = (double *) malloc (3*sizeof(double));
|
||||
if ( NULL == final_min){
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
final_max = (double *) malloc (3*sizeof(double));
|
||||
if ( NULL == final_max){
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
|
||||
}
|
||||
|
||||
final_sum = (double *) malloc (3*sizeof(double));
|
||||
if ( NULL == final_sum){
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
final_time_details =
|
||||
(double *)malloc
|
||||
(fh->f_size * 4 * sizeof(double));
|
||||
if (NULL == final_time_details){
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
count = 4 * fh->f_size;
|
||||
for(i=0;i<count;i++){
|
||||
final_time_details[i] = 0.0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++){
|
||||
time_details[i] = 0.0;
|
||||
}
|
||||
|
||||
if (q->count > 0){
|
||||
for (i=0; i < q->count; i++){
|
||||
for (j=0;j<3;j++){
|
||||
if (!fh->f_rank){
|
||||
final_min[j] = 100000.0;
|
||||
final_max[j] = 0.0;
|
||||
final_sum[j] = 0.0;
|
||||
}
|
||||
time_details[j] += q->entry[i].time[j];
|
||||
}
|
||||
time_details[3] = q->entry[i].aggregator;
|
||||
}
|
||||
}
|
||||
|
||||
fh->f_comm->c_coll.coll_gather(time_details,
|
||||
4,
|
||||
MPI_DOUBLE,
|
||||
final_time_details,
|
||||
4,
|
||||
MPI_DOUBLE,
|
||||
0,
|
||||
fh->f_comm,
|
||||
fh->f_comm->c_coll.coll_gather_module);
|
||||
|
||||
|
||||
|
||||
if (!fh->f_rank){
|
||||
|
||||
for (i=0;i<count;i+=4){
|
||||
if (final_time_details[i+3] == 1){
|
||||
final_sum[0] += final_time_details[i];
|
||||
final_sum[1] += final_time_details[i+1];
|
||||
final_sum[2] += final_time_details[i+2];
|
||||
|
||||
if ( final_time_details[i] < final_min[0])
|
||||
final_min[0] = final_time_details[i];
|
||||
if ( final_time_details[i+1] < final_min[1])
|
||||
final_min[1] = final_time_details[i+1];
|
||||
if ( final_time_details[i+2] < final_min[2])
|
||||
final_min[2] = final_time_details[i+2];
|
||||
|
||||
|
||||
|
||||
if ( final_time_details[i] > final_max[0])
|
||||
final_max[0] = final_time_details[i];
|
||||
if ( final_time_details[i+1] > final_max[1])
|
||||
final_max[1] = final_time_details[i+1];
|
||||
if ( final_time_details[i+2] > final_max[2])
|
||||
final_max[2] = final_time_details[i+2];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
printf ("\n# MAX-%s AVG-%s MIN-%s MAX-COMM AVG-COMM MIN-COMM",
|
||||
name, name, name);
|
||||
printf (" MAX-EXCH AVG-EXCH MIN-EXCH\n");
|
||||
printf (" %f %f %f %f %f %f %f %f %f\n\n",
|
||||
final_max[0], final_sum[0]/nprocs_for_coll, final_min[0],
|
||||
final_max[1], final_sum[1]/nprocs_for_coll, final_min[1],
|
||||
final_max[2], final_sum[2]/nprocs_for_coll, final_min[2]);
|
||||
|
||||
}
|
||||
|
||||
exit:
|
||||
if ( NULL != final_max){
|
||||
free(final_max);
|
||||
final_max = NULL;
|
||||
}
|
||||
if (NULL != final_min){
|
||||
free(final_min);
|
||||
final_min = NULL;
|
||||
}
|
||||
if (NULL != final_sum){
|
||||
free(final_sum);
|
||||
final_sum = NULL;
|
||||
}
|
||||
if (NULL != time_details){
|
||||
free(time_details);
|
||||
time_details = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_io_ompio_create_groups(mca_io_ompio_file_t *fh,
|
||||
size_t bytes_per_proc)
|
||||
|
@ -41,6 +41,8 @@
|
||||
#include "ompi/datatype/ompi_datatype.h"
|
||||
#include "ompi/request/request.h"
|
||||
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
extern int mca_io_ompio_cycle_buffer_size;
|
||||
extern int mca_io_ompio_bytes_per_agg;
|
||||
extern int mca_io_ompio_num_aggregators;
|
||||
@ -91,9 +93,6 @@ OMPI_DECLSPEC extern int mca_io_ompio_coll_timing_info;
|
||||
#define OMPIO_MODE_APPEND 128
|
||||
#define OMPIO_MODE_SEQUENTIAL 256
|
||||
|
||||
/* PRINT QUEUES*/
|
||||
#define WRITE_PRINT_QUEUE 1809
|
||||
#define READ_PRINT_QUEUE 2178
|
||||
/*---------------------------*/
|
||||
|
||||
|
||||
@ -162,19 +161,6 @@ typedef struct mca_io_ompio_offlen_array_t{
|
||||
int process_id;
|
||||
}mca_io_ompio_offlen_array_t;
|
||||
|
||||
/*To extract time-information */
|
||||
typedef struct {
|
||||
double time[3];
|
||||
int nprocs_for_coll;
|
||||
int aggregator;
|
||||
}mca_io_ompio_print_entry;
|
||||
|
||||
typedef struct {
|
||||
mca_io_ompio_print_entry entry[QUEUESIZE + 1];
|
||||
int first;
|
||||
int last;
|
||||
int count;
|
||||
} mca_io_ompio_print_queue;
|
||||
|
||||
typedef struct {
|
||||
int ndims;
|
||||
@ -233,10 +219,6 @@ typedef int (*mca_io_ompio_set_aggregator_props_fn_t) (struct mca_io_ompio_file_
|
||||
size_t bytes_per_proc);
|
||||
|
||||
|
||||
typedef int (*mca_io_ompio_full_print_queue_fn_t) (int queue_type);
|
||||
typedef int (*mca_io_ompio_register_print_entry_fn_t) (int queue_type,
|
||||
mca_io_ompio_print_entry x);
|
||||
|
||||
|
||||
/**
|
||||
* Back-end structure for MPI_File
|
||||
@ -306,10 +288,9 @@ struct mca_io_ompio_file_t {
|
||||
mca_fbtl_base_module_t *f_fbtl;
|
||||
mca_sharedfp_base_module_t *f_sharedfp;
|
||||
|
||||
/* No Error handling done yet
|
||||
struct ompi_errhandler_t *error_handler;
|
||||
ompi_errhandler_type_t errhandler_type;
|
||||
*/
|
||||
/* Timing information */
|
||||
mca_common_ompio_print_queue *f_coll_write_queue;
|
||||
mca_common_ompio_print_queue *f_coll_read_queue;
|
||||
|
||||
/*initial list of aggregators and groups*/
|
||||
int *f_init_aggr_list;
|
||||
@ -330,9 +311,6 @@ struct mca_io_ompio_file_t {
|
||||
mca_io_ompio_get_num_aggregators_fn_t f_get_num_aggregators;
|
||||
mca_io_ompio_get_bytes_per_agg_fn_t f_get_bytes_per_agg;
|
||||
mca_io_ompio_set_aggregator_props_fn_t f_set_aggregator_props;
|
||||
|
||||
mca_io_ompio_full_print_queue_fn_t f_full_print_queue;
|
||||
mca_io_ompio_register_print_entry_fn_t f_register_print_entry;
|
||||
};
|
||||
typedef struct mca_io_ompio_file_t mca_io_ompio_file_t;
|
||||
|
||||
@ -341,8 +319,6 @@ struct mca_io_ompio_data_t {
|
||||
};
|
||||
typedef struct mca_io_ompio_data_t mca_io_ompio_data_t;
|
||||
|
||||
//OMPI_DECLSPEC extern mca_io_ompio_print_queue *coll_write_time;
|
||||
// OMPI_DECLSPEC extern mca_io_ompio_print_queue *coll_read_time;
|
||||
|
||||
/* functions to retrieve the number of aggregators and the size of the
|
||||
temporary buffer on aggregators from the fcoll modules */
|
||||
@ -518,24 +494,6 @@ OMPI_DECLSPEC int ompi_io_ompio_break_file_view (mca_io_ompio_file_t *fh,
|
||||
int *broken_count);
|
||||
|
||||
|
||||
OMPI_DECLSPEC int ompi_io_ompio_register_print_entry (int queue_type,
|
||||
mca_io_ompio_print_entry x);
|
||||
|
||||
OMPI_DECLSPEC int ompi_io_ompio_unregister_print_entry (int queue_type, mca_io_ompio_print_entry *x);
|
||||
|
||||
OMPI_DECLSPEC int ompi_io_ompio_empty_print_queue(int queue_type);
|
||||
|
||||
OMPI_DECLSPEC int ompi_io_ompio_full_print_queue(int queue_type);
|
||||
|
||||
OMPI_DECLSPEC int ompi_io_ompio_initialize_print_queue(mca_io_ompio_print_queue *q);
|
||||
|
||||
OMPI_DECLSPEC int ompi_io_ompio_print_time_info(int queue_type,
|
||||
char *name_operation,
|
||||
mca_io_ompio_file_t *fh);
|
||||
int ompi_io_ompio_set_print_queue (mca_io_ompio_print_queue **q,
|
||||
int queue_type);
|
||||
|
||||
|
||||
/*
|
||||
* ******************************************************************
|
||||
* ********* functions which are implemented in this module *********
|
||||
|
@ -131,11 +131,8 @@ ompio_io_ompio_file_open (ompi_communicator_t *comm,
|
||||
ompio_fh->f_split_coll_in_use = false;
|
||||
|
||||
/*Initialize the print_queues queues here!*/
|
||||
coll_write_time = (mca_io_ompio_print_queue *) malloc (sizeof(mca_io_ompio_print_queue));
|
||||
coll_read_time = (mca_io_ompio_print_queue *) malloc (sizeof(mca_io_ompio_print_queue));
|
||||
|
||||
ompi_io_ompio_initialize_print_queue(coll_write_time);
|
||||
ompi_io_ompio_initialize_print_queue(coll_read_time);
|
||||
mca_common_ompio_initialize_print_queue(&ompio_fh->f_coll_write_queue);
|
||||
mca_common_ompio_initialize_print_queue(&ompio_fh->f_coll_read_queue);
|
||||
|
||||
/* set some function pointers required for fcoll, fbtls and sharedfp modules*/
|
||||
ompio_fh->f_decode_datatype=ompi_io_ompio_decode_datatype;
|
||||
@ -148,9 +145,6 @@ ompio_io_ompio_file_open (ompi_communicator_t *comm,
|
||||
ompio_fh->f_get_bytes_per_agg=mca_io_ompio_get_bytes_per_agg;
|
||||
ompio_fh->f_set_aggregator_props=ompi_io_ompio_set_aggregator_props;
|
||||
|
||||
ompio_fh->f_full_print_queue=ompi_io_ompio_full_print_queue;
|
||||
ompio_fh->f_register_print_entry=ompi_io_ompio_register_print_entry;
|
||||
|
||||
/* This fix is needed for data seiving to work with
|
||||
two-phase collective I/O */
|
||||
if ((amode & MPI_MODE_WRONLY)){
|
||||
@ -292,20 +286,20 @@ ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
|
||||
|
||||
if(mca_io_ompio_coll_timing_info){
|
||||
strcpy (name, "WRITE");
|
||||
if (!ompi_io_ompio_empty_print_queue(WRITE_PRINT_QUEUE)){
|
||||
ret = ompi_io_ompio_print_time_info(WRITE_PRINT_QUEUE,
|
||||
name,
|
||||
ompio_fh);
|
||||
if (!mca_common_ompio_empty_print_queue(ompio_fh->f_coll_write_queue)){
|
||||
ret = mca_common_ompio_print_time_info(ompio_fh->f_coll_write_queue,
|
||||
name,
|
||||
ompio_fh);
|
||||
if (OMPI_SUCCESS != ret){
|
||||
printf("Error in print_time_info ");
|
||||
}
|
||||
|
||||
}
|
||||
strcpy (name, "READ");
|
||||
if (!ompi_io_ompio_empty_print_queue(READ_PRINT_QUEUE)){
|
||||
ret = ompi_io_ompio_print_time_info(READ_PRINT_QUEUE,
|
||||
name,
|
||||
ompio_fh);
|
||||
if (!mca_common_ompio_empty_print_queue(ompio_fh->f_coll_read_queue)){
|
||||
ret = mca_common_ompio_print_time_info(ompio_fh->f_coll_read_queue,
|
||||
name,
|
||||
ompio_fh);
|
||||
if (OMPI_SUCCESS != ret){
|
||||
printf("Error in print_time_info ");
|
||||
}
|
||||
@ -374,6 +368,16 @@ ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
|
||||
}
|
||||
|
||||
|
||||
if ( NULL != ompio_fh->f_coll_write_queue ) {
|
||||
free ( ompio_fh->f_coll_write_queue );
|
||||
ompio_fh->f_coll_write_queue = NULL;
|
||||
}
|
||||
|
||||
if ( NULL != ompio_fh->f_coll_read_queue ) {
|
||||
free ( ompio_fh->f_coll_read_queue );
|
||||
ompio_fh->f_coll_read_queue = NULL;
|
||||
}
|
||||
|
||||
if (MPI_DATATYPE_NULL != ompio_fh->f_iov_type) {
|
||||
ompi_datatype_destroy (&ompio_fh->f_iov_type);
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user