Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiprocessing on spectral function errors while reordening the files #79

Open
mesonepigreco opened this issue Oct 10, 2023 · 3 comments

Comments

@mesonepigreco
Copy link
Collaborator

Hi Diego @diegomartinez2 , While trying to run the dynamical spectral function with multiprocessing I got the following error:

Master branch, revision: v1.3-112-g9e126fc

The code call that failed:

CC.Spectral.get_full_dynamic_correction_along_path_multiprocessing(dyn=dyn, 
                                           tensor3=tensor3, 
                                           k_grid=NEW_GRID,  
                                           e1=1450, de=0.5, e0=0,
                                           sm1=5, sm0=5,nsm=1, sm1_id=0.1, sm0_id=0.1,
                                           T=TEMPERATURE,
                                           q_path=q_path,                                           
                                           notransl = True,
                                           filename_sp='full_spectral_func')

 Results printed in full_spectral_func_[smear].dat
 
Traceback (most recent call last):
  File "/home/monacell/MEGA/Research/Simulations/Perovskites/CaSiO3/spectral_function/spectral_8.py", line 41, in <module>
    CC.Spectral.get_full_dynamic_correction_along_path_multiprocessing(dyn=dyn, 
  File "/home/monacell/anaconda3/lib/python3.9/site-packages/cellconstructor/Spectral.py", line 1340, in get_full_dynamic_correction_along_path_multiprocessing
    output_file_sort_function(filename_sp, smear_id_cm, smear_cm, nsm)
  File "/home/monacell/anaconda3/lib/python3.9/site-packages/cellconstructor/Spectral.py", line 1171, in output_file_sort_function
    f = open(filename_data, 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'full_spectral_func_0.10_5.0.dat'

The name of the file generated is:

full_spectral_func_5.0.dat

I believe it should be a trivial mistake of naming files in the reordering process, can you fix it?

@mesonepigreco
Copy link
Collaborator Author

Also there is a bug in the calculation with multiprocessing: some of the q points are printed overlapped, and after the reordering there is a lower number of q points in the path (they are jumped at the beginning).

@diegomartinez2
Copy link
Contributor

Yes, the output file naming was easy to solve.

@diegomartinez2
Copy link
Contributor

For the reordering problem maybe will be better to use "numpy.lexsort" instead of "argsort".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants