Discussion:
[OMPI users] Performing partial calculation on a single node in an MPI job
Vahid Askarpour
2016-10-16 22:55:04 UTC
Permalink
Hello,

I am attempting to modify a relatively large code (Quantum Espresso/EPW) and here I will try to summarize the problem in general terms.

I am using an OPENMPI-compiled fortran 90 code in which, midway through the code, say 10 points x(3,10) are broadcast across say 4 nodes. The index 3 refers to x,y,z. For each point, a number of calculations are done and an array, B(3,20,n) is generated. The integer n depends on the symmetry of the system and so varies from node to node.

When I run this code serially, I can print all the correct B values to file, so I know the algorithm works. When I run it in parallel, I get numbers that are meaningless. Collecting the points would not help because I need to collect the B values. I have tried to run that section of the code on one node by setting the processor index “mpime" equal to “ionode" or “root” using the following IF statement:

IF (mpime .eq. root ) THEN
do the calculation and print B
ENDIF

Neither ionode nor root returns the correct B array.

What would be the best way to extract the B array?

Thank you,

Vahid
George Bosilca
2016-10-17 00:44:00 UTC
Permalink
Vahid,

You cannot use Fortan's vector subscript with MPI. Are you certain that
the arrays used in your bcast are contiguous ? If not you would either need
to move the data first into a single dimension array (which will then have
the elements contiguously in memory), or define specialized datatypes to
match th memory layout of your array subscript.

George.
Post by Vahid Askarpour
Hello,
I am attempting to modify a relatively large code (Quantum Espresso/EPW)
and here I will try to summarize the problem in general terms.
I am using an OPENMPI-compiled fortran 90 code in which, midway through
the code, say 10 points x(3,10) are broadcast across say 4 nodes. The
index 3 refers to x,y,z. For each point, a number of calculations are done
and an array, B(3,20,n) is generated. The integer n depends on the symmetry
of the system and so varies from node to node.
When I run this code serially, I can print all the correct B values to
file, so I know the algorithm works. When I run it in parallel, I get
numbers that are meaningless. Collecting the points would not help because
I need to collect the B values. I have tried to run that section of the
code on one node by setting the processor index “mpime" equal to “ionode"
IF (mpime .eq. root ) THEN
do the calculation and print B
ENDIF
Neither ionode nor root returns the correct B array.
What would be the best way to extract the B array?
Thank you,
Vahid
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
Jeff Hammond
2016-10-17 18:19:37 UTC
Permalink
George:

http://mpi-forum.org/docs/mpi-3.1/mpi31-report/node422.htm

Jeff
Post by George Bosilca
Vahid,
You cannot use Fortan's vector subscript with MPI.
--
Jeff Hammond
***@gmail.com
http://jeffhammond.github.io/
George Bosilca
2016-10-18 01:23:55 UTC
Permalink
I should have been more precise: you cannot use Fortran's vector subscript
with Open MPI.

George.
Post by Jeff Hammond
http://mpi-forum.org/docs/mpi-3.1/mpi31-report/node422.htm
Jeff
Post by George Bosilca
Vahid,
You cannot use Fortan's vector subscript with MPI.
--
Jeff Hammond
http://jeffhammond.github.io/
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
Vahid Askarpour
2016-10-18 12:57:39 UTC
Permalink
Hi George and Jeff,

Thank you for taking the time to respond to my query. You did inspire me in the right direction. Some of the variables involved in the calculation of B were not broadcast. In addition,
a double do-loop combined with an IF statement was overwriting on the correct B values. Interestingly, none of the variables are declared contiguous. And I did not have to convert
B into a 1-D array. So at the end, it all worked out and I get the correct B matrix out of the code.

Thank you again,

Vahid


On Oct 17, 2016, at 10:23 PM, George Bosilca <***@icl.utk.edu<mailto:***@icl.utk.edu>> wrote:

I should have been more precise: you cannot use Fortran's vector subscript with Open MPI.

George.

On Mon, Oct 17, 2016 at 2:19 PM, Jeff Hammond <***@gmail.com<mailto:***@gmail.com>> wrote:
George:

http://mpi-forum.org/docs/mpi-3.1/mpi31-report/node422.htm

Jeff

On Sun, Oct 16, 2016 at 5:44 PM, George Bosilca <***@icl.utk.edu<mailto:***@icl.utk.edu>> wrote:
Vahid,

You cannot use Fortan's vector subscript with MPI.

--
Jeff Hammond
***@gmail.com<mailto:***@gmail.com>
http://jeffhammond.github.io/

Loading...