Gauss Crash

Hi, there.

My Gauss crashes when solving constrained optimization. When it crashed, there is a small window saying "gauss.exe has stopped working" "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available".

What might cause this?

Thanks.

 

3 Answers



0



The most common cause for this is assigning to a global variable inside of the function that you pass to a procedure like COMT which will call your function from multiple threads.

aptech

1,773


0



Can you elaborate? What is 'COMT'?

One thing I forgot to mention in previous post is that the memory increases fast before Gauss crashes.

 



0



COMT is the main constrained optimization procedure from the COMT Application Module. Let's create a simplified example. In this example below, the user creates a procedure named userProcedure. Inside of userProcedure a global variable named last_x is assigned to. A pointer to the procedure, userProcedure is passed in to GAUSSProc. Inside of GAUSSProc, userProcedure is called by two separate threads at the same time.

There are a few variations on this theme, but it is the cause in the vast majority of cases.

Someone from Aptech Support has sent you an email. You can send them your code for more detailed help on this.

//Global 'last_x' to keep track of last 'x' value
last_x = 0; 

//Start values for userProcedure
x_start = { 0, 1.57, 3.14, 4.71 };

proc (1) = userProcedure(x);
    //assign to global 'last_x'
    //If this happens in more than one
    //thread, it will cause a crash
    last_x = x;
    retp(cos(x));
endp;

proc (1) = GAUSSProc(fp, x);
    local out, out_1, out_2, fp:proc;

    //Calls 'userProcedure' from two separate threads
    threadStat out_1 = fp(x);
    threadStat out_2 = fp(x);
    threadJoin;
    out = out_1 + out_2;
    retp(out);
endp;

function_pointer = &userProcedure;

ret = GAUSSProc(function_pointer, x_start);

aptech

1,773

Your Answer

3 Answers

0

The most common cause for this is assigning to a global variable inside of the function that you pass to a procedure like COMT which will call your function from multiple threads.

0

Can you elaborate? What is 'COMT'?

One thing I forgot to mention in previous post is that the memory increases fast before Gauss crashes.

 

0

COMT is the main constrained optimization procedure from the COMT Application Module. Let's create a simplified example. In this example below, the user creates a procedure named userProcedure. Inside of userProcedure a global variable named last_x is assigned to. A pointer to the procedure, userProcedure is passed in to GAUSSProc. Inside of GAUSSProc, userProcedure is called by two separate threads at the same time.

There are a few variations on this theme, but it is the cause in the vast majority of cases.

Someone from Aptech Support has sent you an email. You can send them your code for more detailed help on this.

//Global 'last_x' to keep track of last 'x' value
last_x = 0; 

//Start values for userProcedure
x_start = { 0, 1.57, 3.14, 4.71 };

proc (1) = userProcedure(x);
    //assign to global 'last_x'
    //If this happens in more than one
    //thread, it will cause a crash
    last_x = x;
    retp(cos(x));
endp;

proc (1) = GAUSSProc(fp, x);
    local out, out_1, out_2, fp:proc;

    //Calls 'userProcedure' from two separate threads
    threadStat out_1 = fp(x);
    threadStat out_2 = fp(x);
    threadJoin;
    out = out_1 + out_2;
    retp(out);
endp;

function_pointer = &userProcedure;

ret = GAUSSProc(function_pointer, x_start);

You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.