File: get_matrices_6.sh

package info (click to toggle)
rocsparse 6.4.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,428 kB
  • sloc: cpp: 234,069; f90: 9,307; sh: 2,262; python: 1,939; makefile: 1,585; ansic: 440; xml: 26
file content (54 lines) | stat: -rwxr-xr-x 1,509 bytes parent folder | download
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
#!/usr/bin/env bash
# Author: Nico Trost

matrices=(europe_osm
          asia_osm
          germany_osm
          road_usa
          delaunay_n24
          hugebubbles-00020
          hugebubbles-00010
          hugebubbles-00000
          adaptive
          hugetric-00010
          hugetric-00000
          M6
          333SP
          AS365
          venturiLevel3
)

url=(https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
     https://sparse.tamu.edu/MM/DIMACS10
)

for i in {0..14}; do
    m=${matrices[${i}]}
    u=${url[${i}]}
    if [ ! -f ${m}.csr ]; then
        if [ ! -f ${m}.mtx ]; then
            if [ ! -f ${m}.tar.gz ]; then
                echo "Downloading ${m}.tar.gz ..."
                wget ${u}/${m}.tar.gz
            fi
            echo "Extracting ${m}.tar.gz ..."
            tar xf ${m}.tar.gz && mv ${m}/${m}.mtx . && rm -rf ${m}.tar.gz ${m}
        fi
        echo "Converting ${m}.mtx ..."
        ./convert ${m}.mtx ${m}.csr
        rm ${m}.mtx
    fi
done