Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
snippets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
snippets
Commits
f28239ea
Commit
f28239ea
authored
2 years ago
by
Roberto Di Cosmo
Browse files
Options
Downloads
Patches
Plain Diff
Handle case when there are less shards than processes
parent
4aaa321e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlorentz/orc_to_swhid2sha1.py
+5
-2
5 additions, 2 deletions
vlorentz/orc_to_swhid2sha1.py
with
5 additions
and
2 deletions
vlorentz/orc_to_swhid2sha1.py
+
5
−
2
View file @
f28239ea
...
...
@@ -83,8 +83,11 @@ if PROCESSES is None:
# Upper-round the number of processes to a multiple of the number of shards,
# to evenly distribute the load
shards_per_process
=
len
(
shards
)
/
PROCESSES
PROCESSES
=
int
(
len
(
shards
)
/
math
.
floor
(
shards_per_process
))
if
PROCESSES
>
len
(
shards
):
PROCESSES
=
len
(
shards
)
else
:
shards_per_process
=
len
(
shards
)
/
PROCESSES
PROCESSES
=
int
(
len
(
shards
)
/
math
.
floor
(
shards_per_process
))
print
(
f
"
Converting
{
len
(
shards
)
}
shards from
{
input_dir
}
to
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment