Running the executable generated by the quick automated approach

If you have used the application build-scripts provided along with each of the prebuilt ParaMonte libraries to build your C/C++/Fortran application, you can follow the guidelines below to run your application.

Running the executable generated via the quick automated approach on Windows

The current version of the Batch build-script build.bat that comes with the prebuilt ParaMonte libraries, both builds and runs your application.

To rerun an executable, follow the instructions below on this page for serial and parallel simulations.

Running the executable generated via the quick automated approach on Linux / macOS

The current version of the Bash build-script build.sh that comes with the prebuilt ParaMonte libraries, generates another Bash script run.sh (in the same working directory) which can be called on the command-line to run the generated executable.

Running the manually-generated executable via do-it-yourself approach

The instructions slightly vary across different Operating Systems (OS), depending on the parallelism-paradigm used in your application.

Running the manually-generated executable on a single processor

To run an executable (main.exe) built for serial simulations on either Windows, Linux, or macOS (Darwin), simply type the executable’s name on the command line,

main.exe

Running the manually-generated executable on multiple processors

Running the manually-generated executable on multiple processors on Windows

  • MPI-parallelism
    To run an executable (main.exe) built for MPI-parallel-simulations on a single node of multiple processors, for example on a single computer, invoke the MPI launcher mpiexec on the command line,
    mpiexec -localonly -n 3 main.exe
    

    where the flag -localonly ensures that the simulation is run only on a single node. This option avoids the invocation of the Hydra service which would require prior registration of the service. The flag -n 3 assigns three MPI tasks to three physical processors for the simulation. Change the number 3 to as many processor counts as you wish to use.

  • Coarray-parallelism
    • Set the number of parallel images (that is, the number of processors or parallel tasks) with which you want to run your application. Assuming you have built your application via the Intel Parallel Studio compilers, you can request a specific number of runtime processors by (re)defining the FOR_COARRAY_NUM_IMAGES environmental variable on the command-prompt. For example to run a coarray-enabled ParaMonte application on 3 processors,
      set FOR_COARRAY_NUM_IMAGES=3
      

      If this variable is undefined at runtime, the application will, by default, use all of the available processors on the system for the parallel simulation.

    • Run the Coarray-enabled parallel ParaMonte application by simply calling the executable’s name on the command line,
      main.exe
      

Running the manually-generated executable on multiple processors on Linux / macOS

  • MPI-parallelism
    To run an executable (main.exe) built for MPI-parallel-simulations on multiple processors, invoke the MPI launcher mpiexec on the command line,
    mpiexec -n 3 main.exe
    

    The flag -n 3 assigns three MPI tasks to three physical processors for the simulation. Change the number 3 to as many processor counts as you wish to use.

  • Coarray-parallelism
    Running Coarray-enabled parallel applications on Unix-like systems depends on the choice of compiler you have made to build your application.


If you have any questions about the topics discussed on this page, feel free to ask in the comment section below or reach out to the ParaMonte library authors.