Time Constraint on Corporate Function Infortype

Hi everyone,
If it's possible, I'd like to know how to configure the time constraint of Corporate Function infotype.
The Time Constraint settings are incorrect for Infotype 0034 (Corporate Function). There must be only one valid record existing/active, and it should not permit gaps either.
For Example, a record is existing from 01.10.2010 to 31.12.9999. So when the user creates a new record from 01.11.2011 to 31.12.9999, the previous record should automatically be delimited (end date of 31.12.2010) when the record is saved.
If ithis is not possible, I'd like to know why.
Thank you so much.

Hi,
Go to the table v_T582a and check what is the Time constraint is define there. I trust by default it should be T. But would like to know which is the record you want to maintain here, because there are many subtype in infotype 0034. And as per the standared function of this infotype T is the right time constraint.

Similar Messages

  • Time Constraint Error when calling a Function module from Webdynpro ABAP

    Any help will be greatly appreciated - Thanks RM
    Time Constraint Error
    Information on where terminated
        Termination occurred in the ABAP program "SAPUP50R" - in
         "CHECK_TIME_CONSTRAINT_S1".
        The main program was "MP000000 ".
        In the source code you have the termination point in line 1069
        of the (Include) program "UP50RU01".
    Error occurred during batch input processing
    Source Code Extract
          l_is_inconsistent = 'X'.
        ENDIF.
      Check if there are inverted time periods.
        IF l_prelp_line-begda > l_prelp_line-endda.
          l_is_inconsistent = 'X'.
        ENDIF.
    Check if there are overlaps or gaps.
        IF NOT l_prelp_before IS INITIAL.
          l_date_difference = l_prelp_line-begda - l_prelp_before-endda.
          IF l_date_difference <> 1.
            l_is_inconsistent = 'X'.
          ENDIF.
        ENDIF.
        l_prelp_before = l_prelp_line.
      ENDLOOP.
      IF l_prelp_before-endda <> '99991231'.
        l_is_inconsistent = 'X'.
      ENDIF.
      IF l_is_inconsistent = 'X'.
        IF p_access_type = 'R'.
    490 Datenbankschiefstand Personalnummer & Infotyp &
          MESSAGE x490 WITH l_prelp_before-pernr l_prelp_before-infty.
        ELSE.
    491 Unzulässige Daten Personalnummer & Infotyp &
    Line 1069 Error occcurs >>>>  MESSAGE x491 WITH l_prelp_before-pernr l_prelp_before-infty.
        ENDIF.
      ENDIF.
    ENDFORM.                    " CHECK_TIME_CONSTRAINT_S1     "XYVN0352581
    *&      Form  clear_no_adapter_needed              new     "XREN844998
          text
    FORM clear_no_adapter_needed .
      CLEAR no_adapter_needed.
    ENDFORM.                    " clear_no_adapter_needed
    *&      Form  set_no_adapter_needed              new     "XREN844998
          text
    FORM set_no_adapter_needed .
      no_adapter_needed = 'X'.
    ENDFORM.                    " clear_no_adapter_needed

    Hi,
    Well, are you trying to do a batch input on infotype 0000? If yes you need to check that the proposed values respects the time constraint, meaning no gap, no overlaps and no inversions. Also fields SUBTY, OBJPS, SPRPS and SEQNR must remain initial when processing IT0000...
    Kr,
    Manu.

  • Time Constraint Error when calling a Function Module

    Any help will be greatly appreciated - Thanks RM
    Time Constraint Error
    Information on where terminated
    Termination occurred in the ABAP program "SAPUP50R" - in
    "CHECK_TIME_CONSTRAINT_S1".
    The main program was "MP000000 ".
    In the source code you have the termination point in line 1069
    of the (Include) program "UP50RU01".
    Error occurred during batch input processing
    Source Code Extract
    l_is_inconsistent = 'X'.
    ENDIF.
    Check if there are inverted time periods.
    IF l_prelp_line-begda > l_prelp_line-endda.
    l_is_inconsistent = 'X'.
    ENDIF.
    Check if there are overlaps or gaps.
    IF NOT l_prelp_before IS INITIAL.
    l_date_difference = l_prelp_line-begda - l_prelp_before-endda.
    IF l_date_difference 1.
    l_is_inconsistent = 'X'.
    ENDIF.
    ENDIF.
    l_prelp_before = l_prelp_line.
    ENDLOOP.
    IF l_prelp_before-endda '99991231'.
    l_is_inconsistent = 'X'.
    ENDIF.
    IF l_is_inconsistent = 'X'.
    IF p_access_type = 'R'.
    490 Datenbankschiefstand Personalnummer & Infotyp &
    MESSAGE x490 WITH l_prelp_before-pernr l_prelp_before-infty.
    ELSE.
    491 Unzulässige Daten Personalnummer & Infotyp &
    Line 1069 Error occcurs >>>> MESSAGE x491 WITH l_prelp_before-pernr l_prelp_before-infty.
    ENDIF.
    ENDIF.
    ENDFORM. " CHECK_TIME_CONSTRAINT_S1 "XYVN0352581
    *& Form clear_no_adapter_needed new "XREN844998
    text
    FORM clear_no_adapter_needed .
    CLEAR no_adapter_needed.
    ENDFORM. " clear_no_adapter_needed
    *& Form set_no_adapter_needed new "XREN844998
    text
    FORM set_no_adapter_needed .
    no_adapter_needed = 'X'.
    ENDFORM. " clear_no_adapter_needed

    Hi,
    Well, are you trying to do a batch input on infotype 0000? If yes you need to check that the proposed values respects the time constraint, meaning no gap, no overlaps and no inversions. Also fields SUBTY, OBJPS, SPRPS and SEQNR must remain initial when processing IT0000...
    Kr,
    Manu.

  • Infotype 0034 : time constraint

    Hello,
    I've an issue with infotype 0034. I set time constraint to 2, but when creating a new occurence, the system doesn't delimit the previous one if it concern a different subtype.
    Can someone please help?
    Kr,
    K

    Dear Karim,
    IT-0034(Corporate Functions)  Time constraint is T  that sap standard, which depends upon subtype,
    then why are you changing the time constaint to 2.
    where as with time constraint T you can see all the records.
    in IT-0034 it will ask you for start date and End date of record.
    why do you want system to delimit the record ?
    i suggest you to use the sttandard one.
    regards,
    mohammed

  • How to make a custom infotype field the time constraint 1?????

    Hello everyone I have this challenging question for gurus to answer it.
    In custom created infotype for OM Ii have that field called ZZJOBID. When infotype was created I assigned the time constraint 1 for that infotype. That time constraint was base on OBJID not on ZZJOBID. Now the problem I am encountering is when I assign the 2nd ZZJOBID  with time span 01011800-12319999 it overwrite the 1st assign ZZJOBID.
    for the requirement reason I have to use PO10( not po03). If I change the time constraint to 3 which let me have the multiple records but I am losing the delimit and other functionality which comes with time constraint 1.

    Suresh,
             you are wright when you say that ' Time Constraint is for the Infotype/Subtype record and cannot be based off a field.' The OM infotype runs on bases of Object such as Organizational Unit, Job, etc... The point I was trying to draw is I am looking for a way that allow me to work via TC PO10 which run on Organizational Unit along with different ZZJOBID (with same begda and endda, if needed).

  • Deleting an Infotype with Time Constraint 1 - programatically

    Hi there,
    We have a few records (IT0008), that need to be deleted. Unfortunately, when we use PA30 to delete, it won't delete the record(s). (Displays the error msg. "Record has time constraint 1" ) But, when we use the Utilities option in PA30 and go thru', it appears to successfully delete the same.
    Now, could somebody pl. let us know how to go abt. doing the same programatically in ABAP ? I've tried looking at the FM's HR_MAINTAIN_MASTERDATA and HR_INFOTYPE_OPERATION (without much luck though....Although, SAP claims to have a documentation of these FM's, there is actually no proper docmn. at the Field level of these FMs)
    Moreover, the FM HR_MAINTAIN_MASTERDATA returns exactly the same error "Record has time constraint 1".
    Am a bit baffled as it is...
    Any help would be gratefully acknowledged and appreciated.
    Many thanks in anticipation,
    Kind Regards,
    RVS

    there is no function module to do forbidden actions.
    you only can do it with DELETE statement.
    select single dbtab from t777d into gv_dbtab where infty = p_infty.
    delete from (gv_dbtab) where pernr in p_pernr.
    But you will have to be very carefully. There are "blind" infotypes behind some "normal" infotypes you will have to care about (i.e. 0000 -> 0302).

  • Time constraints and Dialog module

    1.What is the difference between the time constraints A(IT exists just once from 01 Jan 1800 to 12 Dec 9999) and B(IT exists for maximum of once from 01 Jan 1800 to 12 Dec 9999)?
    2.What is the necessity of dialog module for a Infotype?

    Time Constraint A and B
    Infotypes with time constraint A & B must have no more than one record. The system automatically assigns the record a validity period from January 01, 1800 through December 31, 9999. This validity period cannot be subdivided.
    Infotype records with time constraint A CANNOT be deleted.
    Infotype records with time constraint B CAN be deleted.
    The difference is check the BOLD TEXT.
    As for ur second question, Function modules/dialog modules helps calling infotypes when called from any custom program ,and allows you to perform similar actions/tasks that you would perform on them from direct maintainance. ex: create,change, delete etc. also performing the same on multiple infotypes in a single go using a them is easier than writing a code to manipulate each single infotype.
    SAP exposed these functions to be exploited as there will come many situations in business scenarios where you require to work with them by writing custom code.
    hope its helpful

  • Time constraints for infotype 0185

    Hi experts,
    Need your suggestions,
    Is it possible to change the Time constraints for infotype 0185. What will be the impact if i change from 2 to 3 time constraints. Please explain...
    Shiv.

    hi,
    what i meant was standard time constraints should not be changed unless there is no other option.
    changing the time constraint is a quick fix solution.
    these standard time constraints are set after a lot of thought.
    like he referred 185  which is personnel ids.
    here you can see that it has sub types each sub type can have one record.
    you cannt have two passports .
    you cannot have two pan numbers etc.
    lets us sasy the end user enters some data wrongly and then he realises and creates another record for the same with out deleting the old one.
    the system will take it.
    but as you can see the data is already duplicated and it gives errors if some work flow or some other functionality is written basing on that input.
    regards
    nalla

  • Get time constraint

    Hi
    Is there any function module or anything by which i can get the time constraint of an infotype.
    I have tried RH_PM_GET_TIMECONSTRAINT, but it does not return anything if time constraint of subtype is not in T591a.
    As time constraint of subtypes may be stored in any other table other than T591a, this FM does not work.
    Please help.
    Regards

    Please check below tables
    T591A-- Subtype characteristics
    T512Z --Infotypes 0008/14/15/0276 and 2010 sty are defined here ( wage types) these WTs time constraints are defined in T591B.
    Please check my be useful.
    Thank you,
    NLR

  • Changing Time Constraint of Standard Infotypes

    Hi,
    Just wondering is it possible to check the time constraint of <b>standard</b> infotypes such that the behaviour of infotype records will react accordingly to the time constraint?
    I am aware that we can change the time constraint in PM01 but i have tested it, it does not seem to delimit past infotype records. I have changed the time constraint of Infotype 0081 to 2, but it does not delimit past records. Is it dependent on the infotype itself as well? Is there any existing function module or user exit that I can use to enhance the module pool of infotype to delimit records?
    Thank you.

    Hi,
    Can u tell me which IT r u trying ,,,, try for 0022 IT too ,
    check whether the behaviour is the same .
    When u give 2 as time constraint , your problem should be solved .
    Eg: 24.10.2007 - 31.12.9999 - 1st record
    24.11.2007 - 31.12.9999 - 2nd record
    While saving the second record ,
    IF Time constraint is 1 : it will delimit with a date as 23.11.2007 for 1st record
    IF Time constraint is 2 : it will delimit with a date as 23.11.2007 for 1st record (does the same thing)
    Time gaps are the difference (You can have the record delimited to 20.11.2007 for Tiime constrint 2 but for 1 it shud not allow the same)
    If this is not happening the messages are the problem .
    Use user exit for the same to correct the problem .
    What is the message ur getting when you try to save the second record .
    Regards
    Gajalakshmi

  • Document Tracking with Time Constraint

    Hi All
    We have a requirment to track the statuses of Documents.
    1) Documents have different statuses like Create, Checked, Send for Review, Approved etc
    2) Each statuses have definite time period. For eg, after Create, the user responsible has 3 days to change it to "Checked" status
    3) If the user responsible does not change to "Checked" a reminder mail should be triggered.
    4) ie, the system should check whether the status has been changed to "Checked" after 3 days and if not , the mail should get triggered.
    Please let me know whether we can have this in Std. DMS?
    Also can we give time constraint to the status..? Like  as I mentioned. give 5 days to change the status to "Checked" for a pariticular user responsible?
    If not how can we do this?
    Regards
    Aby
    Edited by: Aby Thomas on Nov 23, 2008 11:28 AM

    Aby,
        I think your case is a classic example for using the functionality of ECM ( Engineering Change Management) for document status management purposes.
    ECM is a module created by SAP for enabling changes through coordinated change management procedures. Essentially  there is a change master and ECR/ECO related to the process.
    ECR is an engineering change request and ECO is an engineering change order. If I visualise in your case, an ECR can be created for changing the statuses of a document. Once the ECR go through various statuses you can decide to finally release the ECR which creates an ECO and executes it.
    Also you can configure Messaging under DMS customisation to trigger messages for document status change.
    You can also trigger a workflow event based on each status change as has been suggested by some colleagues here.
    My advise would be to use as much as system functionality possible for each of these custom requests.
    Sojan
    Note : ECM can be used to trigger any coordinated changes in the sap system. It can be material, BOM,
    DMS, you name it.

  • How do i set my time capsule up to function as an external hard drive

    How do i set my time capsule up to function as an external hard drive? Is this even possible? I had a friend tell me it woudl be a good set up to get a time capsule with my Macbook Air to use as a gigantic external hard drive but then was unbale to wlak me through the setup after I bought the equipment. Any suggestions?

    It depends on what you already have equipment wise..
    Just bridge the TC..
    I cannot walk you through it either if you use v6 airport utility.. due to my refusing to run Lion until it gets network issues sorted.
    Download and run the real utility http://support.apple.com/kb/DL1482
    Go to manual setup..
    Internet tab
    Connection sharing.. select off bridge mode in the drop down box.
    You can then if you like turn off wireless under airport wireless.. The TC is now a plain network client with hard disk.
    Personally I would keep the wireless on but sort the channels manually if you already have a wireless AP or router.

  • Time Constraint for Boundary Events

    Hi experts.
    I am pretty new to BPM (NetWeaver Developer Studio 7.1 SP04 BPM SP05) and I am just making a test process to try to get the time constraint concept right. So far I have three tasks in my process, very much like a textbook example. In my first task I have an input field in which you're supposed to type in your name, which is then saved to the context and triggers the second task when completed. That second task is nothing but a screen displaying "You successfully generated a second task, (with the name you entered in the first task here)."
    That works fine so far. Then there's the third task, which is linked to a boundary event on the second event with a start deadline which is critical exception. Here's the idea... You complete the first task (name input), then you fail to start the second task within a certain amount of time defined by an expression, so the process should go to the third task because of the deadline. By the way, it works fine when using a default time, so I must be doing something right so far, the problem is when trying to dynamically change the time with the expression.
    What I tried was to define a context attribute type time and date (I tried both) and assigning a time (current time plus whatever amount of minutes) to that attribute via Java coding at the time you click on the button which completes the task, then use that context element in the expression, but that didn't work. I also tried to make that context attribute an integer and set it to whatever amount of minutes I want to use for the deadline, then in the expression get the current time and add that afore mentioned integer to its minutes. That didn't work either.
    Please help, I have seriously done some research, and no success yet.
    Edited by: david.palafox on Jul 1, 2010 5:54 PM

    Figured it out.

  • Time Constraints and Boundary Events in BPM

    Hi all,
    I have done the following:
    In the Task window, Time Constraints tab
    - Checked "Define a default completion deadline" with the offset as 3 minutes.
    - Checked the "Raise critical exception when deadline is reached" checkbox.
    In the boundary events for the activity, I have added "CompletionDeadlineIsCriticalException".
    From the boundary event, I have linked to to another activity that belongs to another user (User B).
    When i am testing the BPM, the task goes into a Suspended status after 3 minutes. However User B did not received a new item in the UWL.
    In the NWA, "Manage Process: Process Instances", i can see that Task is escalated by null and the status is suspended.
    Does anyone has any advice over here?
    Thank you.

    Hi,
    i have checked the BPEM-CORE version as instructed.
    It says 1000.7.11.2.0.20090321233900
    Does that means I need to update to the latest patch?
    Please also check the version of your NWDI build plug-in BPEM-BUILDT in the respective NWDI track. This is used to build Process Composer DCs in your NWDI.
    I am in the Development Infrastructure Perspective in NWDS
    How do i check the version number for BPEM-BUILDT in the NWDI?
    Thank you.

  • Too much exclusive CPU time counted at swapcontext function

    Hi,
    I'm using Sun Studio Express March 2009 Build, especially Performance Analyzer, and I have observed some hardly understandable CPU times measured at swapcontext function of libc library.
    Here is my machine spec.
    Two-way Intel E5320 processors with 16GB memory
    SUSE Linux Enterprise Server 10 SP1 (x86_64)
    My program consisted of 8 threads (pthread), and around a hundred of user contexts (coroutines or fibers) run on every single thread. I'm using makecontext/swapcontext for creating/scheduling user contexts on threads.
    I'm using both Sun Studio Performance Analyzer and Intel VTune Performance Analyzer.
    My problem is that performance analyzer reported about 20% of total CPU time as the exclusive CPU time of swapcontext function, while I couldn't find as many HW event samples related to swapcontext by using VTune.
    To narrow down the problem scope, I made simple test program, and I reproduced the problem. I attached the test program generator written by bash script at the end of this message.
    I generated the test program with following command.
    % bash code_gen.sh 8 128 100000 1000
    Then, you can get the test program, which consists of 8 threads with 128 user contexts at each threads, and 100000 times of context switch at each user context.
    In my system, Sun Studio Performance Analyzer reported 328 seconds of exclusive CPU time at swapcontext out of 463 seconds total CPU time (CPU Time of <Total>). Briefly, swapcontext consumed about 70% of total CPU time.
    However, according to VTune sampling, both libc-2.4.so and vmlinux-2.6.16.46-0.12-smp consume only 8% of total clockticks.
    It's too large gap between Sun Studio and VTune.
    Have you seen this kind of problem? Do you know why this mismatch happens?
    Or how can I estimate actual swapcontext cost?
    Thank you for reading my post, and I'm looking forward to some hints about my problem.
    Colin
    ---- code_gen.sh ----
    #!/bin/bash
    usage()
         echo "code_gen.sh <num_threads> <num_task> <num_loop> <func_body_size>"
    test()
         local num_threads=$1
         local num_tasks=$2
         local func_loop=$3
         local func_body_size=$4
         local file_name="mytest_${num_threads}_${num_tasks}_${func_loop}_${func_body_size}"
         main_func_gen $num_tasks $func_loop $func_body_size > $file_name.c
         gcc -O2 $file_name.c -o $file_name -lpthread
    sub_func_gen()
         local func_id=$1
         local func_loop=$2
         local func_body_size=$3
         local num_tasks=$4
         cat <<!
    static void f$1(int threadId)
         volatile int c = 0;
         int i = 0;
         for(i = 0; i < $func_loop; ++i)
         for i in `seq 1 $func_body_size`; do
              echo "          c+=1;";
         done
         cat <<!
              swapcontext(&ctx[threadId][$func_id], &ctx[threadId][($func_id+1)%$num_tasks]);
    main_func_gen()
         num_tasks=$1
         func_loop=$2
         func_body_size=$3
         cat <<!
    #include <stdio.h>
    #include <ucontext.h>
    #include <stdlib.h>
    #include <sys/time.h>
    #include <time.h>
    #include <pthread.h>
    static ucontext_t **ctx;
    static ucontext_t *mctx;
    static pthread_t *pThreads;
         for i in `seq 0 $((num_tasks-1))`; do
              sub_func_gen $i $func_loop $func_body_size $num_tasks
         done
         cat <<!
    int
    threadMain (int* pThreadId)
    char** st = NULL;
    int i = 0;
    int* ret = NULL;
         int threadId=*pThreadId;
    printf("$num_tasks tasks on %d thread\n", threadId);
    st = (char**)malloc(sizeof(char*)*$num_tasks);
    ctx[threadId] =(ucontext_t*)malloc(sizeof(ucontext_t)*$num_tasks);
    ret = (int*)malloc(sizeof(int)*$num_tasks);
         for i in `seq 0 $((num_tasks-1))`; do
              cat <<!
    st[$i] = (char*)malloc(sizeof(char)*8192);
    getcontext(&ctx[threadId][$i]);
    ctx[threadId][$i].uc_stack.ss_sp = st[$i];
    ctx[threadId][$i].uc_stack.ss_size = 8192;
    ctx[threadId][$i].uc_link = &mctx[threadId];
    makecontext(&ctx[threadId][$i], f$i, 1, threadId);
         done
         cat <<!
    //printf("start\n");
    swapcontext(&mctx[threadId], &ctx[threadId][0]);
    return 0;
    int
    main(int argc, char* argv[])
         int num_threads = $num_threads;
         int rc;
         pthread_attr_t attr;
         void *status;
    struct timeval begin, end;
         int *threadId;
         int i;
         printf("%d threads\n", num_threads);
         pthread_attr_init(&attr);
         pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
         pThreads = (pthread_t*)malloc(sizeof(pthread_t)*num_threads);
         mctx = (ucontext_t*)malloc(sizeof(ucontext_t)*num_threads);
         ctx = (ucontext_t**)malloc(sizeof(ucontext_t*)*num_threads);
         threadId = (int*)malloc(sizeof(int)*num_threads);
         // begin time measurement
    gettimeofday(&begin, NULL);
         for(i=0; i < num_threads; ++i)
              threadId[i] = i;
              rc = pthread_create(&pThreads, &attr, threadMain, (void*)&threadId[i]);
              if(rc)
                   printf("ERROR; return code from pthread_create is %d\n", rc);
                   exit(-1);
         pthread_attr_destroy(&attr);
         for(i = 0; i < num_threads; ++i)
              rc = pthread_join(pThreads[i], &status);
              if(rc)
                   printf("ERROR; return code from pthread_join is %d\n", rc);
                   exit(-1);
         // end time measurement
    gettimeofday(&end, NULL);
    printf("finished. Elapsed time=%dms\n", ((end.tv_sec - begin.tv_sec)*1000000+(end.tv_usec - begin.tv_usec))/1000);
         pthread_exit(NULL);
    if [[ $# -ne 4 ]]; then
         usage
         exit 0
    fi
    test $1 $2 $3 $4

    Hi Nik,
    Oh! I didn't know that. Here I put my code again. I'm sorry for your confusion.
    #!/bin/bash
    usage()
         echo "code_gen.sh <num_threads> <num_task> <num_loop> <func_body_size>"
    test()
         local num_threads=$1
         local num_tasks=$2
         local func_loop=$3
         local func_body_size=$4
         local file_name="mytest_${num_threads}_${num_tasks}_${func_loop}_${func_body_size}"
         main_func_gen $num_tasks $func_loop $func_body_size > $file_name.c
         gcc -O2 $file_name.c -o $file_name -lpthread
    sub_func_gen()
         local func_id=$1
         local func_loop=$2
         local func_body_size=$3
         local num_tasks=$4
         cat <<!
    static void f$1(int threadId)
         volatile int c = 0;
         int i = 0;
         for(i = 0; i < $func_loop; ++i)
         for i in `seq 1 $func_body_size`; do
              echo "          c+=1;";
         done
         cat <<!
              swapcontext(&ctx[threadId][$func_id], &ctx[threadId][($func_id+1)%$num_tasks]);
    main_func_gen()
         num_tasks=$1
         func_loop=$2
         func_body_size=$3
         cat <<!
    #include <stdio.h>
    #include <ucontext.h>
    #include <stdlib.h>
    #include <sys/time.h>
    #include <time.h>
    #include <pthread.h>
    static ucontext_t **ctx;
    static ucontext_t *mctx;
    static pthread_t *pThreads;
         for i in `seq 0 $((num_tasks-1))`; do
              sub_func_gen $i $func_loop $func_body_size $num_tasks
         done
         cat <<!
    int
    threadMain (int* pThreadId)
        char** st = NULL;
        int i = 0;
        int* ret = NULL;
         int threadId=*pThreadId;
        printf("$num_tasks tasks on %d thread\n", threadId);
        st = (char**)malloc(sizeof(char*)*$num_tasks);
        ctx[threadId] =(ucontext_t*)malloc(sizeof(ucontext_t)*$num_tasks);
        ret = (int*)malloc(sizeof(int)*$num_tasks);
         for i in `seq 0 $((num_tasks-1))`; do
              cat <<!
            st[$i] = (char*)malloc(sizeof(char)*8192);
            getcontext(&ctx[threadId][$i]);
            ctx[threadId][$i].uc_stack.ss_sp = st[$i];
            ctx[threadId][$i].uc_stack.ss_size = 8192;
            ctx[threadId][$i].uc_link = &mctx[threadId];
            makecontext(&ctx[threadId][$i], f$i, 1, threadId);
         done
         cat <<!
        //printf("start\n");
        swapcontext(&mctx[threadId], &ctx[threadId][0]);
        return 0;
    int
    main(int argc, char* argv[])
         int num_threads = $num_threads;
         int rc;
         pthread_attr_t attr;
         void *status;
        struct timeval begin, end;
         int *threadId;
         int i;
         printf("%d threads\n", num_threads);
         pthread_attr_init(&attr);
         pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
         pThreads = (pthread_t*)malloc(sizeof(pthread_t)*num_threads);
         mctx = (ucontext_t*)malloc(sizeof(ucontext_t)*num_threads);
         ctx = (ucontext_t**)malloc(sizeof(ucontext_t*)*num_threads);
         threadId = (int*)malloc(sizeof(int)*num_threads);
         // begin time measurement
        gettimeofday(&begin, NULL);
         for(i=0; i < num_threads; ++i)
              threadId[i] = i;
              rc = pthread_create(&pThreads, &attr, threadMain, (void*)&threadId[i]);
              if(rc)
                   printf("ERROR; return code from pthread_create is %d\n", rc);
                   exit(-1);
         pthread_attr_destroy(&attr);
         for(i = 0; i < num_threads; ++i)
              rc = pthread_join(pThreads[i], &status);
              if(rc)
                   printf("ERROR; return code from pthread_join is %d\n", rc);
                   exit(-1);
         // end time measurement
    gettimeofday(&end, NULL);
    printf("finished. Elapsed time=%dms\n", ((end.tv_sec - begin.tv_sec)*1000000+(end.tv_usec - begin.tv_usec))/1000);
         pthread_exit(NULL);
    if [[ $# -ne 4 ]]; then
         usage
         exit 0
    fi
    test $1 $2 $3 $4best regards,
    Colin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • 3rd gen. from mac to windows

    My nice newer ipod broke, so my friend gave me an older 3rd generation 40 gb ipod. for an unknown reason, it doesn't work on his mac, so he gave it to me to try on my pc. the ipod itself works fine - it plays all of the music he has on there. but i'd

  • HOW DO I OPEN WINDOWS XP ON MY NEW IMAC TO USE A WINDOWS BASED SOFTWARE?

    HOW DO I OPEN WINDOWS XP ON MY NEW IMAC TO USE A WINDOWS BASED SOFTWARE?

  • Output to P2 cards on Panasonic HVX 200

    When I print to video using the DVC Pro HD Firewire to a Panasonic HVX 200, the audio goes into mono mode, even though the original file is in stereo. I have a big presentation to more than 400 on Friday. Any thoughts about how to fix this? Here's wh

  • IPod Classic to iMac photo transfer

    Laptop died, lost everything. However, my old iPod Classic (click wheel 120GB) still had all of my old photos on it. I have an iMac now and am trying to transfer the photos over. Any good (hopefully free, although not opposed to buying) transfer soft

  • How to control the display of table control

    hi, If I dont find any entry in the internal table to be displayed in table control then I should not display the blank table in the screen. I tried using if not itab[] is initial in PBO but there(PBO) 'if' is not recognised and it gives syntax error