I see blocks of code like this in MTTGDS.pm and some of the new analyzers:

        my $mca = $report->{command};
        $mca =~ s/^\s*$report->{launcher}//;
        $mca =~ s/\s(-n|--n|-np|--np)\s\S+//;
        $mca =~ s/\s(-rf|--rankfile)\s\S+//;
        $mca =~ s/\s(-hostfile|--hostfile)\s\S+//;
        $mca =~ s/\s(-host|--host)\s\S+//;
        $mca =~ s/\s*(-x)\s\S+//g;
        $mca =~ s/\s[\S\/\\]*$report->{test_name}.*//;
        $mca =~ s/\s\s/ /g;
        $mca =~ s/^\s+|\s+$//g;
        $phase_form->{mpi_mca} = $mca;

The problem I ran into is that at least some of the OMPI test suite executables 
have perl special characters in it (e.g., mpi2c++).  It looks to me like the 
goal of this block is to obtain a list of the MCA parameters on the command 
line.  Right?  If so, I think this is a safer method, and will only get mca 
params (not other random mpirun parameters that don't happen to be listed in 
the regexps above):

        my @params;
        my $cmd = $report->{command};
        while ($cmd =~ s/\s([\-]*-mca)\s+(\S+)\s+(\S+)\s/ /) {
            push(@params, "$1 $2 $3");
        }
        $phase_form->{mpi_mca} = join(' ', @params);

That being said, this *is* an Open MPI-specific field.  MTT was supposed to 
remain MPI-agnostic.  

Is there a reason you guys didn't use the MPI Details fields "parameters" and 
"network" for this purpose?  We have an MPI::OMPI module which is perfect for 
doing OMPI-specific things.  Using the MPI:: modules, you can keep MTT core 
clean so that we can run other MPI implementations through MTT as well.

I just committed:

    https://svn.open-mpi.org/trac/mtt/changeset/1348
    https://svn.open-mpi.org/trac/mtt/changeset/1349

that puts the above logic in 
MTT::Values::Functions::MPI::OMPI::find_mca_params() and converted MTTGDS and 
all the performance analyzers to call this function.

I also added a check in MTTGDS.pm to ensure that the analyzer pm has PreReport 
before trying to call it.

-- 
Jeff Squyres
jsquy...@cisco.com

For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to