Fortran

Guide To Learn

Advanced Fortran use

Telling images what to do

So far, we’ve used this_image and num_images to instruct each image to tell us who it is and how many total images there are. This is useful information, but we still haven’t done anything with it yet. How can we use this information to split the weather buoy data between images? Recall from listing 7.1 that we define the list of […]

Getting information about the images

To tell the images what to work on, we first need to know more about the images themselves, specifically how many there are and who they are. Fortran provides the functions this_image and num_images to do exactly this. Here’s how we write the image number and total number of images to screen: Let’s store this into a file, hello_images.f 90, compile […]

Fortran images

When writing a parallel Fortran program, you don’t have to worry about whether you’re writing a multithreaded concurrent application that’s meant to run on a single core, a shared-memory multicore application, or a distributed memory application. The code that you write is independent of the underlying architecture. Fortran introduces the concept of image, which identifies parallel […]

Parallel processing with images and coarrays

What is the smallest change required to convert Fortran into a robust and efficient parallel language? Our answer is a simple syntactic extension. It looks and feels like Fortran and requires Fortran programmers to learn only a few new rules.  –John Reid, Coarrays in the next Fortran Standard You need to grasp two concepts to […]

Serial implementation of the program

Before we devise our parallelization strategy, let’s first go over the serial program, as shown in the following listing, so we understand how each step works. Listing 7.1 Serial implementation of the weather buoy processing program ❶ Helper functions for working with arrays ❷ Subroutine to read the buoy CSV data ❸ Dynamic arrays for timestamps and wind […]

Getting the data and code

The complete source code for the weather buoy exercise is available on GitHub at https://github.com/modern-fortran/weather-buoys. If you use git, clone it directly from the command line: Otherwise, you can download it as a zip file from http://mng.bz/aRVo. The CSV data files are located in the weather-buoys/data directory. I encourage you to explore the data files from your […]

Processing real-world weather buoy data

For a gentle entry into parallel programming, we’ll process and analyze a real-world weather buoy dataset. This is a miniature example of the big data challenge: how to process a large amount of data that may be too big to fit into memory, or may take too long to process sequentially. The crux of the […]

Scroll to top