Changeset 1706


Ignore:
Timestamp:
09/11/19 16:39:35 (5 years ago)
Author:
yushan
Message:

Generic_testcase : add a bash script for launching tests in different sub-folders (test_function, test_axis_algo). Generate a status report test_report.txt for all tests

Location:
XIOS/dev/dev_trunk_omp
Files:
7 added
8 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/context_atm.xml

    r1694 r1706  
    2727    </axis> 
    2828    <axis id="domain_X_zoom" axis_ref="domain_X"> 
    29         <zoom_axis begin="0" n="1"/> 
     29        <zoom_axis begin="0" n="10"/> 
    3030    </axis> 
    3131    <axis id="domain_Y_zoom" axis_ref="domain_Y"> 
    32         <zoom_axis begin="3" n="1"/> 
     32        <zoom_axis begin="3" n="5"/> 
    3333    </axis> 
    3434  </axis_definition> 
     
    385385 
    386386  <file_definition  type="one_file" > 
    387      
    388     <file id="atm_output" output_freq="1ts" type="one_file" enabled="true"> 
    389        <!-- <field id="id_fieldXY" field_ref="field_XY" operation="once" enabled="true"/> --> 
    390        <field id="id_fieldX" field_ref="field_X" operation="once" enabled="true"/> 
    391     </file> 
    392  
    393      <file id="atm_output_zoom" output_freq="1ts" enabled="true"> 
    394        <field id="fieldX_zoomX" field_ref="field_X" grid_ref="grid_X_zoom" operation="once" enabled="true"/> 
    395        <!-- <field id="fieldXY_zoomX" field_ref="field_XY" grid_ref="grid_XY_zoom_X" operation="once" enabled="true"/> 
    396        <field id="fieldXY_zoomY" field_ref="field_XY" grid_ref="grid_XY_zoom_Y" operation="once" enabled="true"/> --> 
     387   
     388 
     389     <file id="atm_output" output_freq="1ts" enabled="true"> 
     390       <field id="fieldXY_zoomY" field_ref="field_XY" grid_ref="grid_XY_zoom_Y" operation="once" enabled="true"/> 
    397391    </file> 
    398392 
  • XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/iodef.xml

    r1694 r1706  
    5454        <variable id="info_level" type="int">100</variable> 
    5555        <variable id="print_file" type="bool">true</variable> 
    56         <variable id="using_server2" type="bool">false</variable> 
     56        <variable id="using_server2" type="bool">true</variable> 
    5757        <variable id="ratio_server2" type="int">50</variable> 
    5858        <variable id="number_pools_server2" type="int">1</variable> 
  • XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/param.def

    r1694 r1706  
    11&params_run 
    2 duration='1d' 
    3 nb_proc_atm=8 
     2UsingServer2 = true 
     3RatioServer2 = 50 
     4NumberPoolsServer2 = 1 
     5nb_proc_atm = 8 
     6NumberServers = 4 
     7duration = '1d' 
    48/ 
     9 
  • XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_function/Check.py

    r1701 r1706  
    11import os 
     2import sys 
    23 
    34 
     
    67def main(): 
    78         
    8  
    9         configName='config' 
    109        configNamePattern=[0, 0, 0, 0, 0, 0] 
    1110 
    1211        f=open("user_param.py", "r") 
    1312        for line in f: 
    14                 if not line.startswith("#"): 
    15                         if len(line.strip()) != 0: 
    16                                 n = line.split(None, 1)[0] 
    17                                 if n == 'UsingServer2': 
    18                                         configNamePattern[0] = '_UsingSrv2=' + UsingServer2 
    19                                 elif n=='RatioServer2': 
    20                                         configNamePattern[1] = '_RatioSrv2=' + repr(RatioServer2) 
    21                                 elif n=='NumberPoolsServer2': 
    22                                         configNamePattern[2] = '_NbPoolsSrv2=' + repr(NumberPoolsServer2) 
    23                                 elif n=='NumberClients': 
    24                                         configNamePattern[3] = '_NbClients=' + repr(NumberClients) 
    25                                 elif n=='NumberServers': 
    26                                         configNamePattern[4] = '_NbServers=' + repr(NumberServers) 
    27                                 else: 
    28                                         configNamePattern[5] = '_Duration=' + Duration 
    29  
    30    
     13                line = line.strip() 
     14                if line.startswith("UsingServer2"): 
     15                        configNamePattern[0] = '_UsingSrv2=' + UsingServer2 
     16                elif line.startswith("RatioServer2"): 
     17                        configNamePattern[1] = '_RatioSrv2=' + repr(RatioServer2) 
     18                elif line.startswith("NumberPoolsServer2"): 
     19                        configNamePattern[2] = '_NbPoolsSrv2=' + repr(NumberPoolsServer2) 
     20                elif line.startswith("NumberClients"): 
     21                        configNamePattern[3] = '_NbClients=' + repr(NumberClients) 
     22                elif line.startswith("NumberServers"): 
     23                        configNamePattern[4] = '_NbServers=' + repr(NumberServers) 
     24                elif line.startswith("Duration"): 
     25                        configNamePattern[5] = '_Duration=' + Duration 
    3126        f.close() 
    3227                 
     
    3530        defaultConfig = True 
    3631 
    37         for i in range(6): 
     32        for i in range(len(configNamePattern)): 
    3833                if configNamePattern[i] != 0: 
    3934                        configName = configName + configNamePattern[i] 
     
    4338                configName = "config_default" 
    4439 
    45         print(configName) 
    46  
    47         # os.system('rm -rf config_*') 
    4840 
    4941        if not os.path.exists(configName): 
    5042                os.mkdir(configName) 
    51                 print("********************************************************") 
    52                 print("* Directory " + repr(configName) + " Created ") 
    53                 print("* Copy results to \'not_validated_reference\' folder") 
    54                 print("********************************************************") 
     43                print("\n    ****************************************************************") 
     44                print("    * Directory " + repr(configName) + " Created ") 
     45                print("    * Copy results to \'not_validated_reference\' folder") 
     46                print("    ****************************************************************\n") 
    5547 
    5648                os.mkdir(configName+'/setup') 
     
    6456                 
    6557                os.system('cp atm_output.nc '+configName+'/tmp_reference/') 
    66                 os.system('cp -r '+configName+'/tmp_reference/ ' + configName+'/reference/') 
     58                # os.system('cp -r '+configName+'/tmp_reference/ ' + configName+'/reference/') 
    6759 
    6860        else:     
    69                 print("********************************************************") 
    70                 print("* Directory " + repr(configName) + " already exists") 
    71                 print("* Start comparing results with (tmp) references") 
    72                 print("********************************************************") 
     61                print("\n    ********************************************************") 
     62                print("    * Directory " + repr(configName) + " already exists") 
     63                print("    * Start comparing results with (tmp) references") 
     64                print("    ********************************************************\n") 
    7365 
    7466                tmp_ref = os.path.isdir(configName+'/tmp_reference') 
    7567                ref = os.path.isdir(configName+'/reference') 
    7668 
    77                 path=0 
    78  
    7969                if ref: 
    80                         print("* Comparing results with references") 
     70                        print("\n    =====================================") 
     71                        print("    | Comparing results with references |") 
     72                        print("    =====================================\n") 
    8173                        os.system('rm -rf '+configName+'/tmp_reference/') 
    8274                        tmp_ref = False 
    8375                        path = configName+'/reference/' 
    8476                elif tmp_ref: 
    85                         print("* Comparing results with non-validated references") 
     77                        print("\n    ===================================================") 
     78                        print("    | Comparing results with NON-Validated references |") 
     79                        print("    ===================================================\n") 
    8680                        path = configName+'/tmp_reference/' 
    87  
    88                 print(path) 
    8981 
    9082                os.system('cdo diffn atm_output.nc '+path+'/atm_output.nc | tail -1 > diff.txt') 
     
    9284                f=open("diff.txt", "r") 
    9385                for line in f: 
    94                         # line = line.strip() 
    9586                        if line.strip().startswith("0"): 
    96                                 print "    *******************" 
    97                                 print "    ** Test is valid **" 
    98                                 print "    *******************" 
     87                                print "\n        ***********************" 
     88                                print "        ** Test is valid !!! **" 
     89                                print "        ***********************\n" 
     90                                valid = True 
     91 
    9992                        else: 
    100                                 print "    *******************************************" 
    101                                 print "    ** Test is NOT valid. Please debuging... **" 
    102                                 print "    *******************************************" 
     93                                print "\n        *******************************************" 
     94                                print "        ** Test is NOT valid. Please debuging... **" 
     95                                print "        *******************************************\n" 
     96                                valid = False 
    10397 
     98                f.close() 
     99 
     100                f=open("report.txt", "a+") 
     101                if valid: 
     102                        f.write("test for "+configName+" passed.\n") 
     103                else: 
     104                        f.write("test for "+configName+" failed.\n") 
    104105                f.close() 
    105106 
  • XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_function/Config.py

    r1701 r1706  
    11import os 
     2import sys 
    23 
    34from default_param import * 
     
    3839 
    3940 
     41        print >>sys.stderr, nb_proc 
    4042 
    4143 
  • XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_function/run.sh

    r1701 r1706  
    11#!/bin/bash 
    22 
     3touch report.txt 
     4> report.txt 
     5 
    36nb_config=$(python mul_Config.py 2>&1)                                                                                                                     
    4 # mkdir $va 
    57 
    68 
     
    810while [ $counter -lt $nb_config ] 
    911do 
     12 
    1013rm -f user_param.py 
    11 # echo $counter 
     14 
    1215cp user_param.py.$counter user_param.py 
    13 # echo $? 
    1416 
    15 # echo cp -n user_param.py.$counter user_param.py 
    1617((counter++)) 
    1718 
    18 python Config.py 
    19 mpirun -np 10 ../../build_prod/bin/generic_testcase.exe 
     19nb_proc=$(python Config.py 2>&1)  
     20 
     21mpirun -np $nb_proc ../../build_prod/bin/generic_testcase.exe 
     22 
    2023python Check.py 
     24# echo $valid 
     25 
    2126done 
  • XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_fortran.cpp

    r1646 r1706  
    3030      { 
    3131        ep_lib::fc_comm_map.insert(std::make_pair( std::make_pair( *static_cast< MPI_Fint*>(fint), omp_get_thread_num()) , comm)); 
    32         printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &(ep_lib::fc_comm_map), *static_cast< MPI_Fint*>(fint), omp_get_thread_num(), comm->ep_comm_ptr); 
     32        // printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &(ep_lib::fc_comm_map), *static_cast< MPI_Fint*>(fint), omp_get_thread_num(), comm->ep_comm_ptr); 
    3333      } 
    3434    } 
     
    5353      ep_lib::MPI_Comm comm_ptr; 
    5454      comm_ptr = it->second; 
    55       printf("EP_Comm_f2c : MAP %p find: %d, %d, %p\n", &(ep_lib::fc_comm_map), it->first.first, it->first.second, comm_ptr->ep_comm_ptr); 
     55      // printf("EP_Comm_f2c : MAP %p find: %d, %d, %p\n", &(ep_lib::fc_comm_map), it->first.first, it->first.second, comm_ptr->ep_comm_ptr); 
    5656      return  comm_ptr; 
    5757    } 
  • XIOS/dev/dev_trunk_omp/src/transformation/generic_algorithm_transformation.cpp

    r1679 r1706  
    3636TRY 
    3737{ 
    38   std::cout<<"================================ CGenericAlgorithmTransformation::apply"<<std::endl; 
    3938 
    4039  int nbLocalIndex = localIndex.size();    
Note: See TracChangeset for help on using the changeset viewer.