Révision 234eefed modules/calculation.py

b/modules/calculation.py
40 40
                        unfinished_calcs.append(conf)
41 41
                    else:
42 42
                        finished_calcs.append(conf)
43
        elif code == 'vasp':
44
            out_file_list = glob(f"{run_type}/{conf}/OUTCAR")
45
            if len(out_file_list) == 0:
46
                unfinished_calcs.append(conf)
47
            elif len(out_file_list) > 1:
48
                warn_msg = f'There is more than one file matching the {code} ' \
49
                           f'pattern for finished calculation (*.out / ' \
50
                           f'*-1.restart) in {run_type}/{conf}: ' \
51
                           f'{out_file_list}. Skipping directory.'
52
                logger.warning(warn_msg)
53
                unfinished_calcs.append(conf)
54
            else:
55
                with open(f"{run_type}/{conf}/OUTCAR", 'rb') as out_fh:
56
                    if "General timing and accounting" not in tail(out_fh):
57
                        unfinished_calcs.append(conf)
58
                    else:
59
                        finished_calcs.append(conf)
60
        else:
61
            err_msg = f"Check not implemented for '{code}'."
62
            logger.error(err_msg)
63
            raise NotImplementedError(err_msg)
43 64
    return finished_calcs, unfinished_calcs
44 65

  
45 66

  

Formats disponibles : Unified diff