Basic execution

Command Line Help

$ llg3d -h
usage: llg3d [-h] [--element {Cobalt,Iron,Nickel}] [--N N] [--dt DT] [--Jx JX]
             [--Jy JY] [--Jz JZ] [--dx DX] [--T T] [--H_ext H_EXT]
             [--init_type {0,dw}] [--result_file RESULT_FILE]
             [--start_averaging START_AVERAGING] [--n_mean N_MEAN]
             [--n_profile N_PROFILE] [--solver {opencl,mpi,numpy,jax}]
             [--precision {single,double}] [--blocking] [--seed SEED]
             [--device {cpu,gpu,auto}] [--profiling]
             [--verbosity {DEBUG,INFO,WARNING,ERROR,CRITICAL}]

Define a CLI for running LLG3D simulations.

options:
  -h, --help            show this help message and exit
  --element {Cobalt,Iron,Nickel}
                        Chemical element of the sample (default: Cobalt)
  --N N                 Number of time iterations (default: 5000)
  --dt DT               Time step (default: 1e-14)
  --Jx JX               Number of points in x (default: 300)
  --Jy JY               Number of points in y (default: 21)
  --Jz JZ               Number of points in z (default: 21)
  --dx DX               Step in x (default: 1e-09)
  --T T                 Temperature (K) (default: 0.0)
  --H_ext H_EXT         External field (A/m) (default: 0.0)
  --init_type {0,dw}    Type of initialization ('0' for uniform, 'dw' for
                        domain wall) (default: 0)
  --result_file RESULT_FILE
                        Name of the npz result file (default: run.npz)
  --start_averaging START_AVERAGING
                        Start index of time average (default: 4000)
  --n_mean N_MEAN       Spatial average frequency (number of iterations)
                        (default: 1)
  --n_profile N_PROFILE
                        x-profile save frequency (number of iterations)
                        (default: 0)
  --solver {opencl,mpi,numpy,jax}
                        Solver to use for the simulation (default: numpy)
  --precision {single,double}
                        Precision of the floating point (single or double)
                        (default: double)
  --blocking            Use blocking communications (MPI solver only)
                        (default: False)
  --seed SEED           Random seed for temperature fluctuations (default:
                        12345)
  --device {cpu,gpu,auto}
                        Device to use by the OpenCL solver (default: auto)
  --profiling           Enable profiling output (internal profiler) (default:
                        False)
  --verbosity {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging verbosity level (default: INFO)

Simple NumPy execution

$ llg3d --N 100
---
	x		y		z
J	300		21		21
L	2.99000000e-07	2.00000000e-08	2.00000000e-08
d	1.00000000e-09	1.00000000e-09	1.00000000e-09
---
dV    = 1.00000000e-27
V     = 1.19600000e-22
ntot  = 132300
ncell = 119600
---
element         : Cobalt
N               = 100
dt              = 1e-14
Jx              = 300
Jy              = 21
Jz              = 21
dx              = 1e-09
T               = 0.0
H_ext           = 0.0
init_type       : 0
result_file     : run.npz
start_averaging = 4000
n_mean          = 1
n_profile       = 0
solver          : numpy
precision       : double
blocking        = False
seed            = 12345
device          : auto
profiling       = False
verbosity       : INFO
np              = 1


  0%|          | 0/100 [00:00<?, ?it/s]
  3%|▎         | 3/100 [00:00<00:03, 26.60it/s]
  7%|▋         | 7/100 [00:00<00:03, 29.15it/s]
 11%|█         | 11/100 [00:00<00:02, 30.09it/s]
 15%|█▌        | 15/100 [00:00<00:02, 30.59it/s]
 19%|█▉        | 19/100 [00:00<00:02, 30.99it/s]
 23%|██▎       | 23/100 [00:00<00:02, 31.04it/s]
 27%|██▋       | 27/100 [00:00<00:02, 31.16it/s]
 31%|███       | 31/100 [00:01<00:02, 31.35it/s]
 35%|███▌      | 35/100 [00:01<00:02, 31.41it/s]
 39%|███▉      | 39/100 [00:01<00:01, 31.32it/s]
 43%|████▎     | 43/100 [00:01<00:01, 31.47it/s]
 47%|████▋     | 47/100 [00:01<00:01, 30.92it/s]
 51%|█████     | 51/100 [00:01<00:01, 31.03it/s]
 55%|█████▌    | 55/100 [00:01<00:01, 31.35it/s]
 59%|█████▉    | 59/100 [00:01<00:01, 31.41it/s]
 63%|██████▎   | 63/100 [00:02<00:01, 31.35it/s]
 67%|██████▋   | 67/100 [00:02<00:01, 31.38it/s]
 71%|███████   | 71/100 [00:02<00:00, 31.20it/s]
 75%|███████▌  | 75/100 [00:02<00:00, 31.23it/s]
 79%|███████▉  | 79/100 [00:02<00:00, 31.37it/s]
 83%|████████▎ | 83/100 [00:02<00:00, 31.39it/s]
 87%|████████▋ | 87/100 [00:02<00:00, 31.41it/s]
 91%|█████████ | 91/100 [00:02<00:00, 31.55it/s]
 95%|█████████▌| 95/100 [00:03<00:00, 31.50it/s]
 99%|█████████▉| 99/100 [00:03<00:00, 31.49it/s]
100%|██████████| 100/100 [00:03<00:00, 31.16it/s]N iterations          = 100
total_time [s]        = 3.263
time/ite [s/ite]      = 3.263e-02
efficiency [s/ite/pt] = 2.466e-07
CFL                   = 7.543e-02
Saving run.npz

Output file

The execution produces the archive file run.npz which contains the parameters and the result data:

$ unzip -l run.npz
Archive:  run.npz
  Length      Date    Time    Name
---------  ---------- -----   ----
      152  1980-01-01 00:00   params/element.npy
      136  1980-01-01 00:00   params/N.npy
      136  1980-01-01 00:00   params/dt.npy
      136  1980-01-01 00:00   params/Jx.npy
      136  1980-01-01 00:00   params/Jy.npy
      136  1980-01-01 00:00   params/Jz.npy
      136  1980-01-01 00:00   params/dx.npy
      136  1980-01-01 00:00   params/T.npy
      136  1980-01-01 00:00   params/H_ext.npy
      132  1980-01-01 00:00   params/init_type.npy
      156  1980-01-01 00:00   params/result_file.npy
      136  1980-01-01 00:00   params/start_averaging.npy
      136  1980-01-01 00:00   params/n_mean.npy
      136  1980-01-01 00:00   params/n_profile.npy
      148  1980-01-01 00:00   params/solver.npy
      152  1980-01-01 00:00   params/precision.npy
      129  1980-01-01 00:00   params/blocking.npy
      136  1980-01-01 00:00   params/seed.npy
      144  1980-01-01 00:00   params/device.npy
      129  1980-01-01 00:00   params/profiling.npy
      144  1980-01-01 00:00   params/verbosity.npy
      136  1980-01-01 00:00   params/np.npy
      136  1980-01-01 00:00   results/metrics/total_time.npy
      136  1980-01-01 00:00   results/metrics/time_per_ite.npy
      136  1980-01-01 00:00   results/metrics/efficiency.npy
      136  1980-01-01 00:00   results/metrics/CFL.npy
     1744  1980-01-01 00:00   results/records/xyz_average.npy
---------                     -------
     5342                     27 files

To post-process this result file, see here.