General :: Wrote A Program That Multiplies 2 Matrices Using Multi-threads And Another One Using Multiple Processes And Shared Memory?
Sep 22, 2010
I wrote a program that multiplies 2 matrices using multi-threads and another one using multiple processes and shared memory. Both in C.I need to find the total memory usage of these programs. I know of the top command, but when my matrices are relatively small they don't even show up on top because they complete so fast, how can I find the memory usage for these instances?Also, how can I find the total turnaround time of my programs
View 1 Replies
ADVERTISEMENT
Sep 2, 2010
The following code is for monitoring the memory used by apache processes. But I got a problem that the data I got by this script is much larger than the physical memory. It was said that there are some libraries used simultaneously by many processes, so the data I got has some double counted part. Because apache has many httpd processes.
Anyone have an idea of getting the multi-processes memory used?
Code:
#!/bin/sh
#G.sh 20100813
USAGE="Usage: $0 processName"
[Code].....
View 14 Replies
View Related
Apr 30, 2010
I have created a simple download schedular with source-code give below :
---------------------record_strokes.sh-------------------
touch /home/student/packs/lynx/logfile
lynx -cmd_log /home/student/packs/lynx/logfile
[code]....
View 1 Replies
View Related
Jan 17, 2010
I found from command 'top' that 8GB memory are used. However, using command 'ps' with some options to grep the running processes and then summing up the memory used by the running processes are less than 2 GB. Where has the used memory gone ?
View 7 Replies
View Related
Feb 2, 2009
Few days ago, the server did not respond to a ssh request from a user at night. A user tried to check what went wrong with computer and tried to login from terminal next morning. As the computer was unresponsive, he somehow decided to boot it by turning the power off. To make the story short, the server rebooted; however, he can't login to his account. Actually, the server could not start some processes; but was able to ask user to enter his account username. Even though, he enters the correct username and password, server does not accept the request. I also could not login as root.
I just checked the server logs by booting it in single user mode. Here are some interesting lines:
Before the reboot:
irqbalance : can't balance irqs on a uniprocessor system: failed
After the reboot:
irqbalance : can't balance irqs on a uniprocessor system: failed
fsck:
fsck /: (this is repeated 900+ times)
[code]....
View 1 Replies
View Related
Sep 3, 2010
I am doing a test to get the memory used by apache`s apache2 processes. I used a script to get VmSize and VmRss from /proc/pid/status, and loop through that to get the sum of VmSize and VmRss of all the apache2 processes.
I found the VmSize (about 4GB) and VmRss (about 3.4GB) are much larger than the physical memory (1GB) when apache server was saturated. It was said because of the multi-counted libiraries size used by many processes simultaneously. Then , how to get the physical memory used by apache2 processes? Or how to get a more reasonable memory data?
View 7 Replies
View Related
Sep 6, 2010
I work on Linux for ARM processor for cable modem. There is a tool that I have written (as the job demands) that sends/storms customized UDP packets using raw sockets. I form the packet from scratch so that we have the flexibility to play with different options. This tool is mainly for stress testing routers.I actually have multiple interfaces created. Each interface will obtain IP addresses using DHCP. This is done in order to make the modem behave as virtual customer premises equipment (vcpe).
When the system comes up, I start those processes that are asked to. Every process that I start will continuously send packets. So process 0 will send packets using interface 0 and so on. Each of these processes that send packets would allow configuration (change in UDP parameters and other options at run time). Thats the reason I decide to have separate processes. I start these processes using fork and excec from the provisioning processes of the modem. The problem now is that each process takes up a lot of memory. Starting just 3 such processes, causes the system to crash and reboot.
I have tried the following:-
1-I have always assumed that pushing more code to the Shared Libraries will. when I tried moving many functions into shared library and keeping minimum code in the processes, it made no difference to my surprise.
2-I also removed all arrays and made them use the heap. However it made no difference. This maybe because the processes runs continuously and it makes no difference if it is stack or heap?
3-I suspect the process from I where I call the fork is huge and that is the reason for the processes that I make result being huge. I am not sure how else I could go about. say process A is huge -> I start process B by forking and excec. B inherits A's memory area. So now I do this -> A starts C which inturn starts B will also not help as C still inherits A?. I used vfork as an alternative which did not help either. I do wonder why.
View 1 Replies
View Related
Mar 4, 2010
Ive been asked to investigate presenting the same SAN LUN to two or more RHEL5 hosts. The hosts are providing independent applications so theyre not clusters from an application perspective. The shared storage location would be used as a common area for imports/exports. Were hoping to reduce file transfer times between the hosts by eliminating the need to copy the files between two storage locations. Some of our hosts run Advanced Server and some are standard. Is there a file system that I can use that will allow multi-host access without running advanced server with clustering services on all hosts?
View 2 Replies
View Related
Jul 24, 2010
I'm trying to add local sockets in my multi-threaded application in order to exchange data between threads. The only problem I got is that most of the information available on the net is related to internet oriented socket programming whileI want to perform local connections. got a thread that does the sniffing via libpcap. And I would like that thread to send each captured packet to a second thread that will analyse the packetof the thread implementations is written in separate .h file.Or maybe there is a more effective method of exchanging data between threads
View 14 Replies
View Related
May 3, 2010
I have written an application which has more than 6 threads.Two threads share a common linked list. Out of two threads one thread reads the linked list node and other thread writes to linked list node.I am using pthread_mutex_lock() API to achieve synchronisation between having access to common linked list. The problem is the first thread which reads the linked list accesses the mutex faster making other thread to starve.
I want both the thread to have an access to mutex. It should not happen that always first thread locks, releases and relocks it. The first thread almost require to access the link list every 5 msec which is causing second thread not to gain the mutex.How should I fix this? For information, I am running this application on PXA270 ARM platform.
View 4 Replies
View Related
Jul 21, 2011
Fedora15 32bit. I write a test program, it creates new thread continually, the thread does nothing but sleep. I find virtual memory increases up almost 10Mb when a new thread is created. and when there's more than 200 threads, the virtual memory used by the program is 3Gb, and now cann't create new thread. but on windows, it costs little memory. What can I do to config the operation system to take less memory on threads?
View 11 Replies
View Related
Jul 22, 2010
I am facing an issue where the process starts hanging. When I closely look at the logs I come to know that some of the child processes that are forked by the parent process are not finished.
1) Is it possible that the child processes that are not finished occupy the socket memory of the parent process and ultimately a point is reached where no socket memory is available to fork new child processes.
2) What is the standard limit of socket memory in linux?
3) What is the fate of such child processes (as I have mentioned above)?
4) How to debug such cases so that the exact problematic area is identified?
View 2 Replies
View Related
Apr 10, 2011
I wrote program in c#
i got an error
no dotnetcharring namespce
how to solve this problem
View 4 Replies
View Related
Nov 2, 2010
Are there any tools to view/edit user space memory of running processes on Linux?
It would be a great learning tool.
View 1 Replies
View Related
Jun 11, 2010
I want to create a "Shared Memory" in linux, then create multiple "Shared Objects" that can access to a Table for example; And one of them can write something into the Table and the other can access and read it, so that these operations can be handled by programmer! I'm using Ubuntu 9.04 and I've set it's runlevel at 3 (I have commandline environment now!) I've searched the Internet so much, but couldn't find a good sample code for this! I have no experience about it and need your help to introduce me a sample code about it and advise me how to compile and use it with "GCC"?!
View 6 Replies
View Related
May 22, 2010
First I create a named pipe at /tmp/.pipe by
Code:
mkfifo /tmp/.pipe
which is then used in a shell script called A.sh like this
[code]....
View 1 Replies
View Related
Jun 13, 2010
I am a bit confused with MPM. I read one the article here: [URL]. Still have few very basic doubts:
1. What exactly is a MPM, a module has a specific function to do whats the specific function of MPM?
2. What are the "multi processes" it handles? Is it connections?
Quoting from the articles:
"The main difference between MPMs and normal modules is that only one of the former can be used and multiple ones can be loaded in the latter".
3. There are multiple MPM but aren't they operate differently and may cause conflict when more than one is loaded and operating?
I am really looking for concept of MPM
View 2 Replies
View Related
Nov 26, 2010
Code:
void* thread(void* arg)
{
[code]....
View 5 Replies
View Related
Apr 28, 2010
I just switch to fedora from windows recently. And I love the terminal of fedora alot. The problem is when I run some command on the terminal, I need to wait for that command to finish before executing another command. This is very inconvinient, say If I open eclipse using the terminal, this eclipse program will hog to the terminal until I closed it. So if I want to use terminal again I have to open another one.Hence the question is: Is there any way open multi processes(command) using only one terminal?
View 4 Replies
View Related
Feb 2, 2009
Few days ago, the server did not respond to a ssh request from a user at night. A user tried to check what went wrong with computer and tried to login from terminal next morning. As the computer was unresponsive, he somehow decided to boot it by turning the power off. To make the story short, the server rebooted; however, he can't login to his account. Actually, the server could not start some processes; but was able to ask user to enter his account username. Even though, he enters the correct username and password, server does not accept the request. I also could not login as root.
I just checked the server logs by booting it in single user mode. Here are some interesting lines:
Before the reboot:
irqbalance : can't balance irqs on a uniprocessor system: failed
After the reboot:
irqbalance : can't balance irqs on a uniprocessor system: failed
fsck:
This might be something related with shadow file.
Here is part of /etc/shadow
View 3 Replies
View Related
Jul 17, 2011
How do I change the size of the available shared memory on Linux?evidently 4GB is not enough for what I am doing (I need to load a lot of data into shared memory - my machine got 8GB of RAM).
View 2 Replies
View Related
Apr 30, 2010
I have created a simple download schedular with source-code give below :
---------------------record_strokes.sh-------------------
touch /home/student/packs/lynx/logfile
lynx -cmd_log /home/student/packs/lynx/logfile
[code]....
So, this is a simple download scheduler program code. Which creates multiple threads of the downloading process - wget (i could also have used 'curl' instead 'wget').Can you debug this code?
View 1 Replies
View Related
Apr 7, 2011
Using Ubuntu server 10.04.2 64-bit all up to date.
I am running multi-threaded processes. These use OpenMP in my own code and the multi-threaded ACML maths library. When run in the foreground, everything is fine i.e. if I have set
export OMP_NUM_THREADS=8
then when I start all 8 cores are in use and things whizz along. However, when running overnight and logged out using e.g. 'at now + 1 minute' then the command, I am only getting about 130% CPU and it slows down accordingly. I have tried renice'ing and calling from within a bash script in case sh is doing something odd but nothing seems to solve it. I am sure that in the recent past this wasn't the case.
The libraries being used are shared versions in case that might have any bearing.
View 1 Replies
View Related
Apr 11, 2011
I have written a simple script which has to find required patterns from a bunch of files ( where each file is around 2 GB each,which contain the output of seq 1 10000000000000) on an 8 core machine.I am current forking 6 child processes which run simultaneously on 6 cores of the processor & have to search for the required pattern in 6 different files & inform the parent process when a pattern is found using a PIPE.
The problem is,when a child process is done reading a text file looking for a pattern,it is becoming a zombie process.It exits cleanly when i put a $SIG{CHLD} = "IGNORE"; in the script.Can any one tell me whats going on & how do i improve the communication between child and parent processes?
Code:
#!/bin/perl
use strict;
[code]...
View 3 Replies
View Related
Jul 20, 2010
I have a multithreaded program running. The threads are created by using pthread_create(). The ps shows a pid value for each thread in the process. The name of the thread is all the same as the parent process. I want to match the PID values in the ps output to the threads in my program. But when I used getpid() in each thread, the value I get is different from what ps shows. How do I match the pid value in ps output to the threads in my program.
View 1 Replies
View Related
Jul 25, 2010
I am runig a program on a server at my university that has 4 Dual-Core AMD Opteron(tm) Processor 2210 HE and the O.S. is Linux version 2.6.27.25-78.2.56.fc9.x86_64. My program implements Conways Game of Life and it runs using pthreads and openmp. I timed the parrallel part of the program using the getimeofday() function using 1-8 threads. But the timings don't seem right. I get the biggest time using 1 thread(as expected), then the time gets smaller. But the smallest time i get is when i use 4 threads.
Here is an example when i use an array 1000x1000.
Using 1 thread~9,62 sec, Using 2 Threads~4,73 sec, Using 3 ~ 3.64 sec, Using 4~2.99 sec, Using 5 ~4,19 sec, Using 6~3.84, Using 7~3.34, Using 8~3.12.The above timings are when i use pthreads. When i use openmp the timing are smaller but follow the same pattern.I expected that the time would decrease from 1-8 because of the 4 Dual core cpus? I thought that because there are 4 cpus with 2 cores each, 8 threads could run at the same time. Does it have to do with the operating system that the server runs?
Also i tested the same programs on another server that has 7 Dual-Core AMD Opteron(tm) Processor 8214 and runs Linux version 2.6.18-194.3.1.el5. There the timings i get are what i expected. The timings get smaller starting from 1(the biggest) to 8(smallest excecution time).The program implements the Game of Life correct, both using pthreads and openmp, i just cant figure out why the timings are like the example i posted. So in conclusion, my questions are:
1) The number of threads that can run at the same time on a system depends by the cores of the cpus?it depends only by the cpus although each cpu has more than one cores? It depends by all the previous and the Operating System?
2) Does it have to do with the way i divide the 1000x1000 array to the number of threads? But if i did then the openmp code wouldn't give the same pattern of timings?
3)What is the reason i might get such timmings?
View 4 Replies
View Related
Mar 8, 2011
I am using GPROF for my code profiling ,but it seems GPROF doesn't supports multithread .Does any one know any other technique for profiling the application code I have checked oprofile but it profile kernel ,I just required for C code profiling technique that supports multiple threads
View 1 Replies
View Related
Nov 30, 2010
I need to find the memory usage of a shared library loaded in Linux environment.
I need this information for deciding on whether to make the library part in to application or a seperate application itself.
View 3 Replies
View Related
Jan 25, 2010
I recently built a new server, running 64 bit Slackware 13.0 with the following specs:
MSI 785GTM-E45
AMD Phenom II X2 550
2GB DDR2
Onboard video from AMD 785G chipset
2x 80GB IDE system drives using software RAID with 2GB swap partition
I only include these because I'm not convinced my problem is not hardware related at some level. Basically, when I first start up the system, the memory usage is anywhere from 60 to 200MB. Then it starts to gradually climb until there is only 12-15MB free. This can take anywhere from a few hours to a few days.
The only thing I really use this for is to serve Samba shares and the occasional SSH login. I've set up Samba shares to be accessed by my Windows machines as well as a Mac. Initially I just explored the network if I wanted to see the share from these machines, but that was too slow and unreliable (the server would not always show up in Windows), so now I automatically mount the share as a network drive at startup (from Windows). So I don't know if this would have anything to do with the steadily increasing memory usage. These systems are not on/connected all the time, but the memory usage seems to rise anyway.
When I run top, it reports that nearly all of the physical memory has been consumed (after a while of uptime), but none of the swap space has even been touched. This is a typical output of the first several lines, sorted by swap size:
Code:
top - 07:45:48 up 2 days, 12:33, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 105 total, 1 running, 104 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
[code]....
I can't be sure, but I believe the message just repeated itself before this part. MS-7549 is one of the components of the mainboard (MSI), maybe the northbridge or something (it seems to be associated with more than one model), so I thought for sure this meant a hardware problem, maybe with the storage controller or memory. But Memtest86 passes for more than a day without any errors, and I loaded Windows on one of the disks and ran it as hard as I could with prime95 and nothing so much as flinched. So I've got to think this is some kind of issue with linux and/or how it is handling my hardware configuration.
View 5 Replies
View Related
Sep 6, 2010
I work on Linux for ARM processor for cable modem. There is a tool that I have written (as the job demands) that sends/storms customized UDP packets using raw sockets. I form the packet from scratch so that we have the flexibility to play with different options. This tool is mainly for stress testing routers.
The details are here.
I actually have multiple interfaces created. Each interface will obtain IP addresses using DHCP. This is done in order to make the modem behave as virtual customer premises equipment (vcpe).
When the system comes up, I start those processes that are asked to. Every process that I start will continuously send packets. So process 0 will send packets using interface 0 and so on. Each of these processes that send packets would allow configuration (change in UDP parameters and other options at run time). Thats the reason I decide to have separate processes.
I start these processes using fork and excec from the provisioning processes of the modem.
The problem now is that each process takes up a lot of memory. Starting just 3 such processes, causes the system to crash and reboot.
I have tried the following:- 1-I have always assumed that pushing more code to the Shared Libraries will help. So when I tried moving many functions into shared library and keeping minimum code in the processes, it made no difference to my surprise.
2-I also removed all arrays and made them use the heap. However it made no difference. This maybe because the processes runs continuously and it makes no difference if it is stack or heap?
3-I suspect the process from I where I call the fork is huge and that is the reason for the processes that I make result being huge. I am not sure how else I could go about. say process A is huge -> I start process B by forking and excec. B inherits A's memory area. So now I do this -> A starts C which inturn starts B will also not help as C still inherits A?. I used vfork as an alternative which did not help either. I do wonder why.
reduce the memory used by each independent child processes.
View 1 Replies
View Related