1
1

clean up the usage of opal_output vs. printf

Этот коммит содержится в:
Edgar Gabriel 2015-07-28 18:27:31 -05:00
родитель 824d488709
Коммит 3780089ce0
5 изменённых файлов: 72 добавлений и 37 удалений

Просмотреть файл

@ -24,6 +24,7 @@
#include "mpi.h"
#include "ompi/constants.h"
#include "ompi/mca/sharedfp/sharedfp.h"
#include "ompi/mca/sharedfp/base/base.h"
int mca_sharedfp_individual_iwrite(mca_io_ompio_file_t *fh,
void *buf,
@ -40,7 +41,8 @@ int mca_sharedfp_individual_iwrite(mca_io_ompio_file_t *fh,
if(fh->f_sharedfp_data==NULL){
if ( mca_sharedfp_individual_verbose ) {
printf("mca_sharedfp_individual_iwrite: opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"mca_sharedfp_individual_iwrite: opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -105,7 +107,8 @@ int mca_sharedfp_individual_write_ordered_begin(mca_io_ompio_file_t *fh,
if(fh->f_sharedfp_data==NULL){
if ( mca_sharedfp_individual_verbose ) {
printf("sharedfp_individual_write_ordered_begin - opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_individual_write_ordered_begin - opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -121,7 +124,7 @@ int mca_sharedfp_individual_write_ordered_begin(mca_io_ompio_file_t *fh,
}
if ( true == fh->f_split_coll_in_use ) {
printf("Only one split collective I/O operation allowed per file handle at any given point in time!\n");
opal_output(0, "Only one split collective I/O operation allowed per file handle at any given point in time!\n");
return MPI_ERR_REQUEST;
}

Просмотреть файл

@ -24,6 +24,7 @@
#include "mpi.h"
#include "ompi/constants.h"
#include "ompi/mca/sharedfp/sharedfp.h"
#include "ompi/mca/sharedfp/base/base.h"
#include "ompi/mca/io/ompio/io_ompio.h"
int mca_sharedfp_lockedfile_iread(mca_io_ompio_file_t *fh,
@ -41,7 +42,8 @@ int mca_sharedfp_lockedfile_iread(mca_io_ompio_file_t *fh,
if ( NULL == fh->f_sharedfp_data ) {
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_iread: opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_iread: opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -61,7 +63,8 @@ int mca_sharedfp_lockedfile_iread(mca_io_ompio_file_t *fh,
bytesRequested = count * numofBytes;
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_iread - Bytes Requested is %ld\n",bytesRequested);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_iread - Bytes Requested is %ld\n",bytesRequested);
}
@ -72,7 +75,8 @@ int mca_sharedfp_lockedfile_iread(mca_io_ompio_file_t *fh,
ret = mca_sharedfp_lockedfile_request_position(sh,bytesRequested,&offset);
if ( -1 != ret ) {
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_iread - Offset received is %lld\n",offset);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_iread - Offset received is %lld\n",offset);
}
/* Read the file */
@ -102,7 +106,8 @@ int mca_sharedfp_lockedfile_read_ordered_begin(mca_io_ompio_file_t *fh,
if(fh->f_sharedfp_data==NULL){
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_read_ordered_begin: opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_read_ordered_begin: opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -119,7 +124,8 @@ int mca_sharedfp_lockedfile_read_ordered_begin(mca_io_ompio_file_t *fh,
if ( true == fh->f_split_coll_in_use ) {
printf("Only one split collective I/O operation allowed per file handle at any given point in time!\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"Only one split collective I/O operation allowed per file handle at any given point in time!\n");
return MPI_ERR_REQUEST;
}
@ -155,7 +161,8 @@ int mca_sharedfp_lockedfile_read_ordered_begin(mca_io_ompio_file_t *fh,
for ( i = 0; i < size ; i ++) {
bytesRequested += buff[i];
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_read_ordered_begin: Bytes requested are %ld\n",bytesRequested);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_read_ordered_begin: Bytes requested are %ld\n",bytesRequested);
}
}
@ -170,7 +177,8 @@ int mca_sharedfp_lockedfile_read_ordered_begin(mca_io_ompio_file_t *fh,
goto exit;
}
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_read_ordered_begin: Offset received is %lld\n",offsetReceived);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_read_ordered_begin: Offset received is %lld\n",offsetReceived);
}
buff[0] += offsetReceived;
for (i = 1 ; i < size; i++) {
@ -190,7 +198,8 @@ int mca_sharedfp_lockedfile_read_ordered_begin(mca_io_ompio_file_t *fh,
offset = offsetBuff - sendBuff;
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_read_ordered_begin: Offset returned is %lld\n",offset);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_read_ordered_begin: Offset returned is %lld\n",offset);
}
ret = ompio_io_ompio_file_iread_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req );

Просмотреть файл

@ -24,6 +24,7 @@
#include "mpi.h"
#include "ompi/constants.h"
#include "ompi/mca/sharedfp/sharedfp.h"
#include "ompi/mca/sharedfp/base/base.h"
#include "ompi/mca/io/ompio/io_ompio.h"
int mca_sharedfp_lockedfile_iwrite(mca_io_ompio_file_t *fh,
@ -41,7 +42,8 @@ int mca_sharedfp_lockedfile_iwrite(mca_io_ompio_file_t *fh,
if(fh->f_sharedfp_data==NULL){
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_iwrite: opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_iwrite: opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -60,7 +62,8 @@ int mca_sharedfp_lockedfile_iwrite(mca_io_ompio_file_t *fh,
opal_datatype_type_size ( &datatype->super, &numofBytes);
bytesRequested = count * numofBytes;
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_iwrite: Bytes Requested is %ld\n",bytesRequested);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_iwrite: Bytes Requested is %ld\n",bytesRequested);
}
/*Retrieve the shared file data struct*/
@ -70,7 +73,8 @@ int mca_sharedfp_lockedfile_iwrite(mca_io_ompio_file_t *fh,
ret = mca_sharedfp_lockedfile_request_position(sh,bytesRequested,&offset);
if ( -1 != ret) {
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_iwrite: Offset received is %lld\n",offset);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_iwrite: Offset received is %lld\n",offset);
}
/* Write to the file */
@ -100,7 +104,8 @@ int mca_sharedfp_lockedfile_write_ordered_begin(mca_io_ompio_file_t *fh,
if(fh->f_sharedfp_data==NULL){
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_write_ordered_begin: opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_write_ordered_begin: opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -117,7 +122,7 @@ int mca_sharedfp_lockedfile_write_ordered_begin(mca_io_ompio_file_t *fh,
if ( true == fh->f_split_coll_in_use ) {
printf("Only one split collective I/O operation allowed per file handle at any given point in time!\n");
opal_output(0, "Only one split collective I/O operation allowed per file handle at any given point in time!\n");
return MPI_ERR_REQUEST;
}
@ -153,7 +158,8 @@ int mca_sharedfp_lockedfile_write_ordered_begin(mca_io_ompio_file_t *fh,
for ( i = 0; i < size ; i ++) {
bytesRequested += buff[i];
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_write_ordered_begin: Bytes requested are %ld\n",bytesRequested);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_write_ordered_begin: Bytes requested are %ld\n",bytesRequested);
}
}
@ -168,7 +174,8 @@ int mca_sharedfp_lockedfile_write_ordered_begin(mca_io_ompio_file_t *fh,
goto exit;
}
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_write_ordered_begin: Offset received is %lld\n",offsetReceived);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_write_ordered_begin: Offset received is %lld\n",offsetReceived);
}
buff[0] += offsetReceived;
for (i = 1 ; i < size; i++) {
@ -188,7 +195,8 @@ int mca_sharedfp_lockedfile_write_ordered_begin(mca_io_ompio_file_t *fh,
offset = offsetBuff - sendBuff;
if ( mca_sharedfp_lockedfile_verbose ) {
printf("sharedfp_lockedfile_write_ordered_begin: Offset returned is %lld\n",offset);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_lockedfile_write_ordered_begin: Offset returned is %lld\n",offset);
}
ret = ompio_io_ompio_file_iwrite_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req );

Просмотреть файл

@ -24,6 +24,7 @@
#include "mpi.h"
#include "ompi/constants.h"
#include "ompi/mca/sharedfp/sharedfp.h"
#include "ompi/mca/sharedfp/base/base.h"
int mca_sharedfp_sm_iread(mca_io_ompio_file_t *fh,
void *buf,
@ -40,7 +41,8 @@ int mca_sharedfp_sm_iread(mca_io_ompio_file_t *fh,
if( NULL == fh->f_sharedfp_data){
if ( mca_sharedfp_sm_verbose ) {
printf("sharedfp_sm_iread: opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_sm_iread: opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -70,7 +72,8 @@ int mca_sharedfp_sm_iread(mca_io_ompio_file_t *fh,
if ( -1 != ret ) {
if ( mca_sharedfp_sm_verbose ) {
printf("sharedfp_sm_iread: Offset received is %lld\n",offset);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_sm_iread: Offset received is %lld\n",offset);
}
/* Read the file */
ret = ompio_io_ompio_file_iread_at(sh->sharedfh,offset,buf,count,datatype,request);
@ -99,7 +102,8 @@ int mca_sharedfp_sm_read_ordered_begin(mca_io_ompio_file_t *fh,
if ( NULL == fh->f_sharedfp_data){
if ( mca_sharedfp_sm_verbose ) {
printf("sharedfp_sm_read_ordered_begin: opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_sm_read_ordered_begin: opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -114,7 +118,7 @@ int mca_sharedfp_sm_read_ordered_begin(mca_io_ompio_file_t *fh,
}
}
if ( true == fh->f_split_coll_in_use ) {
printf("Only one split collective I/O operation allowed per file handle at any given point in time!\n");
opal_output(0,"Only one split collective I/O operation allowed per file handle at any given point in time!\n");
return MPI_ERR_REQUEST;
}
@ -151,7 +155,8 @@ int mca_sharedfp_sm_read_ordered_begin(mca_io_ompio_file_t *fh,
for (i = 0; i < size ; i ++) {
bytesRequested += buff[i];
if ( mca_sharedfp_sm_verbose ) {
printf("mca_sharedfp_sm_read_ordered_begin: Bytes requested are %ld\n",
opal_output(ompi_sharedfp_base_framework.framework_output,
"mca_sharedfp_sm_read_ordered_begin: Bytes requested are %ld\n",
bytesRequested);
}
}
@ -167,7 +172,8 @@ int mca_sharedfp_sm_read_ordered_begin(mca_io_ompio_file_t *fh,
goto exit;
}
if ( mca_sharedfp_sm_verbose ) {
printf("mca_sharedfp_sm_read_ordered_begin: Offset received is %lld\n",offsetReceived);
opal_output(ompi_sharedfp_base_framework.framework_output,
"mca_sharedfp_sm_read_ordered_begin: Offset received is %lld\n",offsetReceived);
}
buff[0] += offsetReceived;
@ -187,7 +193,8 @@ int mca_sharedfp_sm_read_ordered_begin(mca_io_ompio_file_t *fh,
/*Each process now has its own individual offset in recvBUFF*/
offset = offsetBuff - sendBuff;
if ( mca_sharedfp_sm_verbose ) {
printf("mca_sharedfp_sm_read_ordered_begin: Offset returned is %lld\n",offset);
opal_output(ompi_sharedfp_base_framework.framework_output,
"mca_sharedfp_sm_read_ordered_begin: Offset returned is %lld\n",offset);
}
/* read to the file */

Просмотреть файл

@ -24,6 +24,7 @@
#include "mpi.h"
#include "ompi/constants.h"
#include "ompi/mca/sharedfp/sharedfp.h"
#include "ompi/mca/sharedfp/base/base.h"
int mca_sharedfp_sm_iwrite(mca_io_ompio_file_t *fh,
void *buf,
@ -40,7 +41,8 @@ int mca_sharedfp_sm_iwrite(mca_io_ompio_file_t *fh,
if( NULL == fh->f_sharedfp_data){
if ( mca_sharedfp_sm_verbose ) {
printf("sharedfp_sm_iwrite - opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_sm_iwrite - opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -63,14 +65,16 @@ int mca_sharedfp_sm_iwrite(mca_io_ompio_file_t *fh,
sh = fh->f_sharedfp_data;
if ( mca_sharedfp_sm_verbose ) {
printf("sharedfp_sm_iwrite: Bytes Requested is %ld\n",bytesRequested);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_sm_iwrite: Bytes Requested is %ld\n",bytesRequested);
}
/* Request the offset to write bytesRequested bytes */
ret = mca_sharedfp_sm_request_position(sh,bytesRequested,&offset);
if ( -1 != ret ) {
if ( mca_sharedfp_sm_verbose ) {
printf("sharedfp_sm_iwrite: Offset received is %lld\n",offset);
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_sm_iwrite: Offset received is %lld\n",offset);
}
/* Write to the file */
ret = ompio_io_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request);
@ -100,7 +104,8 @@ int mca_sharedfp_sm_write_ordered_begin(mca_io_ompio_file_t *fh,
if ( NULL == fh->f_sharedfp_data){
if ( mca_sharedfp_sm_verbose ) {
printf("sharedfp_sm_write_ordered_begin: opening the shared file pointer\n");
opal_output(ompi_sharedfp_base_framework.framework_output,
"sharedfp_sm_write_ordered_begin: opening the shared file pointer\n");
}
shared_fp_base_module = fh->f_sharedfp;
@ -115,7 +120,7 @@ int mca_sharedfp_sm_write_ordered_begin(mca_io_ompio_file_t *fh,
}
}
if ( true == fh->f_split_coll_in_use ) {
printf("Only one split collective I/O operation allowed per file handle at any given point in time!\n");
opal_output(0, "Only one split collective I/O operation allowed per file handle at any given point in time!\n");
return MPI_ERR_REQUEST;
}
@ -152,7 +157,8 @@ int mca_sharedfp_sm_write_ordered_begin(mca_io_ompio_file_t *fh,
for (i = 0; i < size ; i ++) {
bytesRequested += buff[i];
if ( mca_sharedfp_sm_verbose ) {
printf("mca_sharedfp_sm_write_ordered_begin: Bytes requested are %ld\n",
opal_output(ompi_sharedfp_base_framework.framework_output,
"mca_sharedfp_sm_write_ordered_begin: Bytes requested are %ld\n",
bytesRequested);
}
}
@ -168,7 +174,8 @@ int mca_sharedfp_sm_write_ordered_begin(mca_io_ompio_file_t *fh,
goto exit;
}
if ( mca_sharedfp_sm_verbose ) {
printf("mca_sharedfp_sm_write_ordered_begin: Offset received is %lld\n",offsetReceived);
opal_output(ompi_sharedfp_base_framework.framework_output,
"mca_sharedfp_sm_write_ordered_begin: Offset received is %lld\n",offsetReceived);
}
buff[0] += offsetReceived;
@ -188,7 +195,8 @@ int mca_sharedfp_sm_write_ordered_begin(mca_io_ompio_file_t *fh,
/*Each process now has its own individual offset in recvBUFF*/
offset = offsetBuff - sendBuff;
if ( mca_sharedfp_sm_verbose ) {
printf("mca_sharedfp_sm_write_ordered_begin: Offset returned is %lld\n",offset);
opal_output(ompi_sharedfp_base_framework.framework_output,
"mca_sharedfp_sm_write_ordered_begin: Offset returned is %lld\n",offset);
}
/* read to the file */