Monday January 12, 2015
This problem is an extension of a previous problem concerning an agent-based model of an ideal gas. You are challenged to write an MPI distributed version of the model given already-written serial (non-parallel) and OpenMP (parallel) versions in C.
This problem concerns the agent-based model of an ideal gas covered in a previous challenge problem (

A serial (non-parallel) version of the model in C is provided to you below in the "Parallel Ideal Gas starter zip file". This zip file contains the code, a Makefile, and a README with instructions on compiling and running the program. A similar zip file for the OpenMP parallel version is also provided to you below in the "Parallel Ideal Gas solution zip file".

Your challenge is to create an MPI version of the program. In the program, each MPI process should run a separate instance of the simulation. Each process should calculate a value for the final ratio, and the process with rank 0 should average these values and print the final result. It is recommended to use the MPI_Reduce() function to help in calculating the average.

As in the OpenMP version, to avoid cluttering the output, your program should only print the final ratio, not the ASCII pictures of each time step.
Show solution
Challenge Resources:
©1994-2022   |   Shodor   |   Privacy Policy   |   NSDL   |   XSEDE   |   Blue Waters   |   ACM SIGHPC   |   feedback  |   facebook   |   twitter   |   rss   |   youtube   |   XSEDE Code of Conduct   |   Not Logged In. Login