Changeset 1628 for XIOS


Ignore:
Timestamp:
12/18/18 17:34:59 (5 years ago)
Author:
yushan
Message:

bug fix (Nb of files less than Nb of servers)

Location:
XIOS/dev/dev_trunk_omp
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/arch/arch-X64_IRENE.path

    r1483 r1628  
     1 
    12NETCDF_INCDIR="-I $NETCDFC_INCDIR -I $NETCDFFORTRAN_INCDIR" 
    23NETCDF_LIBDIR="-L $NETCDFC_LIBDIR -L $NETCDFFORTRAN_LIBDIR" 
  • XIOS/dev/dev_trunk_omp/bld.cfg

    r1608 r1628  
    4646#bld::target generate_fortran_interface.exe  
    4747#bld::target test_remap.exe 
    48 #bld::target xios_server.exe  
     48bld::target xios_server.exe  
    4949#bld::target test_regular.exe 
    5050#bld::target test_xios2_cmip6.exe 
     
    5656#bld::target test_client.exe 
    5757bld::target test_omp.exe 
     58bld::target test_omp2.exe 
     59bld::target test_send.exe 
     60bld::target test_send2.exe 
    5861#bld::target test_unstruct_complete.exe 
    5962#bld::target test_unstructured.exe 
  • XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_message.cpp

    r1603 r1628  
    147147    { 
    148148      Debug("Message probing for intracomm\n"); 
    149       
     149/*      
    150150      #pragma omp critical (_mpi_call) 
    151151      { 
     
    158158      } 
    159159 
    160        
     160*/     
     161      ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm->mpi_comm), &flag, &message, &status);       
     162 
    161163      if(flag) 
    162164      { 
  • XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_probe.cpp

    r1603 r1628  
    6868    *flag = false; 
    6969     
    70     Message_Check(comm); 
    71  
    72     #pragma omp flush 
    73  
    7470    #pragma omp critical (_query) 
    7571    for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it) 
     
    9894      } 
    9995    } 
     96    if(*flag) return 0; 
     97     
     98    Message_Check(comm); 
     99 
     100    #pragma omp flush 
     101 
     102    #pragma omp critical (_query) 
     103    for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it) 
     104    { 
     105      bool src_matched = src<0? true: (*it)->ep_src == src; 
     106      bool tag_matched = tag<0? true: (*it)->ep_tag == tag; 
     107       
     108      if(src_matched && tag_matched)         
     109      { 
     110        Debug("find message\n"); 
     111          
     112        status->mpi_status = new ::MPI_Status(*static_cast< ::MPI_Status*>((*it)->mpi_status)); 
     113        status->ep_src = (*it)->ep_src; 
     114        status->ep_tag = (*it)->ep_tag; 
     115         
     116        if(comm->is_intercomm) 
     117        { 
     118          for(INTER_RANK_MAP::iterator iter = comm->inter_rank_map->begin(); iter != comm->inter_rank_map->end(); iter++) 
     119          { 
     120            if(iter->second == (*it)->ep_src) status->ep_src=iter->first; 
     121          } 
     122        } 
     123 
     124        *flag = true; 
     125        break; 
     126      } 
     127    } 
     128    if(*flag) return 0; 
    100129  } 
    101130 
     
    129158    *flag = false; 
    130159     
    131     Message_Check(comm); 
    132      
    133     #pragma omp flush 
    134  
    135160    #pragma omp critical (_query) 
    136161    if(! comm->ep_comm_ptr->message_queue->empty()) 
     
    179204      } 
    180205    } 
     206 
     207    if(*flag) return 0; 
     208    
     209    Message_Check(comm); 
     210     
     211    #pragma omp flush 
     212 
     213    #pragma omp critical (_query) 
     214    if(! comm->ep_comm_ptr->message_queue->empty()) 
     215    { 
     216      for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it) 
     217      { 
     218                                           
     219        bool src_matched = src<0? true: (*it)->ep_src == src; 
     220        bool tag_matched = tag<0? true: (*it)->ep_tag == tag; 
     221         
     222        if(src_matched && tag_matched) 
     223        { 
     224          *flag = true; 
     225 
     226          status->mpi_status = new ::MPI_Status(*static_cast< ::MPI_Status*>((*it)->mpi_status)); 
     227          memcheck("new "<< status->mpi_status << " : in ep_lib::MPI_Improbe, status->mpi_status = new ::MPI_Status"); 
     228          status->ep_src = (*it)->ep_src; 
     229          status->ep_tag = (*it)->ep_tag; 
     230 
     231          (*message)->mpi_message = new ::MPI_Message(*static_cast< ::MPI_Message*>((*it)->mpi_message)); 
     232          memcheck("new "<< (*message)->mpi_message <<" : in ep_lib::MPI_Improbe, (*message)->mpi_message = new ::MPI_Message"); 
     233          (*message)->ep_src = (*it)->ep_src; 
     234          (*message)->ep_tag = (*it)->ep_tag; 
     235                                       
     236 
     237          #pragma omp critical (_query2) 
     238          {               
     239            memcheck("delete "<< (*it)->mpi_message <<" : in ep_lib::Message_Check, delete (*it)->mpi_message"); 
     240            memcheck("delete "<< (*it)->mpi_status <<" : in ep_lib::Message_Check, delete (*it)->mpi_status"); 
     241            memcheck("delete "<< (*it) <<" : in ep_lib::Message_Check, delete (*it)"); 
     242             
     243             
     244            delete (*it)->mpi_message;      
     245            delete (*it)->mpi_status;  
     246            delete *it; 
     247             
     248                        
     249            comm->ep_comm_ptr->message_queue->erase(it); 
     250            memcheck("message_queue["<<mpi_rank<<","<<ep_rank_loc<<"]->size = "<<comm->ep_comm_ptr->message_queue->size()); 
     251            #pragma omp flush 
     252          } 
     253           
     254          break; 
     255        } 
     256 
     257      } 
     258    } 
     259 
     260    if(*flag) return 0; 
     261 
    181262  } 
    182263 
  • XIOS/dev/dev_trunk_omp/inputs/iodef.xml

    r1202 r1628  
    1515 
    1616 
    17    <file_definition type="one_file" par_access="collective" output_freq="1h" output_level="10" enabled=".FALSE."> 
     17   <file_definition type="one_file" par_access="collective" output_freq="1h" output_level="10" > 
    1818      <file id="output" name="output" enabled=".TRUE."> 
    1919        <!-- <field field_ref="field_Domain" name="field_A" /> --> 
     
    2121        <field field_ref="field_A_zoom" name="field_B" /> 
    2222     </file> 
    23      <file id="output1" name="output1" enabled=".TRUE."> 
     23     <file id="output1" name="output1" enabled=".FALSE."> 
    2424        <!-- <field field_ref="field_Domain" name="field_A" /> --> 
    2525        <field field_ref="field_A" name="field_A" />         
    26      </file>  
    27      <file id="output2" name="output2" enabled=".TRUE."> 
     26     </file>   
     27     <file id="output2" name="output2" enabled=".FALSE."> 
    2828        <!-- <field field_ref="field_Domain" name="field_A" /> --> 
    2929        <field field_ref="field_Scalar" name="field_A" />         
  • XIOS/dev/dev_trunk_omp/src/calendar.cpp

    r1601 r1628  
    127127      const CDate& CCalendar::update(int step) 
    128128      { 
    129         #pragma omp critical (_output) 
    130         info(80) << "update step : " << step << " timestep " << this->timestep << std::endl; 
     129        //#pragma omp critical (_output) 
     130        //info(120) << "update step : " << step << " timestep " << this->timestep << std::endl; 
    131131        this->step = step; 
    132132        return (this->currentDate = this->getInitDate() + step * this->timestep); 
     
    160160      //----------------------------------------------------------------- 
    161161 
    162       int CCalendar::getMonthLength(const CDate& date) const 
     162      /*int CCalendar::getMonthLength(const CDate& date) const 
    163163      { // Retourne la durée du mois en jour. 
    164164        static const int NoLeapMonthLength[] = 
    165165          { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 
    166166        return NoLeapMonthLength[date.getMonth() - 1]; 
    167       } 
     167      }*/ 
    168168 
    169169      StdString CCalendar::getType(void) const { return StdString(this->getId()); } 
     
    171171      int CCalendar::getYearTotalLength(const CDate& date) const { return (365 * 86400); } 
    172172 
    173       int CCalendar::getYearLength  (void) const { return 12; } 
    174       int CCalendar::getDayLength   (void) const { return 24; } 
    175       int CCalendar::getHourLength  (void) const { return 60; } 
    176       int CCalendar::getMinuteLength(void) const { return 60; } 
    177       int CCalendar::getDayLengthInSeconds(void) const { return getDayLength() * getHourLength() * getMinuteLength(); } 
     173      //int CCalendar::getYearLength  (void) const { return 12; } 
     174      //int CCalendar::getDayLength   (void) const { return 24; } 
     175      //int CCalendar::getHourLength  (void) const { return 60; } 
     176      //int CCalendar::getMinuteLength(void) const { return 60; } 
     177      //int CCalendar::getDayLengthInSeconds(void) const { return getDayLength() * getHourLength() * getMinuteLength(); } 
    178178 
    179179      bool CCalendar::hasLeapYear() const { return false; } 
  • XIOS/dev/dev_trunk_omp/src/calendar.hpp

    r1357 r1628  
    7272            int getStep(void) const; 
    7373 
    74             virtual int getMonthLength(const CDate& date) const; 
     74            inline int getMonthLength(const CDate& date) const 
     75            { 
     76              static const int NoLeapMonthLength[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 
     77              return NoLeapMonthLength[date.getMonth() - 1]; 
     78            }; 
    7579 
    7680            virtual int getYearTotalLength(const CDate& date) const; // Retourne la durée d'une année en seconde. 
    7781 
    78             virtual int getYearLength  (void) const; // Retourne la durée d'une année en mois. 
    79             virtual int getDayLength   (void) const; // Retourne la durée d'un jour en heures. 
    80             virtual int getHourLength  (void) const; // Retourne la durée d'une heure en minute. 
    81             virtual int getMinuteLength(void) const; // Retourne la durée d'une minute en secondes. 
     82            //virtual int getYearLength  (void) const; // Retourne la durée d'une année en mois. 
     83            inline int getYearLength (void) const { return 12; } ; 
     84            inline int getDayLength   (void) const { return 24; } ; // Retourne la durée d'un jour en heures. 
     85            inline int getHourLength  (void) const { return 60; } ; // Retourne la durée d'une heure en minute. 
     86            inline int getMinuteLength(void) const {return 60; } ; // Retourne la durée d'une minute en secondes. 
    8287            /*! Returns the day length expressed in seconds. */ 
    83             virtual int getDayLengthInSeconds(void) const; 
     88            inline int getDayLengthInSeconds(void) const { return 86400; } ; 
    8489 
    8590            virtual StdString getMonthName(int monthId) const; 
  • XIOS/dev/dev_trunk_omp/src/calendar_util.cpp

    r1472 r1628  
    11#include "calendar_util.hpp" 
     2#include "calendar.hpp" 
    23 
    34namespace xios 
  • XIOS/dev/dev_trunk_omp/src/client.cpp

    r1601 r1628  
    315315        report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 
    316316        report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 
    317         report(100)<<CTimer::getAllCumulatedTime()<<endl ; 
     317        report(0)<<CTimer::getAllCumulatedTime()<<endl ; 
    318318      } 
    319319   } 
  • XIOS/dev/dev_trunk_omp/src/date.cpp

    r1496 r1628  
    134134      //---------------------------------------------------------------- 
    135135 
    136       int CDate::getYear  (void) const { return (this->year  ); } 
    137       int CDate::getMonth (void) const { return (this->month ); } 
    138       int CDate::getDay   (void) const { return (this->day   ); } 
    139       int CDate::getHour  (void) const { return (this->hour  ); } 
    140       int CDate::getMinute(void) const { return (this->minute); } 
    141       int CDate::getSecond(void) const { return (this->second); } 
     136      //int CDate::getYear  (void) const { return (this->year  ); } 
     137      //int CDate::getMonth (void) const { return (this->month ); } 
     138      //int CDate::getDay   (void) const { return (this->day   ); } 
     139      //int CDate::getHour  (void) const { return (this->hour  ); } 
     140      //int CDate::getMinute(void) const { return (this->minute); } 
     141      //int CDate::getSecond(void) const { return (this->second); } 
    142142 
    143143      //---------------------------------------------------------------- 
  • XIOS/dev/dev_trunk_omp/src/date.hpp

    r1158 r1628  
    4343 
    4444            /// Divers accesseurs /// 
    45             int getYear  (void) const; 
    46             int getMonth (void) const; 
    47             int getDay   (void) const; 
    48             int getHour  (void) const; 
    49             int getMinute(void) const; 
    50             int getSecond(void) const; 
     45            inline int getYear  (void) const {return year;}; 
     46            inline int getMonth (void) const {return month;}; 
     47            inline int getDay   (void) const {return day;}; 
     48            inline int getHour  (void) const {return hour;}; 
     49            inline int getMinute(void) const {return minute;}; 
     50            inline int getSecond(void) const {return second;}; 
    5151 
    5252            //!< Get the calendar associated to the date 
  • XIOS/dev/dev_trunk_omp/src/node/context.cpp

    r1601 r1628  
    18471847        } 
    18481848 
    1849         #pragma omp critical (_output) 
    1850         info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 
     1849        //#pragma omp critical (_output) 
     1850        info(150) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 
    18511851        calendar->update(step); 
    1852         #pragma omp critical (_output) 
    1853         info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 
     1852        //#pragma omp critical (_output) 
     1853        info(150) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 
    18541854  #ifdef XIOS_MEMTRACK_LIGHT 
    18551855        #pragma omp critical (_output) 
  • XIOS/dev/dev_trunk_omp/src/object_factory.hpp

    r1601 r1628  
    3737 
    3838         template <typename U> 
     39            static  int CheckObjectVector(); 
     40                
     41         template <typename U> 
    3942            static  const std::vector<std::shared_ptr<U> > & 
    4043               GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId()); 
  • XIOS/dev/dev_trunk_omp/src/object_factory_decl_macro.hpp

    r1591 r1628  
    1010  template int CObjectFactory::GetObjectIdNum<U>(void); \ 
    1111  template const std::vector<std::shared_ptr<U> >& CObjectFactory::GetObjectVector<U>(const StdString& context ); \ 
     12  template int CObjectFactory::CheckObjectVector<U>( ); \ 
    1213  template bool CObjectFactory::HasObject<U>(const StdString& id); \ 
    1314  template bool CObjectFactory::HasObject<U>(const StdString& context,const StdString& id); \ 
  • XIOS/dev/dev_trunk_omp/src/object_factory_impl.hpp

    r1601 r1628  
    125125 
    126126   template <typename U> 
    127       const std::vector<std::shared_ptr<U> > & 
     127   int CObjectFactory::CheckObjectVector() 
     128   { 
     129      if(U::AllVectObj_ptr) 
     130      { 
     131        return 1; 
     132      } 
     133      return 0; 
     134   } 
     135    
     136 
     137   template <typename U> 
     138   const std::vector<std::shared_ptr<U> > & 
    128139         CObjectFactory::GetObjectVector(const StdString & context) 
    129140   { 
    130       return (*U::AllVectObj_ptr)[context]; 
     141      if(U::AllVectObj_ptr) 
     142      { 
     143        //const std::vector<std::shared_ptr<U> > temp; 
     144        return (*U::AllVectObj_ptr)[context]; 
     145        //return std::vector<std::shared_ptr<U> > (0); 
     146      } 
     147       
    131148   } 
    132149 
  • XIOS/dev/dev_trunk_omp/src/object_template_impl.hpp

    r1601 r1628  
    426426   const vector<T*> CObjectTemplate<T>::getAll() 
    427427   { 
     428     int mycheck = CObjectFactory::CheckObjectVector<T>(); 
     429     if(mycheck==0) 
     430     { 
     431       vector<T*> vect; 
     432       return vect; 
     433     } 
    428434     const vector< std::shared_ptr<T> >& shared_vect= CObjectFactory::GetObjectVector<T>(CObjectFactory::GetCurrentContextId()); 
    429435     vector<T*> vect; 
  • XIOS/dev/dev_trunk_omp/src/test/test_omp.f90

    r1604 r1628  
    4545    CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 
    4646    CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr) 
    47     if(rank < size-2) then 
     47    if(rank < size-4) then 
    4848 
    4949    !$omp parallel default(firstprivate) 
Note: See TracChangeset for help on using the changeset viewer.