.. _usage_run: Run WarpX ========= To run a new simulation, please follow these steps: #. Create a **new directory**, where the simulation will run. #. Make sure the WarpX **executable** is either copied into this directory or in your ``PATH`` `environment variable `__. #. Add an **inputs file** in the same directory. On :ref:`HPC systems `, add also a **job submission script**. #. Run the executable. Simulation Directory -------------------- On Linux/macOS, this is as easy as: .. code-block:: bash mkdir -p Where ```` is the actual path to the run directory. Executable File --------------- If you installed WarpX with a :ref:`package manager `, a ``warpx``-prefixed executable will be available as a regular system command. Depending on build options, the executable name includes additional suffixes. Try it like this: .. code-block:: bash warpx Pressing the ```` key will suggest available WarpX executables found in your ``PATH`` `environment variable `__. .. note:: WarpX provides a separate binary for each dimensionality: 1D, 2D, 3D, RZ, RCYLINDER, and RSPHERE. We encode the supported dimensionality in the binary file name. If you :ref:`compiled the code yourself `, the WarpX executable is located in the source tree under ``build/bin``. A symbolic link named ``warpx`` pointing to the most recently built executable is also created; you can copy either that link or the binary into your run directory. Copy the **executable** to this directory: .. code-block:: bash cp build/bin/ / where ```` should be replaced by the actual name of the executable (see above) and ```` by the actual path to the run directory. Input File ---------- You need to provide WarpX with an input file that configures the simulation. This can either be a parameter list or a Python script, depending on how you wish to run WarpX. To run the WarpX executable, add a **parameter list** file in the directory (see :ref:`examples ` and :ref:`parameters `). This is a text file containing the numerical and physical parameters that define the simulation. To run WarpX through the Python interface, add a **PICMI Python script** (see :ref:`examples ` and :ref:`PICMI parameters `). This is a Python script that defines the numerical and physical parameters using the `PICMI standard `__. On :ref:`HPC systems `, also copy and adjust a submission script that allocates computing nodes for you. Please :ref:`reach out to us ` if you need help setting up a template that runs with ideal performance. Run Simulation -------------- .. tab-set:: .. tab-item:: WarpX Executable Run the executable directly, e.g. with MPI: .. code-block:: bash cd # run with an inputs file: mpirun -np ./warpx Here, ```` is the number of MPI ranks used, and ```` is the name of the parameter list. Note that the actual executable might have a longer name, depending on build options. The example above uses the copied executable in the current directory (``./``). If you installed WarpX with a package manager, omit the ``./`` because WarpX will be found in your ``PATH``. .. tab-item:: Python Script Run via the Python interface: .. code-block:: bash # run with a PICMI input script: mpirun -np python Here, ```` is the number of MPI ranks used, ```` is the name of the :ref:`PICMI ` script. .. tab-item:: Job Script On an :ref:`HPC system `, you would instead submit the :ref:`job script ` at this point, e.g. ``sbatch `` (SLURM) or ``bsub `` (LSF). .. tip:: In the :ref:`next sections `, we explain the parameters in the ````. You can also overwrite parameters from the command line, for example: .. code-block:: bash mpirun -np 4 ./warpx max_step=10 warpx.numprocs=1 2 2 Outputs and Diagnostics ----------------------- By default, WarpX writes status updates to the terminal (``stdout``). On :ref:`HPC systems `, it is common to store a copy of this in a file called ``outputs.txt``. By default, WarpX also writes an exact copy of all explicitly and implicitly used input parameters to a file named ``warpx_used_inputs`` (this filename can be changed). This is important for reproducibility, since, as noted above, options from the input file can be extended or overridden from the command line. :ref:`Further configured diagnostics ` are explained in the next sections. By default, they are written to a subdirectory in ``diags/`` and can use various :ref:`output formats `.