Programming :: Correct Way Of Spawning Parallel Jobs?

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?

# 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


View 2 Replies


Programming :: Run Parallel Jobs With Make -j4?

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:

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


View 7 Replies View Related

Applications :: Correct Syntax For Scheduled Cron Jobs

May 25, 2010

I need to create the following cron jobs:

job #1: runs Mon, Tue, Wed, Thu, Fri, Sun at 9PM every month except for 15th
job#2: runs on 15th of each month at 9PM
job #3: runs every Saturday at 6PM every month

What is the correct syntax for this kind of scheduled cron jobs?

View 7 Replies View Related

Programming :: Running Mysqldumps In Parallel?

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


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

Programming :: Using `jobs` In A Script Not Working

Aug 30, 2010

why when I use "jobs -l >> tmp" in a script file it does nothing, and when typing it at the prompt it creates the tmp file I expect it to...?

View 9 Replies View Related

Programming :: Parallel Data Transfer Using Sockets

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

Programming :: Parallel Shell Scripts To Execute Using LAM?

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

Programming :: Conduct Parallel Computing On CUDA?

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 #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


View 7 Replies View Related

Programming :: Using Parallel Port Mode And I/O Pins?

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

Programming :: Get Background Jobs To Execute Sequentially?

May 4, 2009

I'm looking for a general pointer, or label for what I am trying to do. Not a specific line of code. I've written a couple of small sh script that gets some user input, then calls several programs to run in the background with the &. My problem is, they all run at the same time. Is there some way to get these jobs to run sequentially rather than consecutively? If yes, what is this process called? I'm thinking there should be a way to line up background jobs in a job queue, similar to how a print queue works, one job at a time. After searching for a couple of hours, I'm thinking there must be a name for this, but I don't know what it is.

View 11 Replies View Related

Debian Programming :: Running Programs In Parallel In Bash

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

Programming :: Perl - Multiple Child Processes In Parallel?

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

Programming :: Build Hardware Operated Through Parallel Ports?

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

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 View Related

Programming :: Limit Number Of Concurrent Jobs By Process Name?

Apr 7, 2011

I am trying run audio conversion on my server that I want limited to a certain number of processes based on process name. I am using the following script but it isnt limiting the number of job like I want it to.

$num_jobs = 13
while [ $(ps -A | grep -v grep | grep -c pacpl) -ge $num_jobs ]
sleep 1


View 3 Replies View Related

Ubuntu :: Sshd Keeps Re-Spawning?

Jun 25, 2010

The system in question is using Mint 9, but the forums there aren't as active and since its Ubuntu based I didn't think it would be a concern bringing my problem here. If this is an issue, apologies, lock the thread and I'll head over to the Mint forums.So I have an SSH server running on the system, but I only like to have it running at certain times, so I removed it from the rc scripts using the command: sudo update-rc.d -f ssh remove.

Anyway, later I found that SSH was turning on at boot time anyway. I checked the rc scripts manually and couldn't find reference to it. I then tried to stop the process using the command: sudo /etc/init.d/ssh stop which reported that it was working, but after checking the processes and consulting syslog I found that it was re-spawning after I had told it to stop.I found 2 ways to stop the process without it re-spawning:sudo initctl stop sshand sudo service ssh stopSo whilst I can turn it off at each boot, or script it to shutdown at login, I'm still wondering why update-rc.d isn't working

View 3 Replies View Related

Programming :: C Program - To Make Scripts That Can Talk To Server's Parallel Port

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

Programming :: Write A Shell Script For Submitting Multiple Jobs Sequentially

May 27, 2010

I want to write a shell script for submitting multiple jobs sequentially. For example,


# when is done, run the next one


how to make the shell script know that is done and now I can run

View 4 Replies View Related

Programming :: Pthread_cond_wait - When Thread1 Invokes The Mutex Lock - No Other Threads Can Access It In Parallel

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

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

Fedora :: Nautilus Starting Up At Login Then Spawning New Instances?

Aug 19, 2009

nautilus starting up at login then spawning new instances till it runs out of memory. At one time I checked Startup Applications Preferences to Automatically remember running applications when logging out; I unchecked this thinking it was the problem; but it has not gone away; I have to kill nautilus, then the spawning will stop. Also I can not close nautilus; another instance will run; sometimes starting the spawn all over.

View 9 Replies View Related

Ubuntu :: 10.4 Gnome Desktop Is Spawning Multiple Processes?

Jul 27, 2010

This is the second new install of 10.4 on the same machine with the same issue. After boot, as soon as user logs into the desktop, sys mon shows cpu at 100 percent and a steady climb in ram usage. several processes are spawned continuously until all ram is consumed and then moves on to use scratch space.

