header photo


Yale Astronomy

Interactive Data Language (IDL)

IDL Resources >> Helpful Tips

IDL Functions for Job-Splitting over Multiple Processes/CPUs

With the new multi-CPU Apples in the lab, and lots of data to process, I wrote some IDL functions to aid in splitting data over multiple CPUs.

These functions are designed to help in the following scenario. You have an array of data to process with some program (i.e. an array of observations that you want to run doppler analysis on). So you open multiple Xterm windows (one window for each CPU on each machine), and in each window you want to run your program on just a particular range of the array. In this way the entire array of data will get processed in a fraction of the time. These functions are designed to be dropped into your code to help with this.

The function mp_get_procnum.pro will return a different process number to each process that calls it (provided that the calls are made at least a second apart).

The function mp_get_entries_to_process.pro takes this process number, and the size of the array to break up, and returns a range of the array which the specific process should work on.


Return to IDL Resources >> Helpful Tips