-
Add a constant to every element of a vector http://stackoverflow.com/a/4461466
-
Append vector to another vector http://www.cplusplus.com/reference/stl/vector/insert/
-
Copy vector (requires allocation in advance) http://www.cplusplus.com/reference/algorithm/copy/
copy ( myints, myints+7, myvector.begin() );
-
Shuffling a vector http://www.cplusplus.com/reference/algorithm/random_shuffle/
int cutCallbackShareRootCuts (CPXCENVptr env, | |
void *cbdata, | |
int wherefrom, | |
void *cbhandle, | |
int *useraction_p) | |
{ | |
int status; | |
*useraction_p = CPX_CALLBACK_DEFAULT; | |
Problem *tempProblem = (Problem*) cbhandle; |
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
.
#!/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. |
- 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
- [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.
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:
- 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".
plot "c37.lp_MIPStart.log" using 1:5 with lines, "c37.lp_MIPStart.log" using 1:6 with lines |
std::cout << std::setw(2) << setfill('0') << myNumber; |
string::size_type pos = str.find_last_not_of("\n \t"); | |
if(pos != string::npos) | |
str = str.substr(0, pos+1); |
hardstatus on | |
hardstatus alwayslastline | |
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a " |