Multiwfn forum

Multiwfn official website: //www.umsyar.com/multiwfn. Multiwfn forum in Chinese: http://bbs.keinsci.com/wfn

You are not logged in.

#1 Multiwfn and wavefunction analysis » Patch: omp collapse(2) in grid.f90 » 2022-12-15 13:31:45

i.s.ger
Replies: 2

Dear Tian,

As I mentioned on //www.umsyar.com/wfnbbs/viewtopic.php?id=732 topic, I found a way to have a speed-up.

Here, the patch is presented. The patch is affected for machines with a large number of threads. Probably, a similar patch can be applied through the whole code.

Multiwfn_collapse.patch.txt

The effect of the patch I tested on 704atoms.wfn. Here, the speed-ups are presented for a different number of cores. The black line means ideal scale. After the patch, the ideal scale is up to 26 cores, while before only up to 19 (?).

collapse.png

Probably, for better scalability, I need a larger system (or a slower computer) since even for code without collapse, near 32 cores, time became about 5 seconds, and for `collapse(2)`, time became about 3 seconds for 32 cores.

Best regards,
Igor

#2 Re: Multiwfn and wavefunction analysis » Patch: Merge orbderv into one routine » 2022-12-15 12:42:52

Dear Tian,

Thank you for providing this file!
I got close timing to yours on my hardware.

Unfortunately, I did not find any way to speed up my patch. Moreover, I got terrific timings for GCC builds with my patch: about 70-80 seconds. However, I found a way to speed up calculations with `!$omp collapse(2)`. I will provide a patch on another topic smile

Best regards,
Igor

#3 Re: Multiwfn and wavefunction analysis » Patch: Merge orbderv into one routine » 2022-11-12 17:54:03

Dear Tian,

It seems to me that I have found a problem...
There is a new patch, in which I did not notice performance degradation with Intel Compiler.

0001-Merge-orbderv-routines.patch.txt

Command line for testing:

time echo "1000 10 10 6 32 3,0,0 2 2 32 0,3,0 2 2 32 0,0,3 2 3 0 -1 100 4 1" | tr " " "\n" | OMP_STACKSIZE=200M ./Multiwfn_noGUI H2O.wfn

I set 10 cores (mine PC has Intel(R) Core(TM) i9-10940X CPU @ 3.30GHz), multiplied H2O molecule(H2O.wfn.txt), calculated at HF/def2TZVP level of theory by X and Y axes twice, and by Z axe --- thrice. Then, I integrate electron density. I used 75.434 grid for integration; Number of unique GTFs: 2412.

Timings:
old:

real    0m20.536s
user    3m24.962s
sys     0m0.301s

new:

real    0m20.570s
user    3m25.301s
sys     0m0.280s

I suppose, the difference in timings comings from a different load of the computer between runs.

I also checked my patch with GCC. Unfortunately, the compilation failed. Below, the patch, that fixes this issue, is. Hope, the patch is correct.

0002-Fix-GCC-build.patch.txt

Best,
Igor

#4 Re: Multiwfn and wavefunction analysis » Patch: Feature: fractional calculus » 2022-11-12 02:40:23

Dear Tian,

Thank you so much!

It works nice!

Best regards,
Igor

#5 Re: Multiwfn and wavefunction analysis » Patch: Feature: fractional calculus » 2022-11-07 18:12:13

Dear Tian,

Thank you so much! And thank you for `ext` directory!

> The 2F2 part of code will not be compiled for Windows version to avoid introducing dependency of C++ compiler, therefore preprocessor directives have been employed for two lines related to 2F2 in Multiwfn.f90.

In the patch below, I dropped these #ifdef's and introduced ext/no2F2.f90 which has the save behavior like ext/no2F2.c. I hope it will reduce the number of #ifdef lines.
But the main part of the patch is related to the implementation of feature evaluation, which I inserted into function.f90. I chose iUserFunc 1303 (the same number now is for setting up fractional calculus in hidden Option 1000)

