Programming :: Running Many Tasks In Parallel / But More Clever Than 'make -j'?
Apr 29, 2011
I have a script which basically does many tasks and most of them can run in parallel. The server it runs on has 4 cores, so I changed parts of it to a makefile, and then run them with "make -j 4" which helps a lot. But looking at "top" while it runs, I see it could be improved. Sometimes tasks wait for other servers, so a higher -j value would help. And sometimes multiple tasks are waiting on the same disk, then I think a lower -j value would be better.
The kernel is fairly good at sharing CPU time among the cores, but resources like memory and disks are not shared very well. As an experiment, I tried compiling the kernel with "make -j" with no number. It didn't go very well.
So I wondered if anybody know of a better tool for things like this. I think it should be possible to write something that could change the -j value while it runs.For example:
- Start as many tasks in the background as there are cores. When tasks finish, start another one until done.
- After a little while, check CPU and memory usage to decide if more tasks could run in parallel. Or maybe less?
- If different tasks iowait a lot, check if they wait on the same disk. If so, renice/ionice/suspend some of them. In these situations I think it's better to have them run one after another.
- Other ideas?
I thought of making a script like that, but I doubt I'm the first one with that problem. Also, there are probably lots of things I haven't thought of.
View 5 Replies
ADVERTISEMENT
Oct 1, 2010
I have a bash script with a line like this in it:
Code: mysqldump -uusername -ppassword --master-data=2 --single-transaction --quick --add-drop-table --add-drop-database somedatabase | gzip > ./somedatabase.sql.gz The problem is, I have about 16 databases I'm dumping like this, but it's dumping
[Code]....
So, does putting in a & after a command work in a bash script at all? The thought was, if I want to run them in parallel, should I do this?
Code: #!/bin/bash
./scripts/dumpthis &
./scripts/dumpthat &
./scripts/dumpsomemore & Where "dumpthis" is just the first snippet of code above.
View 3 Replies
View Related
Nov 27, 2010
I use an application called redbutton-browser to access some of the things available on the redbutton digital tv channels. It compiles fine if I use a simple make but fails if I try to run parallel jobs with make -j4. I'd like some help altering the Makefile so that it does a few commands sequentially before it does the rest of the Makefile in parallel.
The relevant bit of the Makefile looks like this:
Code:
ISO13522-MHEG-5.c:xsd2c.c ISO13522-MHEG-5.xsd add_instance_vars.conf add_rtti.conf
make xsd2c
./xsd2c ISO13522-MHEG-5.xsd
./add_instance_vars ISO13522-MHEG-5.c ISO13522-MHEG-5.h
./add_rtti ISO13522-MHEG-5.c > rtti.h
[Code]....
View 7 Replies
View Related
Oct 22, 2010
I have been working on a project for a while now that involves a rather complex daemon that has to be simultaneously running different tasks. For example one of these tasks is to receive IP packets from the Netfilter queue and place those packets into one of several internal queues. While other tasks involve taking IP packets from those internal queues and processing/manipulating them and finally returning them back to the Linux network stack.
As I as I have no previous C experience before starting this project I just spawned a new thread each time I needed the daemon to be doing something else while those other tasks continued to run. Is there any other way of doing this or is this pretty much the only way of doing this? Because C is procedural I could not figure out any other way of doing accomplishing what I wanted. Should I have done it some other way or is this the correct and only way I could have gotten my C app to be running multiple tasks at the same time?
View 6 Replies
View Related
Jul 22, 2014
I am trying to replicate what is happening on this page under the tcsh shell, but using the bash shell found in Wheezy. Here is the page I am referring to:[URL] The command I am trying to replicate is on page 6 under figure 2.4. The command is "prompt> ./mem &; ./mem &".
I would like to run the same program twice, concurrently, but do not know how. Note that I am not trying to use a bash script, but rather by simply using syntax on the command line.
View 4 Replies
View Related
Jun 27, 2010
I need to make some C program under linux to make some scripts that can talk to my Server's Parallel port by sending some quare signal as high or low, so what i can do ?
View 4 Replies
View Related
Feb 26, 2010
As in window we normally use task manager (ctrl+alt+del) to see how many tasks are currently runing in the window ..similarly please give me alternative of this linux . that is how to know how many sottwares are running in linux is there any terminal commands for this or shorcuts keys as window.
View 3 Replies
View Related
Apr 1, 2011
I have written a small script from that iam appending the output to a file.If multiple users invoke the same script or if i invoke the same script n number of times (using &), the output file(ZZ/OUT) contains messup information.
++++++++++++++++++++++++++++++++
#!/bin/bash
#
[code]...
View 3 Replies
View Related
Apr 5, 2011
Does Debian 6 "Squeeze" automatically run boot processes in parallel if not how do I
configure it to do so. Here is the quote from my /etc/init.d/rc :
# Specify method used to enable concurrent init.d scripts.
# Valid options are 'none' and 'makefile'. Obsolete options
[code]...
View 2 Replies
View Related
Apr 5, 2010
I am a newbie user in Linux. I have installed a package were it has EMC2 software but when I run it shows parallel lines on the screen while running? What is the cause for it ? Should I reinstall ubuntu again? I had taken a screen shot and it will tell you what I really mean? This is the screenshot, [URL].
View 1 Replies
View Related
Sep 6, 2010
how to make a script that will check service/s status whether running or stop and also will run stop services?
View 9 Replies
View Related
Feb 20, 2011
According to Wikipedia's PHP page, PHP "is a general-purpose scripting language". Does that include being suitable for duplicate files detection? More specifically, the task is collating files from workstation backups into a single place, preserving directory paths and replacing duplicates with hard links. This will be a regular task on a lot of files so performance is important; our current proof-of-concept solution uses a PostgreSQL database of file "fingerprints" to speed duplicate detection. Does PHP have PostgreSQL integration?
I am asking these questions as a follow-up on an earlier thread asking for programming language recommendations for this task. Since then I have learned that PHP skills are available locally.
View 8 Replies
View Related
Feb 25, 2011
I am doing a project where 2 clients connect to server and communicate (chat) and transfer data one after other using sockets. I have working code for this in C language. Now our main aim is to create a communication link where two clients transfer multiple streams data parallely. To be more precise i want to transfer images files and audio files parallel at same time, so is it possible to send data parallel using one socket connection?
View 3 Replies
View Related
May 29, 2011
i want to know whether we can write a shell script which can utilize 2 CPU's of a cluster...I heard its possible through C Shell [URL] But im familiar with bourne shell only....So is there a possibility to write Parallel Scripts.
View 5 Replies
View Related
Mar 18, 2010
I need to spawn 2 processes in parallel and each takes an hour or so to finish. Is the following one of the correct ways of using `at` in a script run by crontab?
Code:
#!/bin/bash
# define the env var, cd, etc... assume everything ok up to this point
date +"The start time is %H:%M:%S"
rm -f a.fin
at now <<END_OF_AT
do_a &> a.log
[Code]....
View 2 Replies
View Related
Jul 29, 2011
I came across some problems. I need to conduct parallel computing on CUDA. I input "uname -a"and read these: "Linux BXSJC 2.6.38.8-35.fc15.i686 #1 SMP Wed Jul 6 14:46:26 UTC 2011 i686 i686 i386 GNU/Linux". I use CUDAtoolkit 4.0. when I input: cd /home/bxsjc NVIDIA_GPU_Computing_SDK/C and "make -i ",the computer returns
[Code]...
View 7 Replies
View Related
Aug 8, 2010
I have a little hardware project and I would like to use the parallel port. I basically want to display status code on top of other custom peripheral on an headless server. I only use output as the display (7 segment) is not part of the device itself. The problem is, the parallel port only have 8 standard I/O pins. I have read somewhere that there is a way to change the mode of the port to enable more data pins using a specification not backward compatible with the "classic" mode (so not enabled by default). I didn't find any other information about this. As I would like to have all 17 non-ground pin to avoid using more circuitry than necessary, how to turn this mode on?
View 3 Replies
View Related
Sep 3, 2010
I'm looking for a way in Perl to be able to take a list of servers, ssh multiple commands to it and store the results. If I do this process serially, sometimes one server will hang the whole script and if it doesn't, it still takes hours to complete.
I'm thinking what I need to do is make a parent loop that calls out a separate process that passes the server name to the child sub process and then executes all the commands I have defined in its own process. If one server 'hangs', at least that won't stop the script from doing all the other servers in the list.
I'm guessing using the fork() command would serve me best, however, all the online descriptions I have found have been vague at best.
View 4 Replies
View Related
Oct 15, 2010
Never done it before, don't know how but its due next week. I am a computer systems student and have been required to built a hardware that will be operated by a program in G++ through the parallel ports. The hardware, thats a piece of cake, the software, now that's were the real problem is. I don't even know were to start.
View 2 Replies
View Related
Oct 10, 2010
I hesitated on the title, generally can solve problems w/o this (20+ year *nix/linux experience).
hardware Dell 1505, ATI X1400 (nVidia went south replaced with ATI, used at this stage of life for this laptop).Acer x221w external monitor.
Recently upgraded to 10.04 (should have waited, but hadn't upgraded in a long time).
No real fixes found for the ati X1400 in searches (fixed it on 9.04 and 9.10).
So to troubleshoot, wanted to go to console mode, and start X manually and hopefully debug the config to get the thing working.
So, I get ready to take it down off of X only to find, there are no more consoles???
To work this out and to even come to an end result, when X does not work, you need a console to debug it. There is code in /etc/init.d/console-screen.sh for starting consoles...
Yet they do not start, notices some comments about doing it 'clever' in there, all I can say is 'clever' is more risky than workable, it worked before, why change it? It did not make it better, it made it harder, so now, to get it to work, I have to go debug someone else's 'clever' code? BTW, there are 'getty' running - but still no console.
Not so clever... We need a fix to get (at least at this level), the consoles running, so, where are you 'clever coder', tell us how to turn them back on.
Why in /etc/init/tty*.conf do they not start?
I really find it hard to say anything critical to something that is free, in general, I will not even comment, but just go ahead and find the fix myself, But to even address this, we (IMO) need pretty much a fix for the broken console access, before we can even address X in certain configurations.
A long time user of RH, even back to Yygdrasil, Soft Landing days, I was VERY impressed with ubuntu over the others for a desktop (got it on the Dell), but now, at 10.04, it has become cumbersome and broken.
It is a good product, but we need to get it back to where it is not so bleeding edge and broken.
View 1 Replies
View Related
Mar 2, 2011
If multiple threads operate on a single shared resource, we can lock it using pthread_mutex_lock. Uptill that it is fine, but why again pthread_cond_wait?
int shared=0; // global
.
.
// Thread 1
pthread_mutex_lock(&mutex);
shared=1;
pthread_mutex_unlock(&mutex);
When thread1 invokes the mutex lock, no other threads can access it in parallel. So why again and what for we use, pthread_cond_wait( ).
View 2 Replies
View Related
Apr 13, 2011
I just can't find... why is my code seg-faulting?
PHP Code:
/*
Code name: Assignment #7.
File name: slice.c
Program name: Matrix multiplication (parallel version).
Version: 1.
[Code]...
Is giving my a seg-fault right at the ending point where I do the final gather from the MASTER processor.
View 9 Replies
View Related
Sep 4, 2009
Is suid disabled from running all home made bash scripts or just from running them as root or:
Who would know for sure.
I googled several combinations of Mandriva Linux how-to suid disabled setUID etc... so far all I found was "many distributions are disabling suid for security reasons" nothing specific.
View 2 Replies
View Related
Jun 1, 2010
My root Vixie cron crontab is set to perform a system snapshot via fsarchiver: 0 0 * * * fsarchiver savefs -o -A /backups/p30_root.fsa /dev/sda2 /dev/sda3 The command itself works fine, generating about a 7G snapshot of my Suse server. I then wish to rsync this to a NAS I have located in another building: 0 3 * * * rsync -av -e ssh --delete /backups/ root{at address}:/DataVolume/os_backups/
(yes, I'm rsyncing as root. I absolutely loathe it, but I got thrown into an quasi-SA position with a ridiculous to-do list and no time to do it. I'm having to make things just work and then go back and try to improve them/learn how. I couldn't make it work in a non-root way quick enough, so for now I'm having to cron rsync jobs as root because of all the differing file permissions on this samba/MySql server. I set the NAS to only accepts ssh from the server IP, and we're behind a campus firewall... It's serious trial by fire.) The crontab also has rsync commands for the samba areas, our specialized chemistry software and affiliated MySQL databases............
View 2 Replies
View Related
Sep 15, 2010
I want to gave much details as possible. working directory (~/a1/shell) in the shell directory i have Makefile. also in the shell directory i have subdirectory's (obj, src, include)
My current Makefile
Quote:
#What needs to be built to make all files and dependencies
clean:
# End of Makefile
I wanted it so: all .o files are created in the obj subdirectory, and my application, sshell, is created in the shell directory.
I am getting this error when i run the make run: No rule to make target 'shell.h', needed by 'shutil.o'. stop
View 1 Replies
View Related
Mar 3, 2010
I have a cron job set up to backup my ~/ directory everyday at 10:00. But the cron job is not running. here is my confile that I loaded into crontab...
Code:
#backup everyday @ 10:00 AM and 10:30 AM
00 10 * * * /home/dave/bin/backup.sh
30 10 * * * /home/dave/bin/music_backup.sh
[code]....
the *.sh are executable. I logged out and logged back in since I put the cronfile in crontab. The commands that I use in the *.sh files work fine when I run them manually.
View 9 Replies
View Related
May 3, 2010
I run Ubuntu 10.04. For some reason, MySQL won't start on startup. How do I make it run on startup? I installed it by installing LAMP using tasksel and did everything according to: [URL]. Also, I have another problem: When I try to start/stop/restart mysql in the terminal, the terminal will not give me any prompts after entering the command. E.g., after entering "sudo service mysql start", nothing will happen. Even after waiting for 30min, nothing happens.
View 9 Replies
View Related
Sep 17, 2010
I amtrying to install a program and at the point when I am required to execute the command "make clean" and then after "make all" , I obtain the following eror message:
ndoheric@nen-laptop:/opt/WAVEFORPGM/distribute$ make clean
cd ./MyTime; make clean
make[1]: Entering directory `/opt/WAVEFORPGM/distribute/MyTime'
[code]...
View 4 Replies
View Related
May 2, 2011
i have installed Ubuntu 11.04 i.e Natty Narhwal(m i spelling it right?) i want my Ubuntu system to remember currently running applications even when i shut it down. It was possible in ubuntu 10.10...it was in startup applications(i guess). I cant hibernate. It fails to hibernate. Let me know if anyone knows anything.
View 9 Replies
View Related
Jun 7, 2010
I have a x86_64 i5 processor running Fedora 13.When I run the make file,I get the following error.Can someone help me out please?
# make
making all in ./lib...
make[1]: Entering directory `/home/Anil/Downloads/glut-3.7/lib'
[code]....
View 4 Replies
View Related