Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8708997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:15:32+00:00 2026-06-13T04:15:32+00:00

I am teaching myself MPI. I am reading Python documentation on reduce and scan:

  • 0

I am teaching myself MPI. I am reading Python documentation on reduce and scan:
http://documen.tician.de/boostmpi/reference.html#boostmpi.scan

Both reduce and scan seem to take some function (op) and use it to reduce values obtained from individual processes into a single value.

How do reduce and scan differ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:15:34+00:00Added an answer on June 13, 2026 at 4:15 am

    A reduction means all processors get the same value while scan returns the partial operation results on each processor. For instance, if you had 10 processors and you were taking the sum of their rank, MPI_Reduce would give you the scalar 45 (0+1+2+3+4+5+6+7+8+9) on the root process only while MPI_scan would give you the scalar of the reduction up to the rank of the processor on each processor. So processor 0 would get 0, processor 1 would get 1, processor 2 would get 3, and so on. Processor 9 would get 45.

    In other words, if you were to make a list of all processors values found from MPI_Scan it would be:

    [0, 1, 3, 6, 10, 15, 21, 28, 36, 45]
    

    with the scan result coming from [0, 0+1, 0+1+2, 0+1+2+3, ..., 0+1+2+3+4+5+6+7+8+9]

    In Python, the list of results from MPI_Reduce would be (assuming processor 0 is the root):

    [45, None, None, None, None, None, None, None, None, None]
    

    while other languages the recvbuf would have undefined data in it on all processors other than the root.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm teaching myself Python 3.2 and I'm trying to make a program to match
I am teaching myself python. I was thinking of small programs, and came up
I am teaching myself some Python and I have come across a problem which
Still teaching myself python so please don't hate me if my code is terrible...
I've been teaching myself python recently an came across and example where str.endswith took
Im teaching myself using Zed Shaw's Learn Python The Hard Way, and I'm having
I'm teaching myself CSS and HTML, and I've come across something that seems like
I am teaching myself python from this site . On Chapter 3 , when
I am self teaching myself some python OOP, and I have created a simple
I'm teaching myself Python and my most recent lesson was that Python is not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.