Using top, the process count moves into over a thousand total processes. Some investigation using top, ps, and digging into the /proc folder shows a ppid of 1 If the machine is booted to shell, top shows 120 processes and is stable. Some of the processes running repetitively are the gnome toolbar, nautilus, and I wish I was clear headed enough to write the others down before I left work. I can certainly get a more complete list in the morning.

I have swapped out ram, and the processor with no success. I have also tried apt-get purge ubuntu-desktop then installing with apt, this did not resolve it. As mentioned at the top of the post, this is the second install with these symptoms. The first install started showing the issue about 10 hours after first boot. On this second install, all was working fine for a couple days before this started in.

View 9 Replies View Related

Programming :: In Correct File Is Empty?

Jun 17, 2010

I am using embedded Linux. File open is successful. The file has all the permissions. It is present in current directory too. The size is about 27KB. But s.st_size says it is zero.

inputFileName = "abc.mp3";
FILE* inFile = NULL;
inFile = fopen(inputFileName, "r+b");


View 2 Replies View Related

Programming :: Javascript To Verify Correct URL?

May 31, 2011

Lets say I have a site ""

On that site I want to run a little javascript that verifies that the site was accessed as "" and not ""

If it was accessed correctly, nothing happens. If it was accessed incorrectly, it displays an error saying "You are trying to access this site incorrectly."

What is the simplest way to accomplish this?

View 1 Replies View Related

Programming :: Atoi() Not Giving Correct Answer?

Jun 20, 2010

i m using atoi() to convert char value to int. and then passing that int as a swtich variable.switch goes in a case and exectuing that particualr function but returning 0 value....for example: i am finding no of process() and system up time().when switch program goes in system up time it gives right values means correct no of days, hrs , min and sec but when it goes in no of process() it gives 0 answer.

View 8 Replies View Related

Programming :: Expect/TCL - Unable To Get The Correct Results

Feb 8, 2011

I'll post the entire code here, and then specifically highlight what is just failing in a fashion I'm apparently incapable of fixing a few hours later:


# The script should be called with a file in the directory called sshServerList
# That file has the following format:
# Line # | Contents of line


I've had all kinds of different results and problems, but I've never been able to successfully log into multiple servers, though the first server in the list most times works okay (though might not on this iteration). I'm a bit hack and slash and I would be very greatful not only for a solution, but any tips on how I should have done this and places where I could clean up my code.

View 1 Replies View Related

Programming :: Bash Script To Correct The Filenames

Apr 11, 2011

I have a directory that has a bunch of files and directories under it that I need to correct the filenames of. In fact, I plan on running this as a cronjob to keep checking filenames for certain characters. I want directories and filenames with spaces or pluses (+) to have those certain characters replaced with underscores (_). I know that this will involve sed but I'm not sure what else. A simple shell script would handle it.

View 1 Replies View Related

Programming :: Not Getting Right Output To Correct Terminal Window

Jun 17, 2010

I have a server client prog in which server is my 'agent' and client is 'manager'. Following is the code for both agent and manager. I want my agent to send what manager is requesting. But it is not working the way I want. The parameters which manager is requesting, agent has to send to manager but in this program result for those parameters is shown on agent's own terminal window. Where as I want them on manager's window. Secondly, there result is not correct, means it is giving ' 0 K ram and 0 no of process....

//code for MANAGER
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h> .....

View 2 Replies View Related

Programming :: Sudoku - Calculate The Correct Box For A Given Square?

Apr 8, 2011

Im doing a sudoku-solver as a school assigment in Java. It is supposed to solve both 6x6, 9x9 and 12x12 boards.Im pretty much done with my algorithm(brute force), but I'm having a hard time figuring out how to calculate the right Box for a Square. I found this snippet:


// calculate BoardPos for index, where index is 0..80
void loadBoardPosFromIndex(BoardPos &pos, int index) {
pos.index = index;


This works on 9x9 boards, but I really dont get the math behind this, and how I can create a generic rule for both 6x6, 9x9 and 12x12 boards.

View 4 Replies View Related

Programming :: Wcslen / _tcslen Not Returning Correct Value?

Feb 12, 2010

I have having some trouble working with wide characters, which is,

Sample code:
TCHAR fname[512];
_tcslcpy(fname, L"/root/Desktop/all/TheGrandTunnels.fgc", 512);


View 4 Replies View Related

Programming :: Parallel Matrix - Matrix Multiplication Seg-faults?

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.


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

Copyrights 2005-15, All rights reserved