Parallel processing using AWK program


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Parallel processing using AWK program
# 1  
Old 07-14-2008
Question Parallel processing using AWK program

Hi All,

could any expert tell me about writing a parallel processing program using AWK program is possible or not? Any example would be much appreciated...

With Regards / Mysore Ganapati Smilie
# 2  
Old 07-14-2008
Read two files in parallel:
Code:
$ head file*
==> file1 <==
file1, line1
file1, line2
file1, line3

==> file2 <==
file2, line1
file2, line2
file2, line3
$ nawk '1;(getline < "file2")' file1
file1, line1
file2, line1
file1, line2
file2, line2
file1, line3
file2, line3

# 3  
Old 07-14-2008
Lightbulb

sorry for not explaining you the question properly.

I've more than 10 input files with the size 10-15 giga bytes each. Also I've a some calculating machine (computing system) with 50 processors.
My AWK program has to read all the input files and based on some coditions it has to do some calculations and has to generate more than 100 report files. Hence I thought to utilize all the 50 processors for this computation through AWK script.
I know it is possible using perl script (using object oriented perl and by creating child processes using 'fork()' ).
So I wanted to replace perl with AWK for the above task if it is possible.
Please suggest me.

-- Mysore Ganapati
# 4  
Old 07-14-2008
standard awk/nawk/gawk has no builtin support for parallel processing or threads
# 5  
Old 07-15-2008
Lightbulb

Thanks for your clarifications.

Eventhough AWK doesn't have any support for multiprocessing, are there any possibilities/ways to implement the same using AWK programming with some unix tools? Smilie
Sorry for the twisted and repeated question. But I wanted to make sure before thinking of other programming for the above mentioned requirement.

Cheers ~~ /.. Ganapati
# 6  
Old 07-15-2008
i don't know how to write parallel processing using awk.
but most definetely u can write very powerful parallel processing programs using C programming and MPI library (message passing interface)

MPI supports multiple platforms and can be used to accomplish any task.
try google it out...else mail me at removed
i can help u on how to go about learning MPI and C programming.

Last edited by radoulov; 07-15-2008 at 07:15 AM.. Reason: please read the rules (10)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parallel processing

I have 10,000 + files, each of which I need to zip using bzip2. Is ti possible to use bash to create 8 parallel streams sending a new file to be processed from the list when one of the others has finished? (1 Reply)
Discussion started by: garethsays
1 Replies

2. Shell Programming and Scripting

Parallel processing - continued

Hi, I am taking up the cue from where I was left in my earlier post ( link given below ) https://www.unix.com/shell-programming-scripting/231107-implement-parallel-processing.html I actually wanted to know the significance of using the Unix "wait" , which returns the control from background to... (3 Replies)
Discussion started by: kumarjt
3 Replies

3. Programming

Parallel processing pthread

Need urgent help on thread: the goal here is the separtemask will take each image and separate different contours and for each contour in the image it will call handleobject thread. So every for loop will call the handeobject thread. However, object index variable needs to be passed in each... (0 Replies)
Discussion started by: temursalin
0 Replies

4. Shell Programming and Scripting

PARALLEL PROCESSING IN PERL

HI All, I have scenerio where I need to call sub modules through for loop for (i=0; i<30 ;i++) { .. .. .. subroutine 1; subroutine 2; } I want this to be run in parallel process1 { ... ... subroutine 1; subroutine 2; (0 Replies)
Discussion started by: gvk25
0 Replies

5. Programming

Parallel Processing Detection and Program Return Value Detection

Hey, for the purpose of a research project I need to know if a specific type of parallel processing is being utilized by any user-run programs. Is there a way to detect whether a program either returns a value to another program at the end of execution, or just utilizes any form of parallel... (4 Replies)
Discussion started by: azar.zorn
4 Replies

6. Shell Programming and Scripting

How to make parallel processing rather than serial processing ??

Hello everybody, I have a little problem with one of my program. I made a plugin for collectd (a stats collector for my servers) but I have a problem to make it run in parallel. My program gathers stats from logs, so it needs to run in background waiting for any new lines added in the log... (0 Replies)
Discussion started by: Samb95
0 Replies

7. Shell Programming and Scripting

parallel processing

hi i am preparing a set of batches for a set of files sequentially There is a folder /xyz where all the files reside now all the files starting with 01 - will be appended for one below other to form a batch batch01 then all the files starting with 02 - will be appended for one below other to... (7 Replies)
Discussion started by: mad_man12
7 Replies

8. Shell Programming and Scripting

Need Help With Parallel Processing

Hi I am looking for some kind of feature in unix that will help me write a script that can invoke multiple processes in parallel. And make sure that the multiple parallel processes complete successfully before I proceed to the next step. Someone suggested something called timespid or... (6 Replies)
Discussion started by: imnewtothis23
6 Replies

9. Shell Programming and Scripting

parallel processing

Hi I want to run two shell script files parallely. These two scripts are interacting with the database. can any body help on this Pls Regards Audippa naidu.M (3 Replies)
Discussion started by: audippa
3 Replies

10. UNIX for Dummies Questions & Answers

How to do parallel processing??

Hi All, I am working on solaris 8 sparc machine with 2 cpu. I am trying to run my application which generates files. I run multiple instance of the application, but the results don't seem to show as if it were runing parallely. When i run the application once it takes 12 secs to generate a... (1 Reply)
Discussion started by: zing
1 Replies
Login or Register to Ask a Question