Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
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
{{ message }}
mariux64
/
mxq
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
3
Code
Issues
20
Pull requests
3
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
b9c23b4
helper
create_job_tmpdir
gpu-setup
tmpdir-setup
manpages
mysql
web
.gitignore
.vimrc
Doxyfile
LICENSE
Makefile
README.md
keywordset.c
keywordset.h
mx_flock.c
mx_flock.h
mx_getopt.c
mx_getopt.h
mx_log.c
mx_log.h
mx_mysql.c
mx_mysql.h
mx_proc.c
mx_proc.h
mx_util.c
mx_util.h
mxq.h
mxq_daemon.c
mxq_daemon.h
mxq_group.c
mxq_group.h
mxq_job.c
mxq_job.h
mxq_log.c
mxq_reaper.c
mxqadmin.c
mxqd.c
mxqd.h
mxqd_control.c
mxqd_control.h
mxqdctl-hostconfig.sh
mxqdump.c
mxqkill.c
mxqps.c
mxqset.c
mxqsub.c
os-release
parser.y
ppidcache.c
ppidcache.h
test_keywordset.c
test_mx_log.c
test_mx_mysql.c
test_mx_util.c
test_mxqd_control.c
test_parser.c
xmalloc.h
Breadcrumbs
mxq
/
helper
/
tmpdir-setup
Blame
Blame
Latest commit
donald
tmpdir-setup: Make umount faster
May 10, 2022
9640f65
·
May 10, 2022
History
History
executable file
·
76 lines (66 loc) · 1.66 KB
Breadcrumbs
mxq
/
helper
/
tmpdir-setup
Top
File metadata and controls
Code
Blame
executable file
·
76 lines (66 loc) · 1.66 KB
Raw
#! /usr/bin/bash usage() { cat <<EOF >&2 usage: $0 create JOBID SIZE UID # create SIZE GiB /dev/shm/mxqd/mnt/job/$JOBID $0 cleanup JOBID # cleanup EOF exit 1 } tmpdir=/scratch/local2/mxqd/tmp mntdir=/dev/shm/mxqd/mnt/job cmd_create() { (( $# == 3 )) || usage MXQ_JOBID=$1 MXQ_SIZE=$2 MXQ_UID=$3 filename=$tmpdir/$MXQ_JOBID.tmp mountpoint=$mntdir/$MXQ_JOBID umask 006 mkdir -p $tmpdir mkdir -p $mntdir status=1; if fallocate -l ${MXQ_SIZE}G $filename; then if loopdevice=$(losetup --find --show $filename); then if mkfs.ext4 \ -q \ -m 0 \ -E nodiscard,mmp_update_interval=300,lazy_journal_init=1,root_owner=$MXQ_UID:0 \ -O '64bit,ext_attr,filetype,^has_journal,huge_file,inline_data,^mmp,^quota,sparse_super2' \ $loopdevice \ && mkdir -p $mountpoint && mount -Odata=writeback,barrier=0 $loopdevice $mountpoint; then rmdir $mountpoint/lost+found status=0 fi losetup -d $loopdevice fi rm $filename else test -e $filename && rm $filename fi exit $status } cmd_cleanup() { (( $# == 1 )) || usage MXQ_JOBID=$1 ( shopt -s dotglob; rm -rf /dev/shm/mxqd/mnt/job/$MXQ_JOBID/* umount /dev/shm/mxqd/mnt/job/$MXQ_JOBID rmdir /dev/shm/mxqd/mnt/job/$MXQ_JOBID ) & } (( $# > 0 )) || usage cmd="$1" shift; case "$cmd" in create) cmd_create "$@" ;; cleanup) cmd_cleanup "$@" ;; *) usage ;; esac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
You can’t perform that action at this time.