c - MPI parallelization help for reading a large amount of data multiple times -


i have been asked parallelize existing c program in order decrease runtime. have (very limited) experience using basic mpi (and programming knowledge self taught, spotty). trying figure out best parallelization approach.

currently, during every iteration of main loop (m = number of iterations), program sequentially accesses set of input files (n= number of files)-each of varying length. after input files read program sorts data , updates set of output files. both n , m known @ start, , n larger m. in fact, n large read input data memory, each time files read, information pertinent main loop iteration kept.

i confident can make each main loop iteration independent, every iteration still need access n files. best way use openmpi (technically openrte 1.6.2 running on rocks- i.e. redhat linux) parallelize program?

my first idea split read-in of input files across multiple threads- each thread handling subset of files , ordering inputs @ end.

my second idea instead split main m loop across threads, better utilization of mpi. method require copies input files in every thread (to avoid reading conflicts)? if so, worried copying files may offset time gained parallelizing main loop. also, besides building test program each approach, there easier way determine method faster?

edit: file system nfs.

after reading comments went , ran few tests on code. program spends 93% of runtime reading in data. has been said seems parallelization alone may not best solution. @ point seems necessary program’s calculations , try minimize read-in requirements.

thank replies.

based on comment responses, file system being nfs mean reading files across network? can problematic if parallelize n number of files. if n large risk exceeding maximum number of open file pointers @ time, typically defined in /etc/security/limits.conf. know if shell type either csh or tcsh, if type limit @ prompt display values. sorry forget command display in bash shell. risk overloading nfs, , problems lan or wan bandwidth. if network @ 100 mbps 12 megabytes of data per second @ best. , if don't check how know not value in kilobytes per second?

if biggest cause of run time of program reading in data, there may little can it. besides nfs issue, suggest thinking in terms of how hard drive (wherever may located) commanded read each chunk/file of data. think best have 1 file pointer reading sequentially possible data disk drive, , leave how buffer data used in program. need math , figure if have enough ram. if not need increase otherwise forced rely on disk i/o killer.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -