Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:services:application_services:high_performance_computing:mpi4py [2019/09/20 10:19]
vend [reduce_scatter] moved to https://projects.gwdg.de/projects/parallelrechnerbeschaffung-2012-13/wiki/outdated
en:services:application_services:high_performance_computing:mpi4py [2019/09/20 10:20] (current)
vend [Code Examples] moved to https://projects.gwdg.de/projects/parallelrechnerbeschaffung-2012-13/wiki/outdated
Line 22: Line 22:
  
  
-===  Reduction with MINLOC and MAXLOC ​ === 
  
-The reduction operations MINLOC and MAXLOC differ from all others: they return two results, the minimum resp. maximum of the values in the different tasks and the rank of a task, which holds the extreme value. mpi4py ​ provides the two operations only for the lower case ''​reduce''​ and ''​allreduce''​ mehods for comparing a single ​ numerical data object in every task. An example is given in 
  
-**reduce_minloc.py:​**  ​ 
-<​code>​ 
-inp = numpy.random.rand(size) 
-senddata = inp[rank] 
-recvdata=comm.reduce(senddata,​None,​root=0,​op=MPI.MINLOC) 
-print 'on task',​rank,'​reduce: ​   ',​senddata,​recvdata ​ 
- 
-recvdata=comm.allreduce(senddata,​None,​op=MPI.MINLOC) 
-print 'on task',​rank,'​allreduce:​ ',​senddata,​recvdata</​code>​ 
-\\ 
-=====  Code Examples ​ ===== 
- 
-The python codes for all examples described in this tutorial are available from [[http://​wwwuser.gwdg.de/​~ohaan/​mpi4py_examples/​]] 
- 
-[[Kategorie:​ Scientific Computing]]