NordicHPC / sonar

Tool to profile usage of HPC resources by regularly probing processes using ps.
GNU General Public License v3.0
8 stars 5 forks source link

Fix #132 - don't crash if writing fails #137

Closed lars-t-hansen closed 7 months ago

bast commented 7 months ago

Thanks! I will just resolve conflicts and merge.

bast commented 7 months ago

There is this conflict:

fn print_record<W: io::Write>(
    writer: &mut Writer<W>,
    params: &PrintParameters,
    proc_info: &ProcInfo,
<<<<<<< HEAD
) -> Result<bool> {
    let gpus_comma_separated = if let Some(ref cards) = proc_info.gpu_cards {
        if cards.is_empty() {
            "none".to_string()
        } else {
            cards
                .iter()
                .map(|&num| num.to_string())
                .collect::<Vec<String>>()
                .join(",")
        }
    } else {
        "unknown".to_string()
    };
||||||| 78d9dba
) -> bool {
    let gpus_comma_separated = if let Some(ref cards) = proc_info.gpu_cards {
        if cards.is_empty() {
            "none".to_string()
        } else {
            cards
                .iter()
                .map(|&num| num.to_string())
                .collect::<Vec<String>>()
                .join(",")
        }
    } else {
        "unknown".to_string()
    };
=======
) -> bool {
    // Mandatory fields.
>>>>>>> main

I believe here we want to replace bool with Result<bool> but we also want to remove the let gpus_... call like it was done on main?

lars-t-hansen commented 7 months ago

I'll tidy it up and post a new patch.

lars-t-hansen commented 7 months ago

@bast PTAL, should be OK now.

bast commented 7 months ago

Thanks!