Skip to content

Instantly share code, notes, and snippets.

View rocarvaj's full-sized avatar
🐀

Rodolfo Carvajal rocarvaj

🐀
View GitHub Profile
@rocarvaj
rocarvaj / Callback.cpp
Last active May 5, 2020 18:59
Cut callback to get LP with cuts
int cutCallbackShareRootCuts (CPXCENVptr env,
void *cbdata,
int wherefrom,
void *cbhandle,
int *useraction_p)
{
int status;
*useraction_p = CPX_CALLBACK_DEFAULT;
Problem *tempProblem = (Problem*) cbhandle;
@rocarvaj
rocarvaj / C-CppNotes.md
Created September 24, 2012 13:26
C/C++ Notes
@rocarvaj
rocarvaj / 120923-0636_submitting-multiple-jobs-in-condor.md
Created September 24, 2012 10:00
Submitting multiple jobs in Condor

A usual problem when running jobs in a cluster through the Condor job scheduler, is that it doesn't provide very flexible script-like functionality. In this post I propose a way to deal with a particular situation: Submitting a bunch of jobs with different arguments, in a batch.

This post assumes some familiarity with Condor. But I can tell you the short version: In Condor you create a "submitting" file (usually with extension .cmd) that looks something like this

universe = vanilla
executable = /path/to/my/executable
arguments = arg1 arg2 arg3
queue

Then, you submit this job to Condor with the command condor_submit .

@rocarvaj
rocarvaj / CMDMaker.sh
Created September 23, 2012 12:03
Submit multiple jobs to Condor
#!/bin/bash
########################################################
# This script generates multiples .cmd (Condor) files,
# one for each instance in the input file instances.txt.
# You can easily change this to have different arguments
# in the input file.
#
# After you have generated the file, use the multiSubmit.sh
# script to submit all your jobs at once.
@rocarvaj
rocarvaj / GitNotes.md
Created September 21, 2012 19:50
Git Notes
  • How to Push a New Local Branch to a Remote Git Repository

// The one sending branch

git push --set-upstream origin plugin

// The one wanting to use the branch

git fetch origin >git checkout --track origin/plugin

@rocarvaj
rocarvaj / README.md
Created September 5, 2012 13:40
diverseBB usage

What do you need?

  • [IBM ILOG CPLEX][cplex] (See section below on how to install CPLEX). The code works with CPLEX 12.2, but any later version should be fine.
  • MPI C++ compiler.

CPLEX

The process of downloading/installing CPLEX is a bit cumbersome, you have to get an account at IBM's academic initiative in order to get the software. Follow these steps:

Download software

  • Go to the [IBM academic initiative site][ibm] and create and account (click "Join now" at the right).
  • Once you have completed this, go back to the [home page][ibm] of the site and go to "Get software & access".
@rocarvaj
rocarvaj / plot.gnuplot
Created August 27, 2012 05:27
Plot from data file
plot "c37.lp_MIPStart.log" using 1:5 with lines, "c37.lp_MIPStart.log" using 1:6 with lines
@rocarvaj
rocarvaj / numbers.cpp
Created August 24, 2012 16:35
Printing tips C++
std::cout << std::setw(2) << setfill('0') << myNumber;
@rocarvaj
rocarvaj / chomp.cpp
Created July 25, 2012 19:57
C++ string chomp
string::size_type pos = str.find_last_not_of("\n \t");
if(pos != string::npos)
str = str.substr(0, pos+1);
@rocarvaj
rocarvaj / .screenrc
Created July 2, 2012 20:49
Screen config file
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "