-#ifdef DO_SOLVE
-/**
- * Invoke an external solver
- */
-static void pi_solve_ilp(problem_instance_t *pi) {
- FILE *out;
-
- DBG((dbg, LEVEL_1, "Solving with CPLEX@RZ...\n"));
- /* write command file for CPLEX */
- out = ffopen(pi->name, "cmd", "wt");
- fprintf(out, "read %s.mps\n", pi->name);
- fprintf(out, "read %s.mst\n", pi->name);
- fprintf(out, "set mip strategy mipstart 1\n");
- fprintf(out, "set logfile %s.sol\n", pi->name);
- fprintf(out, "optimize\n");
- fprintf(out, "display solution variables 1-%d\n", pi->x_dim);
- fprintf(out, "set logfile cplex.log\n");
- fprintf(out, "quit\n");
- fclose(out);
-
- /* write expect-file for copying problem to RZ */
- out = ffopen(EXPECT_FILENAME, "exp", "wt");
- fprintf(out, "#! /usr/bin/expect\n");
- fprintf(out, "spawn scp %s.mps %s.mst %s.cmd %s:\n", pi->name, pi->name, pi->name, SSH_USER_HOST_PATH);
- fprintf(out, "expect \":\"\n");
- fprintf(out, "send \"%s\\n\"\n", SSH_PASSWD);
- fprintf(out, "interact\n");
-
- fprintf(out, "spawn ssh %s \"./cplex90 < %s.cmd\"\n", SSH_USER_HOST_PATH, pi->name);
- fprintf(out, "expect \":\"\n");
- fprintf(out, "send \"%s\\n\"\n", SSH_PASSWD);
- fprintf(out, "interact\n");
-
- fprintf(out, "spawn scp %s:%s.sol .\n", SSH_USER_HOST_PATH, pi->name);
- fprintf(out, "expect \":\"\n");
- fprintf(out, "send \"%s\\n\"\n", SSH_PASSWD);
- fprintf(out, "interact\n");
- fclose(out);
-
- /* call the expect script */
- chmod(EXPECT_FILENAME ".exp", 0700);
- system(EXPECT_FILENAME ".exp");
-}