Transfer from C++ command line



  • It is necessary to start by using the command line mpi a large number of times in the cycle to calculate the average time of implementation. To this end, we will create a separate C++ slide (not mpi) in which a command line with teams will be set up in the cycle

    cd C:\Program Files\MPICH2\bin
    

    And then this command line has to betray the team.

    mpiexec -n количество процессов путь к mpi-проге
    

    (in which time will be measured by mpi). What are the C++ teams for this?



  • First you want to change the current directory. Better do it with C+++. There's a systemic chdir challenge in the youths. Vince must have something like that, too. Look.

    Then you want to do mpiexec and give her some parameters. This can be done in several ways.

    1. use system(s). If you want to change the parameter-n, you can form a line either with string or C using sprintf().
    2. With the help of...popen(). He returns the index to FILE, from which you can read what the program is doing sends to stdout.
    3. Using API, like exec.

    P.S. The current directory can be replaced by a function http://msdn.microsoft.com/en-us/library/bf7fwze1%28v=VS.71%29.aspx




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2