Openmp Multithread programing in Sun Studio 12

Hello Folks,
My name is Glauber, I'm begging in openmp programming.
I'm doing some tests with Sun Studio 12 and c++ language, then I'd like to run a helloworld.cc code using 4 threads but I get only 1 thread.
I've used "omp_set_num_threads(4)" inside my code but, even so, I don't get more than 1 thread.
Could an openmp expert help me?
Cheers,
Glauber

This should help:
omp_set_dynamic(0);Alternatively you can set OMP_DYNAMIC environment variable to FALSE.
This will command openmp runtime to stop being smart and not adjust user-specified threadnum value.
regards,
__Fedor.

Similar Messages

  • Error in compiling boost example program using sun studio 12

    I am trying to compile the below example program from boost using sun studio 12 C++ compiler.
    #include <boost/interprocess/shared_memory_object.hpp>
    #include <boost/interprocess/mapped_region.hpp>
    #include <cstring>
    #include <cstdlib>
    #include <string>
    int main(int argc, char *argv[])
    using namespace boost::interprocess;
    if(argc == 1)
    {  //Parent process
    //Remove shared memory on construction and destruction
    struct shm_remove
    shm_remove() { shared_memory_object::remove("MySharedMemory"); }
    ~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }
    } remover;
    //Create a shared memory object.
    shared_memory_object shm (create_only, "MySharedMemory", read_write);
    //Set size
    shm.truncate(1000);
    //Map the whole shared memory in this process
    mapped_region region(shm, read_write);
    //Write all the memory to 1
    std::memset(region.get_address(), 1, region.get_size());
    //Launch child process
    std::string s(argv[0]); s += " child ";
    if(0 != std::system(s.c_str()))
    return 1;
    else
    //Open already created shared memory object.
    shared_memory_object shm (open_only, "MySharedMemory", read_only);
    //Map the whole shared memory in this process
    mapped_region region(shm, read_only);
    //Check that memory was initialized to 1
    char mem = static_cast<char>(region.get_address());
    for(std::size_t i = 0; i < region.get_size(); ++i)
    if(*mem++ != 1)
    return 1; //Error checking memory
    return 0;
    Using the below command :
    CC -c 1.cpp -I/home/syogacha/satish/boost_1_43_0 -library=stlport4
    "/home/syogacha/satish/boost_1_43_0/boost/interprocess/shared_memory_object.hpp", line 284: Error: The function "shm_open" must have a prototype.
    "/home/syogacha/satish/boost_1_43_0/boost/interprocess/shared_memory_object.hpp", line 307: Error: The function "shm_unlink" must have a prototype.
    "/home/syogacha/satish/boost_1_43_0/boost/interprocess/mapped_region.hpp", line 549: Error: Formal argument 1 of type char* in call to shmdt(char*) is being passed void*.
    3 Error(s) detected.
    I even tried to include sys/mman.h but got the same compilation errors.
    Do we need to take care of few other specific things while using boost headers.
    Thanks in advance ...

    Hope this helps....
    #include <sys/mman.h>
    #include <boost/interprocess/shared_memory_object.hpp>
    #include <boost/interprocess/mapped_region.hpp>
    #include <cstring>
    #include <cstdlib>
    #include <string>
    #include <iostream>
    #include <iterator>
    int main(int argc, char *argv[])
    {      //main
            using namespace boost::interprocess;
            if(argc == 1)
            {  //Parent process
                    //Remove shared memory on construction and destruction
                    struct shm_remove
                            shm_remove() { shared_memory_object::remove("MySharedMemory"); }
                            ~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }
                    } remover;
                    //Create a shared memory object.
                    shared_memory_object shm (create_only, "MySharedMemory", read_write);
                    //Set size
                    shm.truncate(1000);
                    //Map the whole shared memory in this process
                    mapped_region region(shm, read_write);
                    //Write all the memory to 1
                   std::memset(region.get_address(), 1, region.get_size());
                    //Launch child process
                    std::string s(argv[0]); s += " child ";
                    if(0 != std::system(s.c_str()))
                    return 1;
            else
                    //Open already created shared memory object.
                    shared_memory_object shm (open_only, "MySharedMemory", read_only);
                    //Map the whole shared memory in this process
                    mapped_region region(shm, read_only);
                    //Check that memory was initialized to 1
                    char *mem = static_cast<char*>(region.get_address());
                    for(std::size_t i = 0; i < region.get_size(); ++i)
                    if(*mem++ != 1)
                    return 1;   //Error checking memory
            return 0;
    }

  • Sun Studio 11 "Warning (Anachronism)"

    Hello,
    Compiling a C++ program using Sun Studio 11 compiler on Solaris, I get warnings like this:
    Warning (Anachronism): Using blabla(*)(<params>) to initialize extern "C" blabla(*)(<params>).
    For example, this happens passing a callback of type jvmtiHeapObjectCallback to IterateOverHeap (both defined in Sun's jvmti.h):
    typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
    (jlong class_tag, jlong size, jlong* tag_ptr, void* user_data);
    jvmtiError (JNICALL IterateOverHeap) (jvmtiEnv env,
    jvmtiHeapObjectFilter object_filter,
    jvmtiHeapObjectCallback heap_object_callback,
    const void* user_data);
    What does this warning mean?
    I checked that JNICALL is defined in Solaris jni_md.h as empty string, so it seems strange for me that the compiler wants extern "C" here.
    The same code compiles with no problems on Solaris with gcc, as well as with Visual Studio on Windows and with gcc on Linux and Mac.
    Best regards,
    Anton

    Thank you for your prompt reply.
    In the guide, it is said:
    "The Sun implementation of C and C++ function linkage is binary-compatible. That is not the case with every C++ implementation, although it is reasonably common".
    I believe that for all other platforms that we support - Linux, Mac OS X, Windows - the only difference in C and C++ linkage is C++ name mangling.
    I'm not 100% sure (just curious, do you know any implementations where C and C++ functions are not linkage compatible?), but there never were runtime problems with such C/C++ function mixing in our code.
    Actually, the mixing happens in our code because we declare class with single static function (callback implemetation) right in the function where function requiring callback parameter is used. This is similar to Java anonymous classes, and helps to write simpler code (especially when callback code is short, and there are many different callbacks in different places of the code):
    void qqq() {
    struct Tmp {
    static void myCallback() { ... }
    foo(&Tmp::myCallback);
    So, unfortunately, the offered solutions (wrapping) will not work in our case, unless we simply rewrite our callbacks as regular C functions.
    Is there a compiler option (or a pragma) to suppress this warning?

  • Trouble viewing disassembly with Sun Studio 11

    I was wondering how someone can bring up a window with a program�s disassembly when debugging a C program with Sun Studio 11. (SPARC). I would like to be able to set breakpoints at specific assembly instructions using Sun Studios�s GUI interface rather than using typed commands with DBX. I would also like to know how to get a window that shows the current value of the registers. Any help would be greatly appreciated.
    Chris

    Oops, it appears that you can't set breakpoints
    through Disassembler window, it just shows the code
    and current position within the code, that's all.It
    gives you better view of context than dbx's 'dis' or
    'list -i' commands, though.Actually you can set breakpoints through Disassembler window:
    - select an address, click right mouse button to open context menu
    - choose "Set Breakpoint"
    If you need this feature, please file an RFE (Request
    For Enhancement) through bugs.sun.comThe Disassembler window has been significantly improved between
    EA1 and FCS. Now users can set and delete breakpoints using the
    same way as they do in source file - click on the left gray area (toggle
    breakpoints). Also Disassembler window has "Step Into", "Step Over",
    "Step Out" and "Run To Cursor" buttons.
    Thanks,
    Nik

  • Sun Studio MPI Tracing in OpenMPI?

    Hello all,
    I recently downloaded an installed Sun Studio 12.1 on a RHEL 5.5 system running OpenMPI. I didn't see anything mentioned on the OpenMPI website or the documentation from Sun that I've looked through so far relating to the MPI tracing flags that need to be issued with the OpenMPI installation.
    When I invoke analyzer test1.er/ it says that Warning: no MPI tracing data file in experiment...MPI Timeline and MPI Charts will not be available.
    Is there a build flag or configure flag I need to add to the OpenMPI installation to get this option to work? Any advice on getting the MPI tracing to work is appreciated. Also, it may be useful to note that I am trying to analyze a pre-compiled MPP program that I do not have the source to. Thanks.
    Edited by: raw19896 on Jul 13, 2010 4:05 PM
    Edited by: raw19896 on Jul 13, 2010 4:23 PM

    Ok just tested it with the Hello_C program that comes with OpenMPI.
    The test goes ok, there are a few warnings when I open analyzer though. It says basically that there were "too few clock-profile events (##) in experiment # (Processor #) for statistical validity
    The MPI Trace and MPI Timeline windows did not come up by default but are up now that I enabled them through the menu again and it seems to work perfectly with the Hello_C program so I will try it with verbose mode on our FEA software to see what is going on specifically.
    Update:
    When I run in verbose mode I see lines upon lines of VampirTrace:Tracing switched off at call stack level (2) multiple times and then immediately after it VampirTrace: Tracing switched on multiple times. This goes back and for well over a thousand lines interrupted sometimes by output form the FEA software.
    Edited by: raw19896 on Jul 14, 2010 7:28 AM
    Edited by: raw19896 on Jul 14, 2010 7:47 AM

  • Sun Studio 12 Update1 and OpenMP

    Hi guys,
    I was using the Sun Studio 12 with OpenMP and everything was OK. So I decide to download the update 1 (which is OpenMP 3.0 full compliance), however I am getting linking error.
    Below is the message:
    Undefined first referenced
    symbol in file
    __mt_MasterFunction_cxt_ build/Debug/SunStudio_12.1-Solaris-x86/a1.o
    I look into my libmtsk.so libraries and I could see that __mt_MasterFunction_cxt_ really does not exist.
    So I believe this is a bug on Sun Studio 12 Update 1 that didn't install the last library. Anyway, I am try to find out where to get this library or any patch to it. I did try to get the patch 120754. However the site is pointing that I has no support contract. What is true just because I am a student, and I am just learning things for now...:-)
    Hope someone can help me with that..
    Thanks and Regards

    I cannot download any patch because I do not have any support contract.Last time I tried, Solaris patches were free, at least those related to compiler components.
    Byt the way, I rarely install the product myself, but I had an impression that Solaris version comes together
    with patches, which are intended to be installed right upon the installation.
    I'm sorry for the lost hours of precious time, but that seems to be more like your navigational error,
    rather than the intentional attempt from Sun to decieve you.
    Believe me or not, we made Sun Studio free because we want developers to use it, not because
    we hope to catch you offguard and cut some money.
    I should get opensolaris if I want a "linux like license and support"And that is true.
    If you do not like the way Solaris patches are managed (and, many think that it is a mess) you might better like Opensolaris.
    You also might want to try Linux version, it is as close to Solaris version functionality-wise as possible.
    I will just uninstall my sun studio 12 update 1 and go back to the sun studio 12 (where no patches are needed to run the openmp 2.5).Sun Studio 12 got no interface change thus no patches were needed to run OpenMP 2.5 as soon as you have libmtsk.so installed.
    Quite contrary, SS12u1 got OpenMP 3.0, which is substantially different to OpenMP 2.5 and that warranted interface change in runtime support
    (libmtsk.so).
    Trying to create "partial open source" things is not that good. First, it is not open source yet :-), it is just free.
    Then, if we would do partial thing (which is not that bad per se, surely depending on how you do it), that would definitely be written in caps all around.
    And broken functionality is definitely not the way Sun does its business.
    regards,
    __Fedor.

  • Recommendation for new features in next Sun Studio releases

    Hello,
    I have started using the Sun Studio Express recently and as a feedback to your opening to receive proposals to new features in the next releases of the Sun Studio collection I would want to point some aspects of interest to the programmers in writing good software for embedded systems and not only.
    First of all, with regards to the subject of great interest to me in this moment, multicore/multiprocessor parallel programming, I would appreciate the following :
    - if the compiler would be extended with new directives to allow the programmer to measure the load of each core and/or processor that is available to him.
    - if the compiler would be extended with directives to allow the programmer to get the core ID on which a specific section of code is executed. As en example consider o multithreaded application and in the associated function for each thread read the core ID and function of this value perform specific actions.
    - if the compiler would be extended with directives to allow the programmer to get the ID of the processor in the system - supposing a specific system has many multicore processors. (I don't know if this is possible).
    - if the compiler would be extended with directives to allow the programmer to specify the core and/or processor on which it wants to be executed a specific process,thread,function,(maybe instruction).
    With these macros I think a lot of things can be exercised, one that I think in this moment is the posibility for the programmer to implement his own algorithm of load balancing for the cores and processors of his system.
    Another point I would recommend would be that the watch window in the Sun Studio IDE to permit the selection of the format in which the data to be displayed.As an example if I have a U32 variable to be able to select in the watch window the integer ,hexadecimal or binary format in which I would want to be displayed.
    Another useful thins that I sought at other IDEs would be a popup window or something similar to select how to see the source code: as a .c file , as an assembler code , or as a mixture of C and assemble.
    That's all for the moment, if I see something else I would post another message.
    Thank you,
    Steve.

    steveg wrote:
    First of all, with regards to the subject of great interest to me in this moment, multicore/multiprocessor parallel programming, I would appreciate the following :
    - if the compiler would be extended with new directives to allow the programmer to measure the load of each core and/or processor that is available to him.
    - if the compiler would be extended with directives to allow the programmer to get the core ID on which a specific section of code is executed. As en example consider o multithreaded application and in the associated function for each thread read the core ID and function of this value perform specific actions.
    - if the compiler would be extended with directives to allow the programmer to get the ID of the processor in the system - supposing a specific system has many multicore processors. (I don't know if this is possible).
    - if the compiler would be extended with directives to allow the programmer to specify the core and/or processor on which it wants to be executed a specific process,thread,function,(maybe instruction).
    With these macros I think a lot of things can be exercised, one that I think in this moment is the posibility for the programmer to implement his own algorithm of load balancing for the cores and processors of his system.
    These are OS functions, not compiler's. Solaris has a wide selection of ways and tools to assign processes and threads to cpus; processor_bind(2) is a function you can call and pbind(1M) is a tool you can use on a running app. There are more, just google for it.
    Another point I would recommend would be that the watch window in the Sun Studio IDE to permit the selection of the format in which the data to be displayed.As an example if I have a U32 variable to be able to select in the watch window the integer ,hexadecimal or binary format in which I would want to be displayed.
    Good point. I'll check if there already is an RFE (Request For Enhancement) filed and file one if it's not. Thanks for letting us know!
    Another useful thins that I sought at other IDEs would be a popup window or something similar to select how to see the source code: as a .c file , as an assembler code , or as a mixture of C and assemble.
    But there is disassembly window already. See screenshot here: http://developers.sun.ru/images/stories/sunstudio/images/sun_studio_dbx.png

  • Sun Studio 11- Now Available (and FREE)

    Howdy,
    Today, Sun announced the availability of Sun Studio 11, the latest release of our venerable set of optimizing compilers and tools. We are very excited about this release for many reasons, including:
    * Record-setting optimizing C,C++,Fortran compilers
    App performance =� Platform + OS + Compilers/Tools
    Using the latest SPARC/x64/x86-systems and Solaris/OpenSolaris versions is great. But to get maximum performance for your app, you need to upgrade to Sun Studio 11.
    http://www.sun.com/software/products/studio/benchmarks.xml
    * Exploits multicore (CMT) systems for maximum throughput performance
    - Multicore optimizations (UltraSPARC, x64)
    - OpenMP 2.5 support with autoscoping across all compilers
    - Support for OpenMP/Solaris/Posix threads in debugger & performance analyzer
    - Dataspace profiling provides hardware and program views into the performance costs associated with application memory references
    * Providing Platform Choice: Solaris 8,9,10 (SPARC, x64, x86) and RHEL 4/SLES 9
    - Optimizing compilers with Solaris versions only
    - Linux version has debugger, performance analyzer, IDE, etc.
    - Technology preview of Linux compilers:
    http://developer.sun.com/sunstudio/linux
    * FREE, unrestricted license (no gotchas)
    Sun Studio has been a good and growing business for Sun, but our intent is very transparent with this pricing model change- we want to accelerate the adoption of Solaris and Sun Studio.
    Download Sun Studio 11 today:
    http://developers.sun.com/sunstudio/download
    Thanks!
    /kso
    PS. See what these 2 guys think of Sun Studio 11:
    (apologies to those who are unable to view real streams)
    http://webcast-east.sun.com/ramgen/archives/VIP-2199/VIP-2199_01_300.rm

    In reading the click-thru license, I came across the following in section 5(i):
    "Software may contain programs that perform automated collection of system data and/or automated software updating services. System data collected through such programs may be used by Sun, its subcontractors, and its service delivery partners for the purpose of providing you with remote system services and/or improving Sun's software and systems."
    Does this mean that the software will phone home to the 'mother ship' and report on my utilization? It seems to be worded in such a way as to be able to send my hardware configuration and other things that I may not want to share with Sun.

  • Sun Studio Express 3/09 Now Available!

    Sun Studio Express 3/09, the official build used for the Sun Studio 12 Update 1 Early Access Program, is now available for download:
    http://developers.sun.com/sunstudio/downloads/express/index.jsp
    The Sun Studio Early Access build is available on Solaris, OpenSolaris and the latest Linux distributions (Red Hat Enterprise Linux, SuSE,Linux Enterprise, CentOS, Ubuntu). Feature highlights since the Sun Studio 12 release include:
    * C/C++/Fortran compiler optimizations for the latest x86 architectures from Intel and AMD including SSSE3, SSSE4a, SSe4.1, SSE4.2 compiler intrinsics support
    * C/C++/Fortran compiler optimizations for the latest UltraSPARC and SPARC64-based architectures
    * DLight - New tool to utilize and visualize the power of Solaris Dynamic Tracing (DTrace) technology
    * dbxTool - New stand-alone GUI debugger
    * Full OpenMP 3.0 compilers and tools support
    * MPI performance analysis in the Performance Analyzer
    * NetBeans IDE 6.5 including new remote development features
    These new features are all described in the README and wiki pages:
    * March 2009 Express README:
    http://developers.sun.com/sunstudio/downloads/ssx/express_March2009.html
    * Wiki pages:
    http://wikis.sun.com/display/SunStudio/Sun+Studio+Express+March+2009+Release
    We are exited to hear your feedback on the new features/enhancements in this Early Access build and encourage your participation in the Sun Studio 12 Update 1 Early Access Program so that we can gather valuable feedback to assess the readiness of our release.
    Sun Studio 12 Update 1 Early Access Program:
    http://developers.sun.com/sunstudio/overview/earlyaccess/index.jsp
    View the Sun Studio Express 3/09 podcast to learn more: http://mediacast.sun.com/users/ikroopdhillon/media/sunstudioexpress0309/details
    Thanks,
    Ikroop Dhillon

    Hi,
    we are currently using SunStudio 12. I have noticed that early access product, SunStudio Express, Feb2008. It seems that new features coming from NetBeans 6.0 have contributed to SunStudio IDE. I prefer to use SunStudio Express IDE. But i have also noticed that sun CC compiler version is also different. Actually it is no surprise, since SunStudio is a complete product composed of compilers, tools and IDE.Now, i am quite doubtful whether we should use SunStudioExpress. That's why i want to learn when official new release for SunStudio will be announced.
    Though i have searched internet, i couldn't notice any news about the next official release of Sun Studio( Sun Studio 13 ). When will this early release( SunStudio Express, Feb 2008 ) be released as SunStudio13? What is the release roadmap of SunStudio?

  • Patches for  Sun Studio 12 Update 1

    Dear all,
    I have recently installed Sun Studio 12 Update 1 on an x86 system and have some questions pertaining to the required patches. According to my understanding of the text on the homepage for SS12U1 (http://developers.sun.com/sunstudio/downloads/patches/ss12u1_patches.jsp) it should be possible to download these also without a service contract, but this does not seem to be possible. The SunOS 5.10_x86: Microtasking libraries (libmtsk) patch 120754-6 distributed with the SS12U1 does not seem to be sufficient for 64-bit OpenMP programs. For correct functionality of the compiler patch 120754-7 appears to be needed.
    My question thus is if it should be possible to access the required Sun Studio 12 Update 1 patches without a service contract?
    Any help regarding this is highly appreciated.

    Tthe recent lockdown of all patches by Oracle, making them available only under a support contract, makes the issue of Sun Studio 12.1 patches discussed here quite important. If 120754-07 is required for proper SS12.1 functionality, then users without support contracts must not upgrade their systems to more recent Solaris versions, as SS12.1 will have to be re-installed, and the 07 patch will be unavailable. When will SS12.2 or SS13 (?) be released? If Oracle really wants to make some money, they will never release any further SS updates, thus requiring customers to buy contracts to get the darn patch.
    Check these prices for SS support contracts:
    Sun Studio 12 Update 1 Standard Sun Software Service Plan 1-year
    $1,015.00
    Sun Studio 12 Update 1 Premium Sun Software Service Plan 1-year
    $1,218.00
    http://developers.sun.com/sunstudio/downloads/index.jsp

  • Sun Studio Debugging problem

    Hello
    I need help configuring the Sun studio debugger to work in fedora 8. The project is loaded from a make file, compiles fine, and runs fine. However, I can not place break points, and when I start the visual debugger, it gives a message box titled progress, and hangs on saying: starting debugger: /lib/libc.so.6
    Running from the command line gives me:
    $dbx <my program>
    For information about new features see `help changes'
    To remove this message, put `dbxenv suppress_startup_message 7.6' in your .dbxrc
    Reading <my program>
    Reading ld-linux.so.2
    Reading libm.so.6
    Reading libmpich.so.1.1
    Reading libpthread.so.0
    Reading librt.so.1
    Reading libc.so.6
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: warning: unknown location expression code (0xe0)
    dbx: panic: "ThreadAgent::setup_helper"(): Assertion (ta_td_agent) failed - "thread.cc":2674
    I have another problem in debugging an mpi problem in another installation of Sun Studio on Solaris 10 on a Sun machine. The visual debugger is working fine there, however, I need to debug with mpirun
    to decide the number of processors, because by default it loads the application on one processor. Iwill need to do this as well later on the linux machine I am using now, which doesn't even start the debugger on a sequential code so far.
    I appreciate your help a lot.
    Thank you very much in advance.
    Manal

    mhelal wrote:
    Hi
    Thank you for your reply. you said 2 problems,Yes, basically I meant these two:
    1. dbx: warning: unknown location expression code (0xe0)
    2. dbx: panic: "ThreadAgent::setup_helper"(): Assertion (ta_td_agent) failed - "thread.cc":2674
    First one should be fixed in dbx itself, but the second looks like an incompatibility between Fedora's libc and dbx; unless distros in "supported" list upgrade to the same version of libc, dbx can't be changed to match it.
    In other words, I'm sorry to say that you will probably not succeed in using dbx on Fedora 8 for the time being.

  • General and specific questions on the applicability of Sun Studio 11

    Hi. In an e-mail letter from Sun Microsystems I read about Sun Studio 11 to "utilize its record-setting parallelizing compilers." From this message I was attracted by the possibility of adding something like parallel processing, not by changing the processor (hardware), but by adding Sun-Studio-11 software to a Linux operating system. Now I already have a Fortran compiler, the Intel Fortran Compiler for Linux, which is free and can handle Cray-style pointers, a feature hard to find in a free Fortran compiler.
    1a. So for the most basic of questions, without having parallel-processing hardware, just an ordinary processor [a 1-GigaHertz (GHz) Advanced MicroDevices Duron central processing unit, in my case], is it possible to have parallel processing and thereby increase one's computing speed by installing Sun Studio 11 in a Linux operating system?
    1b. If so, by what factor could one expect the speed of computation to increase over not having Sun Studio 11 installed? (If the gain in speed is dependent on the type of computations being performed, I imagine possibly using a Fortran code to perform numerical calculations using and perhaps searching for minima or maxima in a two-or-more-dimensional surface. So please give me an idea of the sort of gain in speed one could expect for these two types of activites, calculations using formulas and searches for minima and maxima among already-computed quantities.)
    1c. Again if so, how could one just by adding software have parallel processing without two or more hardware processors? In other words, what is the basic working principle of the software to make the simultaneous performance of multiple tasks (multitasking or parallel processing) possible?
    2a. Does Sun Studio 11 include a Fortan compiler?
    2b. If so, must one use it to have parallel processing with Sun Studio 11?
    2c. Or will the Intel Fortran Compiler for Linux work with Sun Studio 11 to have a parallel processing capability?
    Concerning hardware requirements I read that Sun Studio 11 requires a minimum of 512 MegaBytes (MB) of memory, presumably Random Access Memory (RAM). My Hewlett-Packard, ZE1110, Pavilion, notebook computer has 256 MB of RAM, but is expandable to a maximum of 512 MB of RAM. So in this respect it is in principle at least technically possible for me to meet the minimum system requirement for Sun Studio 11 with my computer, if I choose to increase its RAM. Somehow accommodating the cost of such a RAM addition, including whether one may have to buy two, matching, 256-MB RAM modules or just presumably one additional 256-RAM module, is another requirement. But before spending money for such an upgrade, one should first thoroughly investigate other matters to determine if other things are going to work and to determine what gain, if any, one could expect in computing speed with Sun Studio 11 and an additional 256 MB of RAM; then decide, based on such data, whether the purchase is personally worth the money or not. That's one motivation behind this posting; another motivation is for me to learn some things.
    Lastly I would like to here thank whoever was thoughtful enough to provide the Sun Download Manager (SDM) 2.0, which allows the pausing and resumption of the 207-MB download studio11-lin-x86.tar.bz2 for the Linux version of the Sun Studio 11! Using a slow, dialup, Internet connection like mine having a maximum speed of 28.8 kilobits/second, this makes it possible to download that file over a number of Internet sessions instead of having to have an uninterrupted, 19-or-more-hour Internet session. Besides the invconvenience of tying up one's telephone line for that long a time, it might be even be difficult to have such an uninterrupted Internet session for that long a time. I have at least started such a download using the SDM 2.0 potentially over multiple Internet sessions. Whether or not I carry it out to completion could depend on whether everything looks good with Sun Studio 11 for my particular situation. Thanks in advance for your help.

    Thanks for both of your postings here. I'm mostly trying to learn something here.
    From Maxim Kartashev: "For example, if one thread (or process, or lwp) frequently performs an I/O operation, then the other thread (process, lwp) can utilize processor resources to perform, say, some computations while first one waits for operation to complete."
    I think I might understand what you meant above. I guess lwp in the above context stands for light-weight process. And I think you may be talking about a potential gain in speed with just one, ordinary processor. I guess you meant that one program, or perhaps group of programs, could perform input/output processes at the same time it is performing calculations because different parts of the processor are being used in these two groups of processes. Then on "while first one waits for operation to complete" I guess you meant that if the input/output operations finish before the computations finish, then thread 1 that was performing the input/output operations will have to wait until the current computations ordered by thread 2 are complete before thread 1 can utilize the computational resources for its own computations; i.e., two threads can't use the same computational resources of an ordinary processor at the same time. How is my thinking so far, Maxim, right, partly right, or all wrong?
    Now if the above thinking of mine is right, then it appears that one could have some gain in speed doing things like you suggest with just one, ordinary processor. And if so, I imagine that the gain could be a maximum of a factor of two for a program that requires spending as much time in input and output as it does in computation; i.e., keeping both the computational and input/output resources working all of the time without the input/output resources waiting on the computational resources or vice versa. How is my thinking here?
    If the above thinking is correct, just for purposes of discussion with just one, ordinary processor, not a dual processor, and a program which does nothing but computations there would be no gain in speed using Sun Studio 11 and a Fortran compiler over not using Sun Studio 11. In other words, to increase the speed of computation one would have to buy a faster computer, buy parallel processing hardware for an existing computer and use parallel-processing software, or somehow figure out how to harness two or more computers to work for you at the same time with instructions from one piece or perhaps set of pieces of code set up for parallel processing using two or more different computers. The latter case would be a computer analogue or "two 'heads' are better than one," not human heads, but computers. How is my thinking here?
    Here I am still assuming that it is possible for one processor to be used to do two different kinds things at once. However, I don't see how one Fortran program could instruct two things to be done at once. This is because I have not seriously studied parallel processing, I suppose. That is I am used to a sequential set of instructions that proceed from top to botton down the lines of code; i.e., one instruction or line of code can't be executed until the line of code before it has been completely executed. That is the computing "world" with which I am familiar. So how about someone here teaching me with an example of parallel-processing Fortran code how parallel processing works, explaining what instruction or group of instructions tells the computer to execute input and computational instructions at the same time?
    Based on the encouraging information from one or more other people I have been able to use the Intel Fortran for Linux 8.1.024, if I remember correctly, in a computer with a 1-GigaHertz (GHz), Advanced MicroDevices (A.M.D.), Duron Processor. So this is at least one case where it is not essential to have an Intel processor to use the Intel Fortran Compiler for Linux 8.1.024.
    Is the Sun Fortran compiler free for personal use? And can it handle Cray-style pointers?

  • Sun Studio 11 do not parse make output and create link to file?

    Hi,
    Running Sun Studio 11 and can only get file links in the output window when I run a make command that uses CC -g (debug option). We have integrated other tools into our make system (flexlint, cppUnit..) and even though we make sure that the syntax is exactly the same as the compiler output and matches regular expression under tools->options->building->make settings->error expression, it doesn't work. Why do you have to debug compile to get sun studio to create a file link in the output window? Doesn't sun studio just parse the text from the make command?
    example of flexlint output for which no link is created:
    "/vobs/project/oss/fm/fm4/fm-fmalib/fmbal/fmaaulib/src/FMA_List.cc", line 440: Error 84: sizeof object is zero or object is undefined'�
    example of make debug output for which we do get a link:
    "/vobs/project/oss/fm/fm4/fm-fmalib/fmbal/SunOS5.10/inc/FMA_alarm_record.hh", line 1310: Warning (Anachronism):Info "static" is not allowed and is being ignored.
    Regards,
    Ola

    I'd second Maxim's suggestion: try NetBeans 5.5 with C/C++ Development Pack. The official release of NetBeans C/C++ Development Pack 5.5 has happened a few days ago. You can download it from
    http://www.netbeans.info/downloads/all.php?b_id=2284
    Some of the changes between the beta3 build and FCS are:
    * Significant performance improvements in the code parser resulting in faster results in the Class View and Code Completion
    * Programs now run in an external terminal (system dependent) by default. This allows better input control
    * Significant performance improvement in the debugging module
    * Significant functionality improvement in the debugging module
    * New project type "C/C++ Project From Existing Code" which simplifies creating a project from existing code
    * Macro support in code completion
    * Hyperlink navigation for macro usages and #include directives
    * Reformat code
    * Code folding
    * Code completion
    All these features will appear in next Sun Studio release, so you can
    consider NetBeans C/C++ Development Pack 5.5 as a preview of new
    Sun Studio IDE.

  • Building NCAR Graphics 5.2.1 on Solaris 10 x86u9 under Sun Studio 10 (2005)

    Hello,
    I've got the following error when compiling ncar program with Sun
    cc and f90 and /usr/ccs/bin/ld.
    cc -ansi -O -I/usr/openwin/include -I/usr/include/X11 -DSYSV -
    D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped -Di386 -DNeedFuncProto -
    c cl.c
    cc: Warning: illegal option -nsi
    cc: -a conflicts with -dy.
    *** Error code 1
    make: Fatal error: Command failed for target `cl.o'
    After that i've changed the config/SolarisPC file and tried a build with gcc 3.4.3 and f90 but I got
    ld fatal: library -lc not found.
    I have an old box from 2001 which was under HCL of Solaris 8 x86.
    The people at NCAR did not update their configuration files for Solaris 10 x86. The SolarisPC file is old and is using by default g77 as the fortran compiler. Could I mix gcc with f90 ? Which linker should I use in that case?
    /usr/ccs/bin/ld or /usr/ucb/ld?

    Please refer to the C Users Guide for details of cc command line options. All manuals for Sun Studio 12u1 are listed here:
    http://download.oracle.com/docs/cd/E19205-01/index.html
    There is no -ansi option in Sun/Oracle C, nor has there ever been. The compiler attempts to interpret it as -a followed by some other letters, which is why you get a complaint about -a. Remove the option.
    Depending on what you expect from the -ansi option, either the default compiler behavior or the -Xc option should work. I suggest trying the default behavior (no -X option). Refer to the manual for details.
    Always use the /usr/ccs/bin/ld linker, but you normally should not use the ld linker directly. If you mixing C and Fortran, use the f90 driver to do the linking; it knows what Fortran libraries need to be linked, depending on command line option. When linking a program using only C, use the cc driver to link. Some C command-line options require linking special system files; the cc and f90 drivers know the rules.
    To mix Fortran with C, refer to the Fortran Users Guide. I recommend using the Studio C compiler when mixing code, not gcc. The requirements of gcc are not known to the f90 driver, but it does know the requirements of Studio C.
    The schema for a mixed Fortran and C program is something like this:
    cc -c f1.c f2.c <other options>
    f90 -c f3.f90 f4.f90 <other options>
    f90 -o myprog f1.o f2.0 f3.0 f4.0 <other options>

  • Exception not always caught in Sun Studio 12

    Hi,
    We're using Sun Studio 12 (Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25) on a Solaris 10 SPARC machine. In our applications an exception thrown is sometimes not caught in the try/catch statement and the program continues at an outer catch statement (which usually leads to the program exiting). So far I've not been able to reduce the code down to a simple example and I don't yet know what conditions causes this behaviour.
    In general the code has a big try/catch statement in main. Somewhere deep in the code there is a second try/catch statement which protects against a piece of code which we know may throw an exception. This is usually a smart pointer being dereferenced. The act of dereferencing the smart pointer in turn causes an exception to be thrown which is caught internally in a third try/catch inside the dereference code. The exception is successfully caught and some clean up is done. Then the exception is re-thrown by either using a throw; statement or a new throw xmsg("...");. All our exceptions are always of type xmsg which simply takes a string argument.
    When the problem manifests itself the second try/catch is ignored and the re-thrown exception is instead caught in the outer catch statement in main which causes the program to log an error and exit.
    We have lots of code which is structured the same way and the same style of code works in many cases only to fail in some specific case. It's an elusive problem because the problem moves around and it also depends on how the program is compiled. It only seems to happen when compiled in debug mode. If I compile with -xO4 the problem seems to go away.
    The problem also goes away or moves to a different place if the code has changed somewhere between compiles, i.e. some other developer has modified some code, not necessarily in the same are where the problem originally happened.
    One thing we have is a function we call DoThrow (used to suppress a warning on an older compiler) defined like this:
    void DoThrow(const std::string& msg)
      throw xmsg(msg);
    }As an experiment I replaced the call to DoThrow with a straight throw xmsg(...) at a place where the first exception was thrown and the problem went away. I'm not sure if removing the call to DoThrow fixed the problem or if the minor restructuring of the code was enough to move the problem elsewhere.
    For production releases we still use WorkShop 6, update 2 which does not have any problems like this. We really would like to upgrade to Sun Studio 12 because it's a much better compiler over all. We can't upgrade until we feel confident we have a workaround.
    Does anyone have any thoughts on what might be wrong or any ideas on what I can do to narrow down the problem?
    Thanks,
    Krister

    Many thanks. You've given me a few areas to focus on and I'll bring my house in order.
    The only external C++ library we depend on is STLport 5.0.2 which we compile ourselves. It's currently compiled with 5.3 on Solaris 8 and I will recompile it with 5.9 on Solaris 10. All other external libraries are C libraries. Our own code is put in static libraries and linked statically. I've read that exceptions thrown in shared libraries can be problematic.
    Your comment about complex conditional expressions (a ? f() : g()) is interesting. We've been bitten before by compiler bugs affecting those types of expressions. Destructors called twice or destructors called for temporaries never created. We may still have some conditional expressions like that.
    The exception is of type xmsg, defined this way:
    class xmsg
      public:
        xmsg(const char* s) : _msg(s) {}
        xmsg(const std::string& s) : _msg(s) {}
        const std::string& why() const { return _msg; }
      private:
        const std::string _msg;
    };There are three catch blocks involved and all the try/catch statement look like this:
    try
    catch(const xmsg& msg)
    }Here is a stack trace from dbx at the point where the exception is thrown the first time.
      [1] __exdbg_notify_of_throw(0xffbf4ae8, 0xffbf4ad0, 0x959b292c, 0xffff0000, 0x0, 0xfc00), at 0xfb6549b4
      [2] _ex_debug_handshake1(0x0, 0x101cb84, 0x1, 0x14ffc, 0xfb66a67c, 0xfb66ad38), at 0xfb655728
      [3] _ex_throw_body(0xfb66af80, 0x80b2ac, 0xfb66a67c, 0x14d9c, 0x0, 0xfb66af80), at 0xfb655934
      [4] __Crun::ex_throw(0xfb66afd0, 0x1460bf8, 0x7ead20, 0x0, 0x16538, 0x1), at 0xfb6558bc
    =>[5] TransportSource<User>::Activate(this = 0x1624810, r = CLASS, _ARG3 = CLASS), line 39 in "TransportSource.H"
      [6] Source<User>::DoActivate(this = 0x162486c, r = CLASS, e = CLASS), line 272 in "Factory.H"
      [7] BaseFactory::Load(this = 0x16020a8, e = CLASS), line 2799 in "BaseFactory.C"
      [8] GPAuthorizationSource::Load(this = 0x15d2440), line 110 in "GPAuthorization.C"
      [9] ExchangeServer::ExchangeServer(this = 0xffbfa95c, argc = 8, argv = 0xffbfbaec), line 380 in "exchangeServer.C"
      [10] main(argc = 8, argv = 0xffbfbaec), line 1525 in "exchangeServer.C"Here is the code for the Activate function in stack frame 5. The exception thrown is the second one.
        virtual T& Activate(const Reference& r, Exemplar<T>&)
          _transport->In().Write(r);
          DemarshallStream out;
          _transport->Method(Process::Activate, out);
          if(!out.Data())
         throw xmsg("Failed to call Activate on server " + _transport->Name());
          if(!out.GetBool())
         throw xmsg("Server returned error: " + out.GetString());
          const ClassHandle& h = out.GetClassHandle(&_connection);
          // don't need to pass refresh flag here because a call to Activate
          // means the object is being loaded for the first time.
          BaseExemplar* x = _handle.GetFactory().Demarshall(h, out, false,
         &_connection, this);
          BaseTransportSource::DoActivate(out);
          if(!x)
         throw xmsg("Failed to activate ref: " + r.ExternalValue());
          return static_cast<T&>(*x->GetInstance());
        }The exception is caught (frame 7 in the stack trace above) and re-thrown in the below code, at the last throw statement.
    void BaseFactory::Load(BaseExemplar& e)
      SourceMap::iterator p = _sources.find(&e._key->Type());
      if(p == _sources.end())
        throw xmsg("Factory<" + _handle.Name() + ">::Load - no source for: "
          + e._key->ExternalValue());
      AutoPointer<BaseGuard> g(Guard());
      std::list<BaseSource*>::iterator i = p->second.begin();
      while(true)
        try
          (*i)->_currentExemplar = &e;
          BO& x = (*i)->DoActivate(*e._key, e);
          (*i)->_currentExemplar = 0;
          if(!e._instance)
         e._instance = &x;
         Activate(e, ActivatedOld, 0);
          return;
        catch(const xmsg& msg)
          (*i)->_currentExemplar = 0;
          ++i;
          if(i == p->second.end())
         throw;
    }There is a second try/catch one level up (stack frame 8, the call to GPAuthorizationSource::Load). Here's a snippet of that piece of code.
        try
          const Exemplar<User>& user = UserFactory::Instance().CreateExemplar(
         *new UserReference(authorizationTable._login.Value()));
          *user;
        catch(const xmsg& msg)
          Logger::Instance() << LogHeader << MsgClass(MsgClass::Error)
         << "Error PMAutorizationSource: " << msg.why() << EndMsg;
        // ...I put a break-point in the catch block in the above code but I never hit the break point and the exception is caught in an outer try/catch, an error is printed and the program exits.
      try
      catch(const xmsg& msg)
        std::cerr << "ERROR: " << msg.why() << std::endl;
      }I'm sorry I have not yet been able to produce a smaller example that can be compiled and tested in isolation. I know that's important in order to track down the problem. It seems like the smallest change in seemingly unrelated parts of the code makes the problem come or go.

Maybe you are looking for