From owner-chemistry@ccl.net Mon Jul 9 18:30:00 2012 From: "David Hall drhall[*]bu.edu" To: CCL Subject: CCL: Question Message-Id: <-47192-120709173118-10257-xbItW1+VDHdwJx0tg2R2Lg()server.ccl.net> X-Original-From: David Hall Content-Type: multipart/alternative; boundary=bcaec501c5c004a08104c46c5382 Date: Mon, 9 Jul 2012 17:29:55 -0400 MIME-Version: 1.0 Sent to CCL by: David Hall [drhall ~~ bu.edu] --bcaec501c5c004a08104c46c5382 Content-Type: text/plain; charset=ISO-8859-1 My favorite solution to this is to use gnu parallel https://savannah.gnu.org/projects/parallel/ parallel wrote: > > Sent to CCL by: John McKelvey [jmmckel{=}gmail.com] > Hello... > > I'm trying to get 4 processes to run simultaneously on a 4 processor > box and wait until they are all finished before proceeding. Don't > have "fork" , "wait" or "sleep" available in free ftn compiler... > > I think I can do a "call system(cmd1&cmd2&cmd3&cmd4)" to get the 4 > processes running at the same time, but I then need to wait till all 4 > are finished before proceeding to the next step. I could do a "grep > *.out > wclist" and check the value of wclist in an "infinite loop" > until satisfied, i.e. wclist=4, but would this eat a lot of cycles? > > Would be happy to check out forums for this... > > > Many thanks.. > > John > > > > -- > John McKelvey > 10819 Middleford Pl > Ft Wayne, IN 46818 > 260-489-2160 > jmmckel ~ gmail.com> > > --bcaec501c5c004a08104c46c5382 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable My favorite solution to this is to use gnu parallel

https= ://savannah.gnu.org/projects/parallel/

paralle= l <cmds.sh

will execute the commands in the file in parallel.

Assuming the commands are similar, you can see the man= page for ways to execute this without creating a file of commands

-David


On Mo= n, Jul 9, 2012 at 9:51 AM, John McKelvey jmmckel:+:gmail.com <owner-chemistry+/-ccl.net>= ; wrote:

Sent to CCL by: John McKelvey [jmmckel{=3D}gmail.com]
Hello...

I'm trying to get 4 processes to run simultaneously on a 4 processor box and wait until they are all finished before proceeding. =A0Don't have "fork" , "wait" or "sleep" available in = free ftn compiler...

I think I can do a "call system(cmd1&cmd2&cmd3&cmd4)"= to get the 4
processes running at the same time, but I then need to wait till all 4
are finished before proceeding to the next step. =A0I could do a "grep=
*.out > wclist" and check the value of wclist in an "infinite = loop"
until satisfied, i.e. wclist=3D4, but would this eat a lot of cycles?

Would be happy to check out forums for this...


Many thanks..

John



--
John McKelvey
10819 Middleford Pl
Ft Wayne, IN 46818
260-4= 89-2160
jmmckel ~ gmail.com



-=3D This is automatically added to each message by the mailing script =3D-=
E-mail to subscribers: CHEMISTRY+/-ccl.net or use:
=A0 =A0 =A0 http://www.ccl.net/cgi-bin/ccl/send_ccl_message

E-mail to administrators: CHEMISTRY-REQUEST+/-ccl.net or use
=A0 =A0 =A0 http://www.ccl.net/cgi-bin/ccl/send_ccl_message

Subscribe/Unsubscribe:
=A0 =A0 =A0 http://www.ccl.net/chemistry/sub_unsub.shtml

Before posting, check wait time at: http://www.ccl.net

Job: http://www.ccl.n= et/jobs
Conferences: http://server.ccl.net/chemistry/announcements/co= nferences/

Search Messages: http://www.ccl.net/chemistry/searchccl/index.shtml
=A0 =A0 =A0
h= ttp://www.ccl.net/spammers.txt

RTFI: http://www.ccl.net/chemistry/aboutccl/instructions/



--bcaec501c5c004a08104c46c5382--