[Dune-devel] [GSoC] Performance testing: more detailed schedule

Christian Engwer christian.engwer at uni-muenster.de
Wed Aug 14 09:11:41 CEST 2013


Hi Miha,

I didn't yet get a response on my mail from the weekend. Is everythin
all right?

Christian

On Tue, Aug 13, 2013 at 09:22:58AM +0200, Christian Engwer wrote:
> > a) ran into a problem:
> > 
> > christi at sansibar:~/Uni/Dune/dune-perftest$ ./dune/perftest/perftest.py perftest.ini
> > Traceback (most recent call last):
> >   File "./dune/perftest/perftest.py", line 86, in <module>
> >     test_project(sys.argv[1])
> >   File "./dune/perftest/perftest.py", line 30, in test_project
> >     if not CONFIG_TOP_SECTION in config:
> > TypeError: argument of type 'instance' is not iterable
> 
> the attached patch fixed the problems for me... not sure what it will
> do to python3?!
> 
> Christian

> diff --git a/dune/perftest/perftest.py b/dune/perftest/perftest.py
> index f477589..e541a3e 100755
> --- a/dune/perftest/perftest.py
> +++ b/dune/perftest/perftest.py
> @@ -27,28 +27,30 @@ def test_project(config_file):
>    config = configparser.ConfigParser()
>    config.read(config_file)
>    
> -  if not CONFIG_TOP_SECTION in config:
> +  if not CONFIG_TOP_SECTION in config.sections():
>      raise SyntaxError("The configuration file must have a [DUNE Perftest] section")
>  
> -  program_name = config[CONFIG_TOP_SECTION][KEY_PROGRAM_NAME]
> -  output_file = config[CONFIG_TOP_SECTION][KEY_OUTPUT]
> +  program_name = config.get(CONFIG_TOP_SECTION,KEY_PROGRAM_NAME)
> +  output_file = config.get(CONFIG_TOP_SECTION,KEY_OUTPUT)
>    
>    revision = None
> -  if KEY_VCS in config[CONFIG_TOP_SECTION]:
> -    revision = get_revision(dir_name, config[CONFIG_TOP_SECTION][KEY_VCS])
> +  if KEY_VCS in config.items(CONFIG_TOP_SECTION):
> +    revision = get_revision(dir_name, config.get(CONFIG_TOP_SECTION,KEY_VCS))
>    
> -  for section in config:
> +  for section in config.sections():
> +    print "Parsing section " + section
>      if section == CONFIG_TOP_SECTION:
>        continue
>      
> -    if not KEY_COMMAND in config[section]:
> +    if not config.has_option(section, KEY_COMMAND):
> +      print("No Entry '" + KEY_COMMAND + "' ... Skipping sections " + section)
>        continue;
>        
> -    command_type = config[section][KEY_COMMAND_TYPE] if KEY_COMMAND_TYPE in config[section] else section
> +    command_type = config.get(section,KEY_COMMAND_TYPE) if config.has_option(section, KEY_COMMAND_TYPE) else section
>      
> -    if KEY_PRE_COMMAND in config[section]:
> -      subprocess.call(config[section][KEY_PRE_COMMAND].split())
> -    data = measure(program_name, config[section][KEY_COMMAND].split(), command_type=command_type, revision=revision)
> +    if config.has_option(section, KEY_PRE_COMMAND):
> +      subprocess.call(config.get(section,KEY_PRE_COMMAND).split())
> +    data = measure(program_name, config.get(section,KEY_COMMAND).split(), command_type=command_type, revision=revision)
>      
>      log_file = os.path.join(dir_name, "%s_%s.log" % (output_file, section))
>      db_file = os.path.join(dir_name, "%s.db" % output_file)

> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel


-- 
Prof. Dr. Christian Engwer 
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster

E-Mail	christian.engwer at uni-muenster.de
Telefon	+49 251 83-35067
FAX		+49 251 83-32729




More information about the Dune-devel mailing list