Changeset 18940


Ignore:
Timestamp:
12/04/14 15:23:56 (10 years ago)
Author:
Eric.Larour
Message:

CHG: issue with size of tape stats.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/cores/adgradient_core.cpp

    r18896 r18940  
    5353                        /*First, stop tracing: */
    5454                        trace_off();
     55                       
     56                        if(VerboseAutodiff()){ /*{{{*/
     57                                size_t  tape_stats[15];
     58                                tapestats(my_rank,tape_stats); //reading of tape statistics
     59                                int commSize=IssmComm::GetSize();
     60                                int *sstats=new int[7];
     61                                sstats[0]=tape_stats[NUM_OPERATIONS];
     62                                sstats[1]=tape_stats[OP_FILE_ACCESS];
     63                                sstats[2]=tape_stats[NUM_LOCATIONS];
     64                                sstats[3]=tape_stats[LOC_FILE_ACCESS];
     65                                sstats[4]=tape_stats[NUM_VALUES];
     66                                sstats[5]=tape_stats[VAL_FILE_ACCESS];
     67                                sstats[6]=tape_stats[TAY_STACK_SIZE];
     68                                int *rstats=NULL;
     69                                if (my_rank==0) rstats=new int[commSize*7];
     70                                ISSM_MPI_Gather(sstats,7,ISSM_MPI_INT,rstats,7,ISSM_MPI_INT,0,IssmComm::GetComm());
     71                                if (my_rank==0) {
     72                                        int offset=50;
     73                                        int rOffset=(commSize/10)+1;
     74                                        _printf_("   ADOLC statistics: \n");
     75                                        _printf_("     "<<setw(offset)<<left<<"#independents: " <<setw(12)<<right<<tape_stats[NUM_INDEPENDENTS] << "\n");
     76                                        _printf_("     "<<setw(offset)<<left<<"#dependents: " <<setw(12)<<right<<tape_stats[NUM_DEPENDENTS] << "\n");
     77                                        _printf_("     "<<setw(offset)<<left<<"max #live active variables: " <<setw(12)<<right<<tape_stats[NUM_MAX_LIVES] << "\n");
     78                                        _printf_("     operations: entry size "<< sizeof(unsigned char) << " Bytes \n");
     79                                        _printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffObufsizeEnum) " <<setw(12)<<right<<tape_stats[OP_BUFFER_SIZE] << "\n");
     80                                        for (int r=0;r<commSize;++r)
     81                                        _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+0] << (rstats[r*7+1]?" ->file":"") << "\n");
     82                                        _printf_("     locations: entry size " << sizeof(locint) << " Bytes\n");
     83                                        _printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffLbufsizeEnum) " <<setw(12)<<right<<tape_stats[LOC_BUFFER_SIZE] << "\n");
     84                                        for (int r=0;r<commSize;++r)
     85                                        _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+2] << (rstats[r*7+3]?" ->file":"") << "\n");
     86                                        _printf_("     constant values: entry size " << sizeof(double) << " Bytes\n");
     87                                        _printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffCbufsizeEnum) " <<setw(12)<<right<<tape_stats[VAL_BUFFER_SIZE] << "\n");
     88                                        for (int r=0;r<commSize;++r)
     89                                        _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+4] << (rstats[r*7+5]?" ->file":"") << "\n");
     90                                        _printf_("     Taylor stack: entry size " << sizeof(revreal) << " Bytes\n");
     91                                        _printf_("     "<<setw(offset)<<left<<"  #entries in buffer (AutodiffTbufsizeEnum) " <<setw(12)<<right<<tape_stats[TAY_BUFFER_SIZE] << "\n");
     92                                        for (int r=0;r<commSize;++r)
     93                                        _printf_("       ["<<setw(rOffset)<<right<<r<<"]"<<setw(offset-rOffset-4)<<left<<" #entries total" <<setw(12)<<right<<rstats[r*7+6] << (rstats[r*7+6]>tape_stats[TAY_BUFFER_SIZE]?" ->file":"") << "\n");
     94                                        delete []rstats;
     95                        }
     96                        delete [] sstats;
     97                } /*}}}*/
    5598               
    5699                        /*retrieve parameters: */
Note: See TracChangeset for help on using the changeset viewer.