0001-Implement-evaluation-of-xi-alpha.patch.txt

Best regards,
Igor

#6 Re: Multiwfn and wavefunction analysis » Patch: Merge orbderv into one routine » 2022-11-07 16:52:17

Dear Tian,

Thank you for letting me know!

I will try to profile my patch for getting a similar performance.

Best regards,
Igor

#7 Re: Multiwfn and wavefunction analysis » Patch: Feature: fractional calculus » 2022-10-30 04:23:27

Dear Lian,

We almost finished the paper about the new feature based on fractional calculus. Hope, we will submit it soon.

Briefly, I found a way how to apply fractional calculus to the electron density for constructing new ingredients of DFT functionals. In fractional calculus, there are several ways how to compute derivatives with different kernels. And, I want to implement one of these derivatives in the mainline of Multiwfn as a reference implementation.

Best,
Igor

#8 Multiwfn and wavefunction analysis » Patch: Feature: fractional calculus » 2022-10-29 08:10:09

i.s.ger
Replies: 7

Dear Tian Lu,

There is a patch for computing 2F2([a,b]; [c,d]; z) (generalized hypergeometric function) which is necessary for computing kernel of new derivatives.

Currently, it only setups internal parameters via 1000-26. Later, I will prepare a patch for computing new derivatives.

0001-Implement-all-things-for-fractional-calculus.patch.txt

Which iuserfunc can I use for new derivatives? I would prefer to have the same number for 1000-X menu and X iuserfunc, but 26 is busy.

Best regards,
Igor

#9 Multiwfn and wavefunction analysis » Patch: Merge orbderv into one routine » 2022-10-29 05:17:34

i.s.ger
Replies: 7

Dear Tian Lu,

I'm working with new kernels of derivatives. I have implemented these kernels to an old version of Multiwfn via modification of orbderv routine. Unfortunately, in the novel versions of Multiwfn, several orbderv (standard, for PBC, for Promolecular density) routines are. Below, the patch, which merged orbderv, orbderv_PBC, and orbderv_pmol into one orbderv routine, is. I tested it with the integration of the electron density of the Xe atom and it works, but I did not test other branches.

Internally, I used pointers to provide necessary arrays of primtype and coefficients without multiplying code for each unique variable.

The patch:
0001-Merge-orbderv-to-one-routine.patch.txt

How my function.f90 looks (note, (1) I applied dos2unix to function.f90, (2) define.f90 was also changed):
function.f90.txt

Best regards,
Igor

#10 Re: Multiwfn and wavefunction analysis » Build GUI version under Windows » 2022-05-16 10:01:07

Dear Tian Lu,

Thank you so much! I will have a look.

Best regards,
Igor

#11 Re: Multiwfn and wavefunction analysis » Build MultiWFN with CMake; work with dependencies » 2022-05-16 09:00:03

Dear Tian Lu,

Looks like `module function` is continuing to be... So, the parallel compilation of Multiwfn using CMake is broken...

Anyway, there is a patch that makes Multiwfn's compiling possible using CMake >=3.16 under Linux.
0001-Add-compilation-via-CMake.patch.txt

Tested compilers:
- gfortran 9.3.0
- ifort 2021
- ifx 2022

Tested version of CMake:
- 3.16
- 3.22

I used Ubuntu for testing.

I will introduce the support of Windows and MacOS later. Later, I will also update compilation methods, since currently, there is only a very short description about build customizing.

Best regards,
Igor

#12 Re: Multiwfn and wavefunction analysis » Use OpenMP standard instead of Intel extension » 2022-05-16 08:35:35

Dear Tian Lu,

There is a new patch, which keeps current behavior under Windows when Multiwfn is compiled using ifort. In the case if someone uses a non-Intel compiler, the Windows version will be the same as Linux. It is actual for building Multiwfn using gfortran under Linux. 0001-OpenMP-and-MKL-initialization.patch.txt

I also wrapped MKL calls in #ifdef for making possible usage of other BLAS/LAPACK implementations. Makefile is changed for its correct compilation.

Best regards,
Igor

#13 Multiwfn and wavefunction analysis » Build GUI version under Windows » 2022-05-16 05:27:15

i.s.ger
Replies: 3

Dear Tian Lu,

How can I build Windows GUI version? Should I just link MultiWFN with https://www.dislin.de/downloads/win64/dl_11_ic.zip?

Best regards,
Igor

#14 Re: Multiwfn and wavefunction analysis » Build MultiWFN with CMake; work with dependencies » 2022-05-16 02:30:53

Dear Tian Lu,

I found a very annoying bug in CMake's module dependency resolver that requires renaming module `function` to module `functions`. Mostly, it can be done via the following sed-script:

sed "s/^use function\b/use functions/" *.f90 -i

Could you please apply it to the Multiwfn source code?

Best regards,
Igor

#15 Re: Multiwfn and wavefunction analysis » make noGUI » 2022-05-16 01:56:29

Dear Tian Lu,

Thank you so much!

I think now old noGUI-related files can be just dropped.

BTW, could you please rename COMPLIATION_METHOD.txt to COMPILATION_METHOD.txt?

Best regards,
Igor

#16 Re: Multiwfn and wavefunction analysis » make noGUI » 2022-05-15 01:07:03

Dear Tian Lu,

I checked the applicability of the patch to the current version of Multiwfn. I used command

patch < 0001-make-noGUI-target.patch

for applying the patch under Linux. Most of the changes are done successfully, except moving of `dislin_d-11.0.a` to `GUI/dislin_d-11.0.a` and, unfortunately, it creates `dislin_d_empty.F90` in the main source directory, not in `noGUI/dislin_d_empty.F90`, as I expected, so, the moving of this file is also required.

Best regards,
Igor

#17 Re: Multiwfn and wavefunction analysis » make noGUI » 2022-05-13 16:02:37

By the way, on the top of this patch, I wrote the CMake build system, so, module-dependency is solved automatically :-) Also, it works fine for Windows (at least, with noGUI version).

Best regards,
Igor

#18 Re: Multiwfn and wavefunction analysis » make noGUI » 2022-05-13 15:52:48

Dear Tian Lu,

What is the problem with new file dependency? It is active only for noGUI version.

Usually, I'm developing noGUI version, so, for me, it would be extremely greater if I won't be needed to have a preprocessing script. That was the idea of the patch.

Best regards,
Igor

#19 Re: Multiwfn and wavefunction analysis » Update inquire statements » 2022-05-13 15:49:07

Dear Tian Lu,

Thank you! Your workaround works with gfortran.

Best regards,
Igor

#20 Re: Multiwfn and wavefunction analysis » Defensive compilation of O1.f90 » 2022-05-13 07:54:12

Dear Tian Lu,

I found the problem that tmpval is over-optimized. Here, these is a patch that fixes this problem: 0001-Remove-defensive-compilation.patch.txt

Sorry for my a little explicit code-style :-)
I OMP-parallelized the problem cycle and the problem is gone away :-)

Best regards,
Igor

#21 Re: Multiwfn and wavefunction analysis » make noGUI » 2022-05-12 19:02:39

Dear Tian Lu,

Will you incorporate this patch into the official source code of Multiwfn?

Best regards,
Igor

#22 Multiwfn and wavefunction analysis » Defensive compilation of O1.f90 » 2022-05-12 04:04:30

i.s.ger
Replies: 3

Dear Tian Lu,

As I can see, O1.f90 has defensive compilation due to a possible compiler bug. How can I repeat your observation of zero or NaN?

Best regards,
Igor

#23 Re: Multiwfn and wavefunction analysis » Compilation with gfortran » 2022-05-12 03:04:12

Dear Tian Lu,

There is a new patch for fixing compilation issues for gfortran:0001-Fix-compilation-issues-for-gfortran.patch.txt

With fixing inquire statement issues and applying an OpenMP-related patch, there is no problem building Multiwfn using gfortran.

Best regards,
Igor

#24 Re: Multiwfn and wavefunction analysis » Update inquire statements » 2022-05-12 02:18:14

Dear Tian Lu,

I added this module to this patch. After applying the patch, that module should be created (automatically)... That is my question, since I do not see your code after applying the patch, I also do not know how you apply it.

Best regards,
Igor

#25 Re: Multiwfn and wavefunction analysis » Update inquire statements » 2022-05-11 08:53:11

Dear Tian Lu,

That is strange... Do you see fileIO module at the end of fileIO.f90?

Best regards,
Igor

#26 Re: Multiwfn and wavefunction analysis » Update inquire statements » 2022-05-11 05:56:40

Dear Tian Lu,

That is interesting since I'm working on top of this patch...

Could you please add `use fileIO, only: inquire` in routines where this problem appears? It will fix this issue.

Best regards,
Igor

#27 Multiwfn and wavefunction analysis » Use OpenMP standard instead of Intel extension » 2022-05-10 13:59:39

i.s.ger
Replies: 3

Dear Tian Lu,

I checked KMP_* calls and noticed that is an extension of OpenMP which currently has its own similar parameter that makes KMP_* calls useless. In the patch (0001-Use-OpenMP-standard-instead-on-Intel-extension.patch.txt), I replaced all calls of KMP_ with simple checking of the OMP_STACKSIZE environment variable. Note, that before the patch, MultiWFN checked KMP_STACKSIZE environmental variable under Linux/MacOS (so, the changes are related only to env.variable) and in the case of Windows, MultiWFN calls the KMP_SET_STACKSIZE_S routine. Unfortunately, according to the OpenMP standard, there is no equivalent of the KMP_SET_STACKSIZE_S routine, so only the reading of env.variable is the way to set up OMP_STACKSIZE under Windows/Linux/MacOS.

Updating of manual should not be difficult for Linux; for Windows, it requires repeating Linux part with some minor changes.

How to setup OMP_STACKSIZE under Windows:

PowerShell: $env:OMP_STACKSIZE = "100M"
CMD: set OMP_STACKSIZE=100M

It works both for gfortran and ifort (I checked it with a small program).

Best regards,
Igor

#28 Multiwfn and wavefunction analysis » Update inquire statements » 2022-05-10 08:42:03

i.s.ger
Replies: 8

Dear Tian Lu,

For increasing the portability of MultiWFN, I updated inquire statements since inquire(directory=) is an extension of Intel Fortran compiler.
Here, is the patch for it: 0001-Inquire-directory-for-gFortran.patch.txt

This patch decreases necessary changes for compiling MultiWFN using gfortran. I did not implement all features of inquire statements; only these which are used in MultiWFN source code.

Best regards,
Igor

#29 Multiwfn and wavefunction analysis » make noGUI » 2022-05-10 05:51:26

i.s.ger
Replies: 10

Dear Tian Lu,

I want to have a simple building system for Multiwfn, so I created the following patch:
0001-make-noGUI-target.patch.txt

It adds two targets:
1. `make GUI` which creates Multiwfn with GUI
2. `make noGUI` which creates Multiwfn_noGUI without GUI

Simple running of `make` creates both executables.

I created a dummy implementation of DISLIN library in noGUI/dislin_d_empty.F90. It has an additional routine doesnotexist which can show the calling of DISLIN routines if this file is compiled with -DDEBUG flag. This allows me to not process each source file for removing GUI-related lines of code.

Best regards,
Igor

#30 Re: Multiwfn and wavefunction analysis » Implementation of incompete Gamma function » 2022-03-18 01:54:14

Dear Tian Lu,

Thank you for letting me to know that! "subroutine incompletegamma(m, t0, f)" is what I need.

two-electron integrals will be fully available in Multiwfn.

Is it time for density analyses during the SCF procedure? big_smile

Best regards,
Igor

Board footer

Powered by FluxBB

Baidu
map