Doctrine Batch Processing Iterate High Memory Usage

Batch processing with doctrine is trickier than it seems, even with the help of iterate() and IterableResult. Just as you expected greatest benefit of IterableResult is that it does not load all of the elements into memory, and the second benefit is that it doesn’t hold references to the entities you load, thus IterableResult doesn’t … Read more

No matter what, I can’t batch MySQL INSERT statements in Hibernate

It’s likely your queries are being rewritten but you wouldn’t know if by looking at the Hibernate SQL logs. Hibernate does not rewrite the insert statements – the MySQL driver rewrites them. In other words, Hibernate will send multiple insert statements to the driver, and then the driver will rewrite them. So the Hibernate logs … Read more

Recursively batch process files with pngquant

If you have limited depth of directories and not too many files, then lazy solution: pngquant *.png */*.png */*/*.png A standard solution: find . -name ‘*.png’ -exec pngquant –ext .png –force 256 {} \; and multi-core version: find . -name ‘*.png’ -print0 | xargs -0 -P8 -L1 pngquant –ext .png –force 256 where -P8 defines … Read more

How to submit a job to any [subset] of nodes from nodelist in SLURM?

You can work the other way around; rather than specifying which nodes to use, with the effect that each job is allocated all the 7 nodes, specify which nodes not to use: sbatch –exclude=myCluster[01-09] myScript.sh and Slurm will never allocate more than 7 nodes to your jobs. Make sure though that the cluster configuration allows … Read more

Use slurm job id

You can do something like this: RES=$(sbatch simulation) && sbatch –dependency=afterok:${RES##* } postprocessing The RES variable will hold the result of the sbatch command, something like Submitted batch job 102045. The construct ${RES##* } isolates the last word (see more info here), in the current case the job id. The && part ensures you do … Read more

Batch update/delete EF5

There are two open source projects allowing this: EntityFramework.Extended and Entity Framework Extensions. You can also check discussion about bulk updates on EF’s codeplex site. Inserting 100k records through EF is in the first place wrong application architecture. You should choose different lightweight technology for data imports. Even EF’s internal operation with such big record … Read more

tech