UrbanAnalyst / m4ra

many-to-many multi-modal routing aggregator
https://urbananalyst.github.io/m4ra/
15 stars 2 forks source link

running m4ra_gtfs_traveltimes on windows is impossible due to mc.cores>1 #24

Open idshklein opened 1 year ago

idshklein commented 1 year ago

trying to run m4ra_gtfs_traveltimes on windows fails due to the fact that num_cores gets the number of cores on the computer, which is larger than 1. num_cores is fed into mcapply mc.cores argument,without the possibilty of changing the parameter. is m4ra not suitable for windows?

mpadge commented 1 year ago

Thanks for asking @idshklein. This package is still under heavy development, so not really ready for "general consumption" just yet, and also not really documented at all. Short answer to your question is here: https://github.com/ATFutures/m4ra/blob/b57c1cb9c921082d086c68aab883254369ffe13a/R/utils.R#L29-L39 So you just need to:

Sys.setenv ("M4RA_NUM_CORES" = 4) # or whatever

Note that everything really is designed to run in parallel, and running on single core, or even only a few, will generally take a long time to calculate. You also need to actively look at dynamic memory consumption, because depending on how big your GTFS feed is, the routines can require more memory than what is available.

Can I ask what you'd be using this for? I'd be happy to help further if it's an interesting project. It's currently being tested exclusively for my own purposes (mostly https://urbananalyst.city), but would be great to have a second use-case for testing.