parabuild 0.3.2

A parallel build utility for template heavy projects.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use regex::Regex;
use std::process::Command;

pub fn get_cuda_mig_device_uuids() -> Vec<String> {
    match Command::new("nvidia-smi").arg("-L").output() {
        Ok(output) => {
            let output = String::from_utf8(output.stdout).unwrap();
            let re = Regex::new(r"\(UUID: (MIG-[a-f0-9\-]+)\)").unwrap();
            let mut uuids: Vec<String> = re
                .captures_iter(&output)
                .map(|cap| cap[1].to_string())
                .collect();
            uuids.reverse();
            uuids
        }
        Err(_) => Vec::new(),
    }
}