Comments (6)
Thanks for reaching out @andresrj!
I'm sorry, I've never used SLURM before. Based on reading this web site (https://help.rc.ufl.edu/doc/Sample_SLURM_Scripts), it seems that you need to write a plain text file (possibly BASH script?) with (1) some comments containing job requirements (e.g. CPU usage and RAM usage) and (2) some system commands that tell it how to run the code. I would suggest writing an R script that contains the R code for running prioritizr and then calling it in in the SLURM job file. I'm guessing something like this might work as a starting point?
SLURM file (note that you might need to change some things, e.g., modules, email address, file paths)
#!/bin/bash
#SBATCH --job-name=prioritizr-run # Job name
#SBATCH --mail-type=END,FAIL # Mail events (NONE, BEGIN, END, FAIL, ALL)
#SBATCH [email protected] # Where to send mail
#SBATCH --nodes=1 # Run all processes on a single node
#SBATCH --ntasks=1 # Run a single task
#SBATCH --cpus-per-task=4 # Number of CPU cores per task
#SBATCH --mem=5gb # Job memory request
#SBATCH --time=00:05:00 # Time limit hrs:min:sec
#SBATCH --output=prioritizr-run-%j.log # Standard output and error log
pwd; hostname; date
module load R
R CMD BATCH --no-restore --no-save prioritizr-code.R
/data/training/SLURM/prime/prime
date
R script (saved in file prioritizr-code.R):
# load packages
library(prioritizr)
# load data
data(sim_pu_raster, sim_features)
# create problem
p <- problem(sim_pu_raster, sim_features) %>%
add_min_set_objective() %>%
add_relative_targets(0.1) %>%
add_binary_decisions() %>%
add_cbc_solver(gap = 0, verbose = FALSE)
# generate solution
s <- solve(p)
# save solution
saveRDS(s, "results.rds")
Does that help?
from prioritizr.
@andresrj, I just wanted to follow up and ask if you were able to get prioritizr running on the cluster?
from prioritizr.
Yes, thank you very much. I contacted gurobi and obtained an academic licence for the cluster in our university (it seemed that was the problem because we use gurobi as prioritizr solver). I even had the chance to play a little with singularity and that way avoid other library errors I was getting from my R script launched with SLURM... It was really a lot to learn but a nice experience after all (and I still have a lot to learn from prioritizr website. Thanks!)
from prioritizr.
Awesome! It sounds like everything's working now - is that right? If so, would you mind if I closed the issue? Happy to answer any more questions if that's helpful?
from prioritizr.
Yes, I have it working and now to learn how to use it properly. Thank you very much, you have been very helpful! :D
from prioritizr.
No worries - happy to help!
from prioritizr.
Related Issues (20)
- New presolve check warning: more features are needed on previously feasible problem HOT 3
- Error solving problem HOT 6
- please change check in `add_manual_locked_constraints()` HOT 10
- Assertion on 'log_to_console' failed: Must be of type 'logical', not 'integer'. HOT 3
- rij_matrix can return empty matrix when memory = TRUE HOT 2
- installation of cplexAPI package + re-scaling features data HOT 17
- Overly zealous assert causes spurious failure on problem(), breaking valid prioritizr 7.1.1 scripts HOT 2
- high boundary penalties, but solution has weird hole HOT 1
- Error while solving the problem HOT 10
- package overview manual entry
- Add linear constraints for multiple zones HOT 3
- lexicographic (hierachical) multi-objective optimization HOT 5
- Add max area threshold for zone and dealing with fragmented zones HOT 25
- Improve presolve checks HOT 1
- ℹ In argument to `x`. Caused by `problems(pu, features = multi_layer)` HOT 7
- write_problem() doesn't work
- Categorical `SpatRaster` layers break problem creation HOT 4
- Ph.D. HOT 2
- How should I incorporate a risk layer? Penalty, feature, feature weight? HOT 7
- Add proximity-based metrics for irreplaceability
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prioritizr.