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

[feat] enable MPI for maxent_gf_imp #55

Merged
merged 2 commits into from
Aug 11, 2023
Merged

Conversation

the-hampel
Copy link
Member

I enabled MPI for the impurity Gf maxent routine. @merkelm could you check if this makes sense to you? I successfully checked the results for correctness with the integrated test, but also with other DMFT results.

@the-hampel the-hampel requested a review from merkelm August 7, 2023 17:47
@merkelm
Copy link
Collaborator

merkelm commented Aug 9, 2023

@the-hampel, thanks for the commit. If I remember correctly, the reason why I did not implement this functionality is because it becomes a bit complicated when there are blocks of different sizes. Do the changes work for blocks that are not 1x1 and if there are different blocks of different sizes in the Green function?

@the-hampel
Copy link
Member Author

So I tried this now for a five orbital Gf with one block 3x3 and one block 2x2:

block struct. : {'up_0': [0, 1, 2], 'up_1': [0, 1], 'down_1': [0, 1], 'down_0': [0, 1, 2]}

The output with the old and new version looks the same (apart from the suppressed output from maxent):

Starting run with 12 MPI rank(s) at : 2023-08-09 14:57:01.245297
Continuing impurities with blocks: 
- Imp 0: ['total_0', 'total_1']
--------------------------------------------------

Rank 0: solving impurity 1 block 'total_0'

Rank 1: solving impurity 1 block 'total_1'
appending
appending
appending
appending
Optimal alphas , Imp 1 block 'total_1': 
--- Real part ---
 [[10  4]
 [-1 10]]
(a -1 indicates that maxent did not run for this block due to symmetry)
appending
Optimal alphas , Imp 1 block 'total_0': 
--- Real part ---
 [[14 12  8]
 [-1 14  6]
 [-1 -1 10]]
(a -1 indicates that maxent did not run for this block due to symmetry)
--------------------------------------------------------------------------------
DONE
Total run time: 17 s.

I plotted the resulting spectral function and they seem reasonable to me (very crude accuracy) for the system:
image
. The only thing I observed is that the orbital i<j are filled with nan. But I believe that was the case before as well. Do you remember what the problem back then was? Right now it seems to work as it should.

Copy link
Collaborator

@merkelm merkelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, the results seems reasonable. Thanks for testing it! I'd have one small suggestion but otherwise, the commit looks good.

imps_blocks_indices = np.arange(len(imps_blocks))

# Initialize collective results
data_linefit = [np.zeros(n_points_maxent)] * len(imps_blocks)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what confused me with the block size. Does it still work when you change the initialization to [0] * len(imps_blocks)? Because you anyway overwrite it later, I think it would be more robust to use an immutable type here, especially with the shallow copying of the list entry.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now used

 data_linefit = [0] * len(imps_blocks)     
 data_chi2 =  [0] * len(imps_blocks)       

which also works just fine for the init and the mpi gathering of data. Is that what you had in mind? The test were running just fine with that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly, looks perfect. Thanks a lot for implementing this!

@the-hampel the-hampel merged commit ccae541 into unstable Aug 11, 2023
1 check passed
@the-hampel the-hampel deleted the dev_gf_imp_maxent_mpi branch May 24, 2024 15:36
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

Successfully merging this pull request may close these issues.

2 participants