Skip to content

Parallel PS script fails for too large nrun (or too few structures) #8

@max-veit

Description

@max-veit

This error usually happens when I ask sagpr_parallel_get_PS to try to split a trajectory into too many parallel calculations, thereby ending up with an empty slice which throws a spanner in the works. But I have an automated workflow that sometimes spits out very short trajectories, so it would be nice if the parallel PS script could handle these cases gracefully (basically, if -nrun < len(traj), only run the first len(traj) calculations in parallel and don't try to run more).

For reference, a typical error backtrace is below:

...skipping...
IOError: [Errno 2] No such file or directory: 'cubic_tetra_transition/PS0v_seg015.npy'
Traceback (most recent call last):
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 276, in <module>
    main()
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 270, in main
    get_power_spectrum(lam,frames,nmax=nmax,lmax=lmax,rc=rcut,sg=sig,ncut=ncut,periodic=periodic,outfile=outfile,cw=cweight,subset=subset,initial=initial,sparsefile=sparsefile,sparse_options=sparse_options,cen=cen,spec=spec,atomic=atomic,all_radial=all_radial,useall=useall,xyz_slice=xyz_slice,get_imag=get_imag)
    natmax    = len(max(all_names, key=len))
ValueError: max() arg is an empty sequence
Traceback (most recent call last):
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 276, in <module>
    main()
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 270, in main
    get_power_spectrum(lam,frames,nmax=nmax,lmax=lmax,rc=rcut,sg=sig,ncut=ncut,periodic=periodic,outfile=outfile,cw=cweight,subset=subset,initial=initial,sparsefile=sparsefile,sparse_options=sparse_options,cen=cen,spec=spec,atomic=atomic,all_radial=all_radial,useall=useall,xyz_slice=xyz_slice,get_imag=get_imag)
    natmax    = len(max(all_names, key=len))
ValueError: max() arg is an empty sequence
Traceback (most recent call last):
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 276, in <module>
    main()
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 270, in main
    get_power_spectrum(lam,frames,nmax=nmax,lmax=lmax,rc=rcut,sg=sig,ncut=ncut,periodic=periodic,outfile=outfile,cw=cweight,subset=subset,initial=initial,sparsefile=sparsefile,sparse_options=sparse_options,cen=cen,spec=spec,atomic=atomic,all_radial=all_radial,useall=useall,xyz_slice=xyz_slice,get_imag=get_imag)
    natmax    = len(max(all_names, key=len))
ValueError: max() arg is an empty sequence

(this happens when using -nrun 4 on a trajectory of length 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions