Dear Users,
I have attached the following files:
-
fix_Ktest.cpp/.h : A test fix that does nothing but call a dummy function. It has a compute_scalar that calls MPI_Allreduce to sum a double variable across processors that would be available for output using the thermo command
-
in.Ktest: A test input file that calls the test fix and outputs value of compute_scalar as the last column in the thermo output (f_Test)
-
Data.Ktest: The test data file invoked by the previous test file
The compute_scalar() function of the fix should return a value of ‘4 * nprocs’. However, this only works for 1 proc. If I use this fix for more than one procs, the value returned by compute_scalar() is zero.
Please note that I have very minimal knowledge of MPI, so I may have missed something very basic. It’s probably a silly bug, your patience and help would be appreciated.
Thanks,
Ketan
Background: I have a more complex fix that is showing the same problem, however, I have removed all the lines of the code that are irrelevant to the bug under consideration.
fix_Ktest.cpp (2.54 KB)
fix_Ktest.h (1.85 KB)
Data.Ktest (607 KB)
in.KTest (761 Bytes)