Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gpfs-policy
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
gpfs-policy
Commits
1a970090
Commit
1a970090
authored
11 months ago
by
Matthew K Defenderfer
Browse files
Options
Downloads
Patches
Plain Diff
remove creating and running array job from python script
parent
693d24f6
No related branches found
No related tags found
1 merge request
!9
Draft: Partition parquet dataset for sync with s5cmd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
prep-parquet-for-s5cmd/fpart-db.py
+3
-26
3 additions, 26 deletions
prep-parquet-for-s5cmd/fpart-db.py
with
3 additions
and
26 deletions
prep-parquet-for-s5cmd/fpart-db.py
+
3
−
26
View file @
1a970090
...
...
@@ -27,8 +27,8 @@ def main():
split_count
=
args
.
split_count
part_dir
=
args
.
partition_dir
input_parquet
=
args
.
input_parquet
dest
=
re
.
sub
(
r
'
/$
'
,
''
,
args
.
destination
)
filter
=
re
.
sub
(
r
'
/$
'
,
''
,
args
.
filter
)
dest
=
re
.
sub
(
r
'
/
*
$
'
,
''
,
args
.
destination
)
filter
=
re
.
sub
(
r
'
/
*
$
'
,
''
,
args
.
filter
)
ddf
=
dd
.
read_parquet
(
input_parquet
)
...
...
@@ -38,7 +38,7 @@ def main():
ddf
=
ddf
.
loc
[
~
ddf
[
'
mode
'
].
str
.
startswith
(
'
d
'
)].
reset_index
(
drop
=
True
)
ddf
[
'
group
'
]
=
np
.
floor
(
ddf
.
index
/
split_count
).
astype
(
int
)
ddf
[
'
group
'
]
=
np
.
floor
(
ddf
.
index
/
split_count
).
astype
(
int
)
+
1
ddf
[
'
cmd
'
]
=
ddf
[
'
path
'
].
map
(
lambda
x
:
create_sync_cmd
(
x
,
filter
=
filter
,
dest
=
dest
),
meta
=
str
)
...
...
@@ -62,28 +62,5 @@ def main():
for
value
in
values
:
f
.
write
(
f
"
{
value
}
\n
"
)
array_sh
=
f
"""
#!/bin/bash
#
#SBATCH --job-name=s5-array-%a
#SBATCH --partition=amd-hdr100
#SBATCH --ntasks=8
#SBATCH --mem=16G
#SBATCH --time=02:00:00
#SBATCH --output=out/%A-%a.out
#SBATCH --error=err/%A-%a.err
#SBATCH --array=0-
{
df
[
'
group
'
].
max
()
}
%10
module load Anaconda3
conda activate s3
s5cmd --nworkers 8 --endpoint-url https://s3.lts.rc.uab.edu run
{
part_dir
}
/part_${{SLURM_ARRAY_TASK_ID}}.txt
"""
with
open
(
'
s5cmd_array.sh
'
,
'
wt
'
)
as
f
:
f
.
write
(
array_sh
)
if
__name__
==
"
__main__
"
:
main
()
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