You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/feature-request.md
+9-17Lines changed: 9 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,31 +9,23 @@ assignees: elenafuengar
9
9
## Feature request 💡
10
10
Suggest an idea that should be implemented in Wakis ⚙️💖
11
11
12
-
**🧩 Is your feature request related to a problem? Please describe.**
13
-
A clear and concise description of the underlying problem or limitation.
14
-
_Example: "I'm always frustrated when [...]"_
15
12
16
-
---
17
-
18
-
**🔍 Describe the solution you'd like**
13
+
#### 🔍 Describe the solution you'd like
19
14
What would the ideal solution look like? Be specific!
20
15
_Example: "I wish I could [...], and the solver would automatically [...]"_
21
16
22
-
---
23
17
24
-
**🔄 Describe alternatives you've considered**
25
-
Have you tried other workarounds, external tools, or existing features?
18
+
#### 🔄 Describe alternatives you've considered
19
+
Have you tried other workarounds, external tools, or existing features? You can include some Python code/pseudo-code here if you don't want to go through the Pull-Request hassle:
20
+
21
+
```python
22
+
# your code idea
23
+
```
26
24
27
-
---
28
25
29
-
**📎 Additional context**
30
-
Include any extra information, screenshots, mockups, or use cases that help us understand your idea better.
31
26
32
-
---
33
27
34
-
**🙏 Thank you!**
35
-
We're excited to hear your suggestions. Your feedback makes Wakis better for everyone! 🌟
36
28
29
+
>**🙏 PS: Thank you!**
30
+
>We're excited to hear your suggestions. Your feedback makes Wakis better for everyone! 🌟
37
31
38
-
**Additional context**
39
-
Add any other context or screenshots about the feature request here.
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,12 @@ Check 📁 `examples/` and `notebooks/` for different physical applications:
45
45
* Custom perturbation interacting with PEC geometry
46
46
* Wakefield simulation of accelerator cavity on CPU, GPU and with MPI
47
47
48
+
Check 🌐📁 [`SWAN_tutorial/`](https://github.com/ImpedanCEI/SWAN_tutorial) for hands-on notebook examples ready to run on CERN's SWAN service's GPUs (A100, Tesla T4):
49
+
50
+
[<imgclass="open_in_swan"data-path="your_submodule_name"alt="Open this Gallery in SWAN"src="https://swanserver.web.cern.ch/swanserver/images/badge_swan_white_150.png">][gallery_url]
You can find the official CUDA Toolkit in the [NVIDIA development website](https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Fedora&target_version=41&target_type=rpm_local)
141
141
142
-
##Python Notebooks troubleshooting
142
+
### HTCondor with GPU submission
143
143
144
-
### Matplotlib interactive plots
145
-
Within jupyter notebooks, in order to be able to zoom and interact with matplotlib figures, one needs to use notebook magic commands `%`.
146
-
* The recommended one for Jupyter notebooks on the web is `%matplotlib widget`
147
-
* The recommended one for Jupyter notebooks on VS Code in `%matplotlib ipympl`
144
+
Your `config_condor.sub` file needs to request a GPU
145
+
```
146
+
if !defined FNAME
147
+
FNAME = outputs
148
+
endif
148
149
149
-
The package `ipympl`can be easily installed using `pip install ipympl`
150
+
ID = $(Cluster).$(Process)
150
151
151
-
### PyVista interactive plots
152
-
To be able to render 3D interactive plots in Jupyter notebooks, it is recommended to use the `wakis['notebook']` pip installation.
152
+
output = ./logs/$(FNAME).$(ID).out
153
+
error = ./logs/$(FNAME).$(ID).err
154
+
log = ./logs/$(FNAME).$(Cluster).log
153
155
154
-
Some driver problems may arise depending on pre-installed versions. One way of solving common errors like `MESA-loader` or `libGL error` is installing a new driver within your conda environment with:
156
+
should_transfer_files = YES
157
+
when_to_transfer_output = ON_EXIT
158
+
159
+
request_GPUs = 1
160
+
request_CPUs = 1
161
+
+MaxRunTime = 100
162
+
+AccountingGroup = your_acct_group
155
163
164
+
executable = simulation_run.sh
156
165
```
157
-
conda install conda-forge::libstdcxx-ng
166
+
167
+
Your `simulation_run.sh` file could optionally include:
If you're in a headless environment (e.g., remote server, openstack machine), forcing OSMesa (Off-Screen Mesa) rendering might help:
175
+
# Fix for UCX errors
176
+
export UCX_TLS=rc,tcp,cuda_copy,cuda_ipc
177
+
178
+
# Fix for HDF5 file locking issues, when overwriting to same directory
179
+
export HDF5_USE_FILE_LOCKING=FALSE
180
+
181
+
python3.11 -m wakis_simulation.main
182
+
```
183
+
184
+
An example python project for simulating on HTCondor, is shown here [BLonD Simulation Template](https://gitlab.cern.ch/blond/blond-simulation-template).
185
+
The submission files are based on the approach used in this example project [^3], modified for GPU. The project can be modified for the wakis environment, it currently is set up
186
+
for simulations with BLonD, the longitudinal beam dynamics code.
187
+
188
+
## CPU Multithreading
189
+
To achieve multithreading for Wakis `sparse matrix x vector` operations, the Intel-MKL backend has been implemented as an alternative to single-threaded `scipy.sparse.dot`. To install it in your conda environment simply do:
190
+
191
+
```
192
+
pip install mkl mkl-service sparse_dot_mkl
193
+
```
194
+
195
+
Wakis will detect that the package is installed and use it as default backend. To control the number of threads and memory pinning, add the following lines to your python script **before** the imports:
161
196
162
197
```python
198
+
# [!] Set before importing numpy/scipy/mkl modules
163
199
import os
164
-
os.environ['PYVISTA_USE_OSMESA'] ='True'
200
+
os.environ["OMP_NUM_THREADS"] =str(os.cpu_count()) # Number of OpenMP threads
os.environ['OMPI_MCA_opal_cuda_support']='true'# multi GPU
296
+
297
+
from mpi4py importMPI
298
+
comm =MPI.COMM_WORLD
299
+
rank = comm.Get_rank()
300
+
size = comm.Get_size()
301
+
print(f"Process {rank} of {size} is running")
302
+
303
+
import cupy
304
+
cupy.cuda.Device(rank).use()
305
+
```
306
+
307
+
## Python Notebooks troubleshooting
308
+
309
+
### Matplotlib interactive plots
310
+
Within jupyter notebooks, in order to be able to zoom and interact with matplotlib figures, one needs to use notebook magic commands `%`.
311
+
* The recommended one for Jupyter notebooks on the web is `%matplotlib widget`
312
+
* The recommended one for Jupyter notebooks on VS Code in `%matplotlib ipympl`
313
+
314
+
The package `ipympl`can be easily installed using `pip install ipympl`
315
+
316
+
### PyVista interactive plots
317
+
To be able to render 3D interactive plots in Jupyter notebooks, it is recommended to use the `wakis['notebook']` pip installation.
318
+
319
+
Some driver problems may arise depending on pre-installed versions. One way of solving common errors like `MESA-loader` or `libGL error` is installing a new driver within your conda environment with:
320
+
321
+
```
322
+
conda install conda-forge::libstdcxx-ng
323
+
```
324
+
325
+
If you're in a headless environment (e.g., remote server, openstack machine), forcing OSMesa (Off-Screen Mesa) rendering might help:
326
+
327
+
```python
328
+
import os
329
+
os.environ['PYVISTA_USE_OSMESA'] ='True'
330
+
```
331
+
239
332
----
240
333
241
334
[PyVista](https://github.com/pyvista/pyvista) a python package for 3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK) [^1].
@@ -245,3 +338,4 @@ We rely on [PyVista](https://github.com/pyvista/pyvista) to import CAD/STL geome
245
338
246
339
[^1]: Sullivan and Kaszynski, (2019). PyVista: 3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK). Journal of Open Source Software, 4(37), 1450, https://doi.org/10.21105/joss.01450
247
340
[^2]: Anaconda Software Distribution. (2020). Anaconda Documentation. Anaconda Inc. Retrieved from https://docs.anaconda.com/
341
+
[^3]: S. Lauber, (2025). Blond Simulation Template. Retrieved from https://gitlab.cern.ch/blond/blond-simulation-template
Copy file name to clipboardExpand all lines: docs/usersguide.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ from wakis import WakeSolver # Wake and Impedance calculation
44
44
45
45
### Simulation domain, geometry and materials setup
46
46
47
-
`wakis` is a numerical electromagnetic solver that uses the Finite Integration Technique. The grid used is a structured grid composed by rectangular cells. The simulation domain is a rectangular box that will be broken into cells where the electromagnetic fields will be computed.
47
+
`wakis` is a numerical electromagnetic solver that uses the Finite Integration Technique. The grid used is a structured grid composed by rectangular cells. The simulation domain is a rectangular box that will be broken into cells where the electromagnetic fields will be computed. Notice that all the input parameters for Wakis must be in SI Base Units.
48
48
49
49
#### Number of mesh cells
50
50
@@ -63,7 +63,7 @@ Note that the number of cells will heavily affect the simulation time (in partic
63
63
```
64
64
65
65
### `STL` geometry importing
66
-
In beam-coupling impedance simulations one is usually interested in the geometric impedance, together with the impedance coming from material properties. In `wakis`, the geometry to simulate (sometimes referred as Embedded boundaries) can be imported from a `.stl` file containing a CAD model.
66
+
In beam-coupling impedance simulations one is usually interested in the geometric impedance, together with the impedance coming from material properties. In `wakis`, the geometry to simulate (sometimes referred as Embedded boundaries) can be imported from a `.stl` file containing a CAD model, and the units should be meters [m].
67
67
68
68
```python
69
69
# stl geometry files (add path to them if necessary)
After this, the user needs to indicate the domain bounds to simulate. They can be calculated from the imported geometry or just hardcoded:
122
+
After this, the user needs to indicate the domain bounds to simulate, in [m]. They can be calculated from the imported geometry or just hardcoded with `float` values:
0 commit comments