Skip to content

Commit 60b6aff

Browse files
authored
Merge pull request #25 from xsuite/release/v0.4.2
Release 0.4.2
2 parents 1dfb7c7 + 47c8044 commit 60b6aff

16 files changed

+648
-316
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,22 @@ No more steps are needed as AFS can handle the I/O permissions for the Xboinc se
5050

5151
**Important!!! If you are using EOS, you need to set the proper permissions for the Xboinc server to access your folder!!**
5252

53-
You can do this by accessing the desired folder from the CERNBox web interface, right-clicking on the folder and selecting "Share", then adding the user `a:sixtadm` (n.b. this is the Xboinc service account) with the "Write" permission. It should look like this:
53+
You can do this by accessing the desired folder from the CERNBox web interface, right-clicking on the folder and selecting "Share", then adding the user `a:sixtadm` (n.b. this is the Xboinc service account) and invite as editor. It should look like this:
5454

5555
![Share folder with Xboinc service account](docs/img/share_folder_with_xboinc_service_account.png)
5656

5757
After that, you can register your username with the Xboinc server by running the following command:
5858

5959
```python
6060
import xboinc as xb
61-
xb.register("mycernshortname", "/eos/user/m/mycernshortname/my_xboinc_folder")
61+
xb.register("mycernshortname", "/eos/user/m/mycernshortname/my_xboinc_folder", permissions_given=True)
6262
```
6363

64+
Note that specifying `permissions_given=True` assumes that you have already set the appropriate permissions for the Xboinc service account on the specified EOS path. Not doing so will result in a `NotImplementedError` as we currently cannot manipulate EOS ACLs directly.
65+
6466
## Submit a job
6567

66-
To submit a job to the LHC@home project, you can use the `JobManager` class from the `xboinc` package. With `JobManager`, you can create a study, which will contain a set of jobs to be executed. Ideally, you should create a study for a single line to track, with multiple jobs for spreading the number of particles to track. However, it is also possible to create a study with multiple lines.
68+
To submit a job to the LHC@home project, you can use the `JobSubmitter` class from the `xboinc` package. With `JobSubmitter`, you can create a study, which will contain a set of jobs to be executed. Ideally, you should create a study for a single line to track, with multiple jobs for spreading the number of particles to track. However, it is also possible to create a study with multiple lines.
6769

6870
Here is an example of how to submit a job:
6971

@@ -75,7 +77,7 @@ import xboinc as xb
7577
line = xt.Line.from_json("path/to/your/line.json")
7678

7779
# create a job manager
78-
job_manager = xb.JobManager(
80+
job_manager = xb.JobSubmitter(
7981
user="mycernshortname",
8082
study_name="a_relevant_study_name",
8183
line=line,
@@ -107,12 +109,12 @@ Note that the jobs will be executed on a single CPU core from a volunteer comput
107109

108110
## Retrieve the results
109111

110-
When the jobs are completed, the Xboinc server will store the results in your allocated folder in compressed tar files. You can decompress and explore them by using the `ResultRetriever` class from the `xboinc` package. The simplest way to do that is:
112+
When the jobs are completed, the Xboinc server will store the results in your allocated folder in compressed tar files. You can decompress and explore them by using the `JobRetriever` class from the `xboinc` package. The simplest way to do that is:
111113

112114
```python
113115
import xboinc as xb
114116

115-
for job_name, result_particles in xb.ResultRetriever.iterate("mycernshortname", "a_relevant_study_name", dev_server=True):
117+
for job_name, result_particles in xb.JobRetriever.iterate("mycernshortname", "a_relevant_study_name", dev_server=True):
116118
print(f"Job {job_name} completed with particles: {result_particles.to_dict()}")
117119

118120
```

examples/results.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# copyright ############################### #
22
# This file is part of the Xboinc Package. #
3-
# Copyright (c) CERN, 2024. #
3+
# Copyright (c) CERN, 2025. #
44
########################################### #
55

66
import xboinc as xb
77

88
list_of_succeeded_jobs = []
99
user='sixtadm'
1010
study_name='example_study'
11-
for new_particles, jobinfo in xb.RetrieveJobs(user=user, study_name=study_name):
12-
print(jobinfo)
11+
for jobname, new_particles in xb.JobRetriever(user=user, study_name=study_name, dev_server=True):
12+
print(jobname)
1313
print(f"Particles: {new_particles.at_turn}")

examples/submission.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
y_norm=np.random.normal(0, 10, num_part_per_job*num_jobs),
2626
nemitt_x=3.5e-6, nemitt_y=3.5e-6)
2727

28+
# Do the submission
2829
study_name = "example_study"
29-
jobs = xb.SubmitJobs(user=user, study_name=study_name, line=line, dev_server=True)
30+
jobs = xb.JobSubmitter(user=user, study_name=study_name, line=line, dev_server=True)
3031
prev = time.time()
3132
for i in range(num_jobs):
3233
# select subgroup of particles
@@ -40,3 +41,10 @@
4041
now = time.time() ; print(f"{i+1}/{num_jobs} ({now-prev:.4}s)"); prev = now
4142
jobs.submit()
4243

44+
45+
# Alternatively, instead of manually looping over each job, you can use the `slice_and_add` method to create n jobs:
46+
study_name = "example_study_2"
47+
jobs = xb.JobSubmitter(user=user, study_name=study_name, line=line, dev_server=True)
48+
jobs.slice_and_add(base_job_name='job', num_turns=num_turns, particles=all_part,
49+
checkpoint_every=checkpoint_every)
50+
jobs.submit()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[tool.poetry]
77
name = "xboinc"
8-
version = "0.4.1"
8+
version = "0.4.2"
99
description = "Xsuite BOINC interface"
1010
homepage = "https://github.com/xsuite/xboinc"
1111
repository = "https://github.com/xsuite/xboinc"

0 commit comments

Comments
 (0)