help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] csv_driver:unable to create ....csv - Permission denied


From: Martin Albrecht
Subject: [Help-glpk] csv_driver:unable to create ....csv - Permission denied
Date: Tue, 06 Jan 2015 11:53:58 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0

Dear all,

I am running a GLPK model that is sequentially started from a frame program in Java.
The frame program does the following:
-It creates data files (.csv) that are read in by the GLPK model thereafter
-The call of the GLPK model is according to the help documentation:

public void start() {
         
            glp_prob lp = null;
            glp_tran tran;
            glp_iocp iocp;

            int skip = 0;
            int ret;

           // GlpkCallback.addListener(this);

            lp = GLPK.glp_create_prob();
            System.out.println("Problem created");

            tran = GLPK.glp_mpl_alloc_wksp();
            ret = GLPK.glp_mpl_read_model(tran, fname, skip);
            if (ret != 0) {
                GLPK.glp_mpl_free_wksp(tran);
                GLPK.glp_delete_prob(lp);
                throw new RuntimeException("Model file not found: " + fname);
            }

            // generate model
            GLPK.glp_mpl_generate(tran, null);
            // build model
            GLPK.glp_mpl_build_prob(tran, lp);
            // set solver parameters
            iocp = new glp_iocp();
            GLPK.glp_init_iocp(iocp);
            iocp.setPresolve(GLPKConstants.GLP_ON);
            // solve model
            ret = GLPK.glp_intopt(lp, iocp);
            // postsolve model
            if (ret == 0) {
                GLPK.glp_mpl_postsolve(tran, lp, GLPKConstants.GLP_MIP);
            }
            // free memory
            GLPK.glp_mpl_free_wksp(tran);
            GLPK.glp_delete_prob(lp);

     }
}


The GKLP model writes some output tables (csv.), and the results are read in again by Java after terminating the optimization run, and so on.

Unfortunately,  I get sometime error when opening the .csv files.
Here is an example:

csv_driver: unable to open BOM.csv - Permission denied
allocation.mod:113: error on opening table tab_BOM
glp_mpl_build_prob: invalid call sequence
Error detected in file ..\src\glpapi14.c at line 93


I do not get this error at each call of the Java model (one error after approx. 50 calls). Moreover, these errors do not occur in a deterministic manner, they cannot be reproduced. I each run of the Java program they occur at another place.

Do you have any advice what I could do about that?

Many thanks for your effort.

Best regards
Martin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]