Application running on both cpus under Linux

Hi there,
I'm using Zynq + PetaLinux that is supposed to use both cpus by default, and I can see that calling the top command. However, when I launch an APP it's just run in one CPU.
We have an APP with 2 threads:
(1) Reads from BRAM in PL (using mmap) and store bytes in main memory.
(2) If there's new data read from bram, send it to PC using Ethernet.
In order to execute each thread in different CPUs, I use the following snippet in each thread (where core_id=0 for thread1 and core_id=1 for thread2):
        int core_id = 0;
        cpu_set_t cpuset;
        CPU_ZERO(&cpuset);
        CPU_SET(core_id, &cpuset);
        pthread_t current_thread = pthread_self();
        pthread_setaffinity_np(current_thread, sizeof(cpu_set_t), &cpuset);
The performance does, in fact, get better with this code, but shouldn't I be able to find both cpus being used calling top command or somewhere else? Because it just shows that cpu0 is being used.
Thank you,
Leroy.

Hi Leroy,
Interesting, you've actually got a slightly newer version of busybox that I am using. Looking at the more recent source code, it appears that threads option has been made configurable. Evidently your version was compiled without this feature.
I was going to suggest trying "ps -T" instead, but it looks like that command also has configurable thread reporting now... and most likely that will be switched off too.
I would suggest compiling your own busybox (even if you only use it for "top"). Or you could also compile the real "top" command from the procps (or procps-ng) package.
If you want something quick, you can look directly in /proc filesystem. Specifically, you can do "cat /proc/PID/status" where PID is the process ID of your task. The "status" file contains a field called "Threads" that tells you how many threads there are. If you want more details on each of the threads, use "ls /proc/PID/task" to get a list of the process ID of each of the threads. Then for each thread, you can consult it's /proc/PID/... fields (for details see http://linux.die.net/man/5/proc).
Regards,
-R

Similar Messages

  • Font problems running a swing app under Linux

    I have an application running well under the Win family (NT, 2000, etc.)... and it also runs well under a Linux Red Hat os... but in the linux environment I've observed the folloowing font errors displayed in the screen:
    Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific]
    this is a unexpected issue because I'm not setting any font in my code... How can I solve it ?
    It's a Java or OS configuration problem ??

    Here is a solution:-
    Copy SYMBOL.TTF to /usr/java/jdk1.3.1_01/jre/lib/fonts or wherever.
    Note the copy should have lower case name!
    Do a chmod 444 symbol.ttf
    I don't say where to get a copy from but you can imagine!!
    Modify the file fonts.dir in the same directory as follows:
    Change the first line by 1 ie if its 72 change to 73.
    Insert the following line:
    symbol.ttf -monotype-symbol-medium-r-normal--0-0-0-0-p-0-abode-fontspecific
    You have to do the above as root of course.

  • Java running under linux with crontab

    I'm having a problem:
    i want to run a java program under linux with crontab.
    my classes are in a directory and aren't in a package. i run em by invoking ./start which is a small script that i wrote. The script is in the same dir as the classes and invokes java by "java Main >>logjava.txt " but this doesn't seem to work all i get is an empty logfile
    i need to run the program every day at 0800 so i inserted the following in crontab:
    0 8 * 1-5 /var/"path"/start > logjava (where path is the path to the classes dir)
    if i run the cmdline from anywhere on the prompt i get the result i want. I think it's because the cron runs it from the root dir thus making java unable to find the classes
    Any suggestions would be welcome. or can some1 tell me how to make linux executables from the java (i usually use jsmooth for the windows exe)

    You can execute several commands in the process started by cron. You separate them using semicolons.
    Have you tried a cron entry like this:
    0 8 * 1-5 cd /var/"path";pwd;echo $PATH; ./start > logjavaOr, you may need to make sure the process started by cron gets the same environment as your interactive shells do, by explicitly loading your setup or .login scripts:
    0 8 * 1-5 . $HOME/.setup;cd /var/"path";pwd;echo $PATH; ./start > logjava

  • Can't run eclipse under Linux OS

    When I run eclipse_linux_gtk 3.1 under Linux ( kernel 2.6.7, gnome 2.8, sun jdk 1.5.0), I got the following error message.
    What is wrong with it?How should I do to make it work?
    !SESSION Oct 11, 2004 00:36:59.306 ---------------------------------------------
    eclipse.buildId=M200409161125
    java.version=1.5.0
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
    !ENTRY org.eclipse.osgi Oct 11, 2004 00:36:59.334
    !MESSAGE Startup error
    !STACK 1
    java.lang.RuntimeException: Exception while creating System Bundle: Unable to find system bundle manifest file.
    at org.eclipse.osgi.framework.internal.core.Framework.createSystemBundle(Framework.java:253)
    at org.eclipse.osgi.framework.internal.core.Framework.initialize(Framework.java:152)
    at org.eclipse.osgi.framework.internal.core.Framework.(Framework.java:95)
    at org.eclipse.osgi.framework.internal.core.OSGi.createFramework(OSGi.java:90)
    at org.eclipse.osgi.framework.internal.core.OSGi.(OSGi.java:31)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:215)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:127)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
    at org.eclipse.core.launcher.Main.run(Main.java:704)
    at org.eclipse.core.launcher.Main.main(Main.java:688)
    !SESSION Mon Oct 11 00:36:59 GMT 2004 ------------------------------------------
    !ENTRY org.eclipse.core.launcher 4 0 Oct 11, 2004 24:36:59.376
    !MESSAGE Exception launching the Eclipse Platform:
    !STACK
    java.lang.NullPointerException
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:138)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
    at org.eclipse.core.launcher.Main.run(Main.java:704)
    at org.eclipse.core.launcher.Main.main(Main.java:688)

    I love eclipse and run it under windows very well.
    Now,I install a Linux OS in my computer,and want to work under it, but I get the same error log everytime.
    What others do who use eclipse under Linux?Is it work well?

  • Won't run with 2 CPUs

    I just replaced my 6501 motherboard with one that MSI sent me. When I install both processors the computer most times hangs at startup screen. Lights 2 and 3 are red which indicates it stops at the Bios sign-on.
    It hangs where it says AMD MP 2800 Processor but before memory test and it does not display the , (2 cpu's) to the far right of the processor (80% of the time this happens on boot-up). Occasionally when I reboot it will detect both CPUs and will initialize the bios and then start loading windows at which point it immediately reboots.
     If I remove the second CPU and reboot the machine boots fine and I can load up windows.
    I have swapped both CPUs and put both of them in the Primary CPU slot and they both boot up and run fine no issues. Only when I try to have both in do I have problems. The reason I replaced the MB was because of some dried out capacitors. I got the 1.91 bios update already. Not sure what might be causing this but I want both CPUs working like before. Any help would be appreciated.
    This is the first time this board has been used. I pulled it out of the box this morning. It is a refurbished board from MSI. The other board with the dried out capacitors ran both CPUs fine without issue but I had data transfer issues so had to replace it. The newest bios available for this motherboard appears to be award bios v1.91 which is the one I have.
    If any further info is needed let me know what else you need. (I am on the computer having troubles right now but with only 1 CPU running - works fine albeit a bit slower)

    Okay. Power supply info. Had to break my system down because the side that had the info on it was covered by the top of the tower.
    Enhance Electronics
    Model: ATX-1140F with Outlet
    400 Watt Power Supply
    +3.3v(28A), +5V(38A), +12V(18A), -12V(.8A), -5V(.5A), +5VSB(2A)
    The 4 pin connector is plugged in. =) I did not overlook that.
    As for trying it with fewer memory sticks, no I have not tried that but keep in mind that earlier today the previous mobo was in this machine and running with both CPUs and all 3 memory sticks (512, 512, 1024). All in the same memory slots as the original mobo. I pulled each one and inserted it in the new mobo before taking out the next one to be sure I put them back in the same slot.
    I checked and double checked all the bios settings and they match. The only thing that has changed since this morning is the replacement mobo and that is the exact same model as the one I replaced. System works fine with 1 CPU but not with 2. What might cause that on this motherboard but not the original one?

  • MOVED: Won't run with 2 CPUs

    This topic has been moved to Server/workstation.
    Won't run with 2 CPUs

    Okay. Power supply info. Had to break my system down because the side that had the info on it was covered by the top of the tower.
    Enhance Electronics
    Model: ATX-1140F with Outlet
    400 Watt Power Supply
    +3.3v(28A), +5V(38A), +12V(18A), -12V(.8A), -5V(.5A), +5VSB(2A)
    The 4 pin connector is plugged in. =) I did not overlook that.
    As for trying it with fewer memory sticks, no I have not tried that but keep in mind that earlier today the previous mobo was in this machine and running with both CPUs and all 3 memory sticks (512, 512, 1024). All in the same memory slots as the original mobo. I pulled each one and inserted it in the new mobo before taking out the next one to be sure I put them back in the same slot.
    I checked and double checked all the bios settings and they match. The only thing that has changed since this morning is the replacement mobo and that is the exact same model as the one I replaced. System works fine with 1 CPU but not with 2. What might cause that on this motherboard but not the original one?

  • Application running slowly under Hyper-V (factor of 100 times slower)

    I have an application running in a non virtual Windows Server 2008R2/SP1 environment.  It processes about 60,000 records from an indexed file (about 20MB in length) in about a second running in that environment.  I want to move the application
    to a Hyper-V virtual server also running Windows Server 2008R2/SP1.  When I do so, the application runs, but processing the same file takes almost 2 minutes.
    The application is the only thing running in the virtual machine and the virtual machine is the only VM running on the physical box.  The VM is configured with a single processor, 2048M of fixed (not dynamic) memory and a fixed size disk of 255GB. 
    There is no network traffic so the single network connection is not used.  The physical machine is a quad core with 8GB of memory and two 1TB drives that are less than 1/4 used in each case.
    Now for the weird part.  The application runs from the command line.  If I start it and do nothing else, it takes about 2 minutes to complete its process.  But, if I start the application, switch focus to another window on the virtual
    machine then switch back, the process completes immediately upon switching back to the command line window.
    Any thoughts?

    The VM is configured with a single processor - The physical machine is a quad core
    Do you mean the physical machine that was running the application has a quad core processor?  If not, what did the physical machine running the application actually have?  Is the application multithreaded so that it can make use of multiple processors? 
    Did the application in the physical world have OS and data on the same disk or on different disks?  Did you run this application shortly after you started the VM, or did you let the system quiesce a bit?  Did you measure performance on the physical
    under the same sort of conditions?  Are you running from a cmd window or PowerShell?  (Your comment about clicking away and coming back brings to mind things I've seen with PowerShell)  Does it run quickly on a second instantiation, or does
    it run poorly every instantiation?
    Determining performance requires a lot more information than what you provided.
    I always assign at least two virtual CPUs to any Windows Server VMs.  There are enough system processes running on the box that two processors will almost always benefit the workload.  Also, it it not uncommon that the first run of an application
    shortly after a machine has started will never perform as it will after a machine has settled in.  This is why every benchmark worth its salt will start the benchmark and let it run for a few minutes before they actually start measuring.
    .:|:.:|:. tim

  • Vhost configuration for Adobe Media Server running under linux.

    Please help me with Vhost configuration for Adobe Media Server running under linux.
    I was running a media sharing website for which I wanted to use Adobe Media Server.
    To use, AMS, I disabled the already installed Apache server and installed AMS along with the built in Apache server. I could successfully install AMS and could login to AMS Admin Console through my IP number.
    My existing website, www.mydomain.com is having its contents located at:
    /home/mydomain/public_html
    (Directory created under the old version of Apache not bundled with AMS)
    Users will be uploading their videos, which will get transcoded and will be delivered to the website visitors in the existing scenario.
    To use this website with AMS, this is what I did:
    I created a folder for my domain, www.mydomain.com as below
    /opt/adobe/ams/conf/_defaultRoot_/www.mydomain.com
    Copied Application.xml and Vhost.xml from /opt/adobe/ams/conf/_defaultRoot_/   and pasted them in /opt/adobe/ams/conf/_defaultRoot_/www.mydomain.com
    In the Application.xml file there are 2 entries:
    <Alias name="mydomain.com"></Alias>
    <AppsDir>${/home/mydomain/public_html}</AppsDir>
    Please help me with further steps to be completed:
    Do I need to create a separate VirtualHost entry in the Apache installed with AMS?
    If yes, can I specify already existing document root for my website (/home/mydomain/public_html) or do I need to create a separate folder under webroot/Apache ?
    If yes to point 2 above, then do I need to copy all the existing contents from /home/mydomain/public_html to the newly created folder ?
    I hope, I can serve all my static contents like html pages and php and media like video/audio. In that case do I need create alias to my Media/Alias folder or AMS will automatically start streaming when a video/audio is requested ?
    What other steps do i need to complete?
    Any help in this regard would be highly appreciated.
    Thanks and Regards

    Dear sir or madam,
    Here is Letswin Technology, which specializes in global servers, web hosting, VPS, VPNj. If anything I can do for you, pls contact us!
    Have a nice day!

  • Java applications under Linux

    Hello all
    I want to share my experience with all about programs generated by Oracle Forms and running under Linux and ask for help.
    We are developing systems under Oracle Forms to Windows, but some customers had restrictions with that operational system, then we had implemented IAS to run, under Java, the same applications.
    Under Windows we have no problems, we just install JInitiator to made fast to charge/open the classes.
    Under Linux we had not JInitiator and the solution is to implement a Proxy server.
    In this test the first problem we had was a IP that the system can not resolve, looking for the solution on web, we found that it´s solved inserting this line in java.policy:
    permission java.net.SocketPermission "200.204.0.1:9000-", "resolve";
    But we had not to implemented the proxy server, after implement this other problem just stuck us.
    The system just not show any error message and are not hang, but never open de login dialog.
    Some one already had this kind of problem?
    Could exist a difference between Linux configuration and Windows configuration to Java?
    Well, thanks in advance...
    []´s
    Arthur

    javac -classpath logger.jar:. rootPackage/MainClass.java
    java -classpath logger.jar:. rootPackage.MainClass

  • Running database control of a remote 10g database under linux

    Hi,
    I have a question. I installed oracle 10g on my windows PC as well as on a remote server which is on linux. For both the databases, I can run DatabaseControl by entering a similar kind of URL in my browser (just server name is different, all other parts of URL are same).
    Now, when I tried to run the DatabaseControl for some other oracle 10g servers (also under linux), I am getting the error "The page cannot be displayed". This means that the services to run database control are not available on the remote server. Can someone please tell me what setups and services are required on those servers so that I can run their DatabaseControl from my PC's browser. (Please give me the step-by-step instructions of what needs to be done on remote
    servers) - Thanks.

    But that does not explain why emctl does not exist. Existence of emctl file is not dependent on whether DB Control is created on or not.
    Whether you ticked using DB Control or not, the Server is installed with Enterprise Manager by default. You do not need to run OUI to create the Database Control (Db Console). You only need to run emca to create the dbconsole.
    But the problem here is that they cannot see emctl. Which brings me to the question of whether they are actually on the right ORACLE_HOME or box
    If the Database was installed in the Linux box and the client on the PC, the emctl should be on the Linux box and not on the PC. If you have more than one ORACLE_HOME, then you need to ensure you are on the correct ORACLE_HOME

  • SSO to partner application running under IIS

    Hi,
    We have a complete set-up for 9iAS Release2 where some applications are running. In parallell we have an application running under IIS, and would now like to enable the IIS application as a partner application to 9iAS letting the 9iAS SSO server handle the authentication.
    In the documentation of Oracle Proxy Plug-in I read that this proxy plug-in can be used to proxy requests from IIS to Oracle http server (OHS) and also in this way enable SSO.
    My question is if this can be done only for applications running under 9iAS but having IIS as web server, or if it is also possible like in our case to enable SSO via the proxy plug-in to applications runnind under IIS?
    If this is not supported is the only available solution to use the SSO SDK in my IIS application?
    Thanks and regards,
    Rikard

    Here's a DIY answer.
    See Metalink Note 269820.1 which shows you how to use Perl to overwrite the host name in the HTTP header and remove the port number.

  • Flex application running under AIR takes a long, long time to start.

    I have a flex application which runs on a desktop under AIR. The application has an assets folder with 3,500 mp3 soundclips totalling about 50MB. The problem is, the application takes around 90 seconds to load. I'm sure that AIR is scanning the application folder and doing something with the contents because if I delete the assets folder it loads in about 5 seconds. Does anyone know why AIR/Flex would do this, and why it doesn't exhibit the same problem if I run or debug in Flexbuilder on eclipse? It's making my killer app unusable!
    Thanks
    Paulo

    Well, I've spent a bit longer looking at this now, and the problem appears to lie with my encrypted local store. The first thing that happens is for the app to read the product key from the ELS. But, it fails (for some unknown reason). So, the app seems to hang there for 90 seconds until it eventually renders the welcome screen. If I remove the assets folder it still fails to read from the ELS, but only takes a couple of seconds to start the welcome screen. This is where the scanning of the application folder seems to come into play, because if I remove the code which reads from the ELS the app starts within 2 seconds whether the asset folder is there or not.
    I think the slow startup and the scanning of the assets folder are just symptoms of a different problem, i.e. a problem with the ELS. I don't have the same problem with my development environment though - it's only when I test deploy the application.
    Thanks for your help on this problem EgorKDie. I think I should be able to resolve it once I can sort out why the ELS is being awkward.

  • Loss of keyboard focus in Java appl running under linux

    I have a small sample program that replicates my problem. When this program is run a window is created. If you select File->New another instance of the program window is created. Now if you try to go back and bring to front the first window, keyboard focus is not
    transferred when run under linux. You can only type in the second window. The expected behavior does happen in Windows.
    > uname -a
    Linux watson 2.6.20-1.2933.fc6 #1 SMP Mon Mar 19 11:38:26 EDT 2007 i686 i686 i386 GNU/Linux
    java -versionjava version "1.5.0_11"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
    Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
    javac -versionjavac 1.5.0_11
    import java.awt.event.*;
    import javax.swing.*;
    class SwingWindow extends JFrame {
        SwingWindow() {
         super("SwingWindow");
         JMenuBar menuBar = new JMenuBar();     
            JMenu fileMenu = new JMenu("File");
            JMenuItem newItem = new JMenuItem("New");
            newItem.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) {
              SwingWindow.createAndShowGUI();
         fileMenu.add(newItem);
            menuBar.add(fileMenu);
            setJMenuBar(menuBar);
            setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);       
         JTextField text = new JTextField(200);
         getContentPane().add(text);
         pack();
         setSize(700, 275);
        public static void createAndShowGUI() {
            JFrame frame = new SwingWindow();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    You can implement the FocusListener interface. When
    the first JFrame gains focus, call
    text.requestFocusInWindow(). I hope this helps.The call requestFocusInWindow is not helping, perhaps even making it worse.
    The problem seems to be that I am in the situation where the call
    KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner()
    is returning the expected Component. The problem is that the KeyListener class that is registered with the Component is not being called when a key is being pressed.
    The issue is that I have a component that has the keyboard focus, but the KeyListener class
    is not responding.
    This seems to be a linux only problem which makes it only mysterious.

  • Application Runs Under Windows 8.1 But Not Under Windows XP (I Know XP Is Deprecated)

    The problem is with the obtuse error message put out by Windows's program loader. It reads, in part, "..is not a valid Win32 application." The application runs everywhere except on Windows XP. Looking for root cause of the problem. It's a very
    simple application. Only a few lines of code. 
    C:\Packaged-Software\32-BIT\Reboot.exe is not a valid Win32 application.
    Proposed nature of the problem:
    1. The file was downloaded from a website but the download was incomplete.
    2. The full file system filename path contains bad characters such blank space.
    3. Visual Studio constructed an application that won't run anywhere much less on XP.
    4. The supporting libraries are not properly installed (e.g. .NET Framework4, and VCREDIST).
    Retorts:
    1. The file wasn't downloaded from a website and is intact.
    2. The filename path doesn't contain any spaces.
    3. The application runs under Windows 8.1.  Also on Windows 7.
    4. The supporting libraries are properly installed.
    So, what's the problem?  One surely will not discover the root cause from "not a valid application."
    Body must be 4 to 60000 characters long.  I had put the code here.  It isn't 60000 character long.  But it validated as if there are more than 60000 characters.  Sorry for the incomplete submission due to website construction error.
    MARK D ROCKMAN

    Hi F7H2fw,
    How did you develop the application ?
    Here is a similar symptom and this may explain the issue somehow:
    Setup.exe is not a valid Win32 application
    http://blogs.msdn.com/b/vsnetsetup/archive/2012/10/16/setup-exe-is-not-a-valid-win32-application.aspx
    I suspect there is a compatibility issue here .
    Considering this is more likely a developing issue .It is recommended to ask for help from our MSDN Forum .They are more familiar with the developing issue .If it is possible ,please attach the code in that thread .Thanks for your understanding and cooperation.
    MSDN Forum
    https://social.msdn.microsoft.com/Forums/en-US/home
    Best regards
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Opening a Powerpoint in JSP and run under Linux

    Hi,
    I need to have a JSP page that provides a link to open a powerpoint file and this JSP is to be run under Linux. When I try to click on the link in Linux to open the powerpoint, it gives me a lot of junk characters. Can somebody please help mi, thanks a million!

    You have the mimetype for the HTTP response set to something other than what will make the browser start a powerpoint viewer and direct the content of the HTTP response to it.
    In your jsp use the setHeader(String key,String key) method to set the value of "Content-Type" to the mimetype for powerpoint.
    Of course the users must have browsers that are configured to launch a powerpoint viewer or plug-in. If you provide the correct mimetype and peoples browsers desn't have this, then they will get the "save to file" dialog box.

Maybe you are looking for