Compare commits
	
		
			3 Commits
		
	
	
		
			a0eaa76b27
			...
			409ec8b4c2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 409ec8b4c2 | |||
| c7d4a50a85 | |||
| 926ed90da4 | 
							
								
								
									
										3
									
								
								experiments/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								experiments/.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,2 +1,5 @@ | |||||||
| venv | venv | ||||||
| .ipynb_checkpoints | .ipynb_checkpoints | ||||||
|  | logs | ||||||
|  | __pycache__ | ||||||
|  | generated/* | ||||||
|  | |||||||
							
								
								
									
										15
									
								
								experiments/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								experiments/Makefile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,15 @@ | |||||||
|  | VARIED_FILLINGS_IS := $(shell seq -w 0 10 100) | ||||||
|  | VARIED_FILLINGS_JOBS := $(addprefix generated/varied-fillings-, $(addsuffix .json, ${VARIED_FILLINGS_IS})) | ||||||
|  | 
 | ||||||
|  | varied-fillings: ${VARIED_FILLINGS_JOBS} | ||||||
|  | 
 | ||||||
|  | clean: | ||||||
|  | 	rm -f generated/* | ||||||
|  | 
 | ||||||
|  | clean-logs: | ||||||
|  | 	rm -f logs/* | ||||||
|  | 
 | ||||||
|  | generated/varied-fillings-%.json: scripts/gen/varied_fillings.py templates/varied-fillings.json | ||||||
|  | 	python scripts/gen/varied_fillings.py $* > $@ | ||||||
|  | 
 | ||||||
|  | .PHONY: varied-fillings clean clean-logs | ||||||
										
											Binary file not shown.
										
									
								
							| @ -5,11 +5,11 @@ | |||||||
| #SBATCH --account=hkf6 | #SBATCH --account=hkf6 | ||||||
| #SBATCH --partition=develbooster | #SBATCH --partition=develbooster | ||||||
| #SBATCH --nodes=1 | #SBATCH --nodes=1 | ||||||
| #SBATCH --ntasks-per-node=1 | #SBATCH --ntasks=1 | ||||||
| #SBATCH --cpus-per-task=48 | #SBATCH --cpus-per-task=48 | ||||||
| #SBATCH --time=01:00:00 | #SBATCH --time=01:00:00 | ||||||
| #SBATCH --output=build-cuda-%j.out | #SBATCH --output=logs/build-cuda-%j.log | ||||||
| #SBATCH --error=build-cuda-%j.err | #SBATCH --error=logs/build-cuda-%j.log | ||||||
| 
 | 
 | ||||||
| SOURCE_DIR=/p/project/cellsinsilico/paulslustigebude | SOURCE_DIR=/p/project/cellsinsilico/paulslustigebude | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -5,11 +5,11 @@ | |||||||
| #SBATCH --account=hkf6 | #SBATCH --account=hkf6 | ||||||
| #SBATCH --partition=develbooster | #SBATCH --partition=develbooster | ||||||
| #SBATCH --nodes=1 | #SBATCH --nodes=1 | ||||||
| #SBATCH --ntasks-per-node=1 | #SBATCH --ntasks=1 | ||||||
| #SBATCH --cpus-per-task=48 | #SBATCH --cpus-per-task=48 | ||||||
| #SBATCH --time=01:00:00 | #SBATCH --time=01:00:00 | ||||||
| #SBATCH --output=build-nocuda-%j.out | #SBATCH --output=logs/build-nocuda-%j.log | ||||||
| #SBATCH --error=build-nocuda-%j.err | #SBATCH --error=logs/build-nocuda-%j.log | ||||||
| 
 | 
 | ||||||
| SOURCE_DIR=/p/project/cellsinsilico/paulslustigebude | SOURCE_DIR=/p/project/cellsinsilico/paulslustigebude | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										32
									
								
								experiments/batch/cuda
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								experiments/batch/cuda
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | |||||||
|  | #!/usr/bin/env bash | ||||||
|  | 
 | ||||||
|  | #SBATCH --job-name=cuda | ||||||
|  | # Forschergruppe Schug | ||||||
|  | #SBATCH --account=hkf6 | ||||||
|  | # 48 Cores, 512GiB RAM, 4x NVIDIA A100 GPUs | ||||||
|  | #SBATCH --partition=booster | ||||||
|  | # Right now we're using a single node | ||||||
|  | #SBATCH --nodes=1 | ||||||
|  | # Number of MPI processes | ||||||
|  | # TODO: Change the config and set to this the maximum of 48 | ||||||
|  | #SBATCH --ntasks=16 | ||||||
|  | #SBATCH --cpus-per-task=1 | ||||||
|  | # For now, we are using a single GPU only | ||||||
|  | #SBATCH --gres=gpu:1 | ||||||
|  | #SBATCH --time=01:00:00 | ||||||
|  | #SBATCH --output=logs/cuda-%j.log | ||||||
|  | #SBATCH --error=logs/cuda-%j.log | ||||||
|  | 
 | ||||||
|  | SOURCE_DIR=/p/project/cellsinsilico/paulslustigebude | ||||||
|  | OUTPUT_DIR=/p/scratch/cellsinsilico/paul/nastja-out/cuda | ||||||
|  | 
 | ||||||
|  | mkdir -p "${OUTPUT_DIR}" | ||||||
|  | source "${SOURCE_DIR}/activate-nastja-modules" | ||||||
|  | 
 | ||||||
|  | # This is actually the default behavior for a single task anyways | ||||||
|  | # However I'm leaving this here for documentation reasons | ||||||
|  | export CUDA_VISIBLE_DEVICES=0 | ||||||
|  | 
 | ||||||
|  | srun "${SOURCE_DIR}/nastja/build-cuda/nastja" \ | ||||||
|  |   -c "${SOURCE_DIR}/ma/experiments/configs/genesis.json" \ | ||||||
|  |   -o "${OUTPUT_DIR}" | ||||||
| @ -9,11 +9,11 @@ | |||||||
| #SBATCH --nodes=1 | #SBATCH --nodes=1 | ||||||
| # Number of MPI processes | # Number of MPI processes | ||||||
| # TODO: Change the config and set to this the maximum of 48 | # TODO: Change the config and set to this the maximum of 48 | ||||||
| #SBATCH --ntasks-per-node=16 | #SBATCH --ntasks=16 | ||||||
| #SBATCH --cpus-per-task=1 | #SBATCH --cpus-per-task=1 | ||||||
| #SBATCH --time=01:00:00 | #SBATCH --time=01:00:00 | ||||||
| #SBATCH --output=nocuda-%j.out | #SBATCH --output=logs/nocuda-%j.log | ||||||
| #SBATCH --error=nocuda-%j.err | #SBATCH --error=logs/nocuda-%j.log | ||||||
| 
 | 
 | ||||||
| SOURCE_DIR=/p/project/cellsinsilico/paulslustigebude | SOURCE_DIR=/p/project/cellsinsilico/paulslustigebude | ||||||
| OUTPUT_DIR=/p/scratch/cellsinsilico/paul/nastja-out/nocuda | OUTPUT_DIR=/p/scratch/cellsinsilico/paul/nastja-out/nocuda | ||||||
|  | |||||||
							
								
								
									
										26
									
								
								experiments/batch/nocuda-noecm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								experiments/batch/nocuda-noecm
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,26 @@ | |||||||
|  | #!/usr/bin/env bash | ||||||
|  | 
 | ||||||
|  | #SBATCH --job-name=nocuda-noecm | ||||||
|  | # Forschergruppe Schug | ||||||
|  | #SBATCH --account=hkf6 | ||||||
|  | # 48 Cores, 512GiB RAM, 4x NVIDIA A100 GPUs | ||||||
|  | #SBATCH --partition=booster | ||||||
|  | # Right now we're using a single node | ||||||
|  | #SBATCH --nodes=1 | ||||||
|  | # Number of MPI processes | ||||||
|  | # TODO: Change the config and set to this the maximum of 48 | ||||||
|  | #SBATCH --ntasks-per-node=16 | ||||||
|  | #SBATCH --cpus-per-task=1 | ||||||
|  | #SBATCH --time=01:00:00 | ||||||
|  | #SBATCH --output=logs/nocuda-noecm-%j.log | ||||||
|  | #SBATCH --error=logs/nocuda-noecm-%j.log | ||||||
|  | 
 | ||||||
|  | SOURCE_DIR=/p/project/cellsinsilico/paulslustigebude | ||||||
|  | OUTPUT_DIR=/p/scratch/cellsinsilico/paul/nastja-out/nocuda-noecm | ||||||
|  | 
 | ||||||
|  | mkdir -p "${OUTPUT_DIR}" | ||||||
|  | source "${SOURCE_DIR}/activate-nastja-modules" | ||||||
|  | 
 | ||||||
|  | srun "${SOURCE_DIR}/nastja/build-nocuda/nastja" \ | ||||||
|  |   -c "${SOURCE_DIR}/ma/experiments/configs/genesis-noecm.json" \ | ||||||
|  |   -o "${OUTPUT_DIR}" | ||||||
							
								
								
									
										26
									
								
								experiments/batch/varied-fillings-nocuda
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								experiments/batch/varied-fillings-nocuda
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,26 @@ | |||||||
|  | #!/usr/bin/env bash | ||||||
|  | 
 | ||||||
|  | #SBATCH --job-name=varied-fillings-nocuda | ||||||
|  | # Forschergruppe Schug | ||||||
|  | #SBATCH --account=hkf6 | ||||||
|  | # 48 Cores, 512GiB RAM, 4x NVIDIA A100 GPUs | ||||||
|  | #SBATCH --partition=booster | ||||||
|  | # Right now we're using a single node | ||||||
|  | #SBATCH --nodes=1 | ||||||
|  | #SBATCH --ntasks=48 | ||||||
|  | #SBATCH --cpus-per-task=1 | ||||||
|  | #SBATCH --time=02:00:00 | ||||||
|  | #SBATCH --output=logs/varied-fillings-nocuda-%A-%3a.log | ||||||
|  | #SBATCH --error=logs/varied-fillings-nocuda-%A-%3a.log | ||||||
|  | #SBATCH --array=0-100:10 | ||||||
|  | 
 | ||||||
|  | IDENT=$(printf "%03d" "${SLURM_ARRAY_TASK_ID}") | ||||||
|  | SOURCE_DIR=/p/project/cellsinsilico/paulslustigebude | ||||||
|  | OUTPUT_DIR="/p/scratch/cellsinsilico/paul/nastja-out/varied-fillings-nocuda-${IDENT}" | ||||||
|  | 
 | ||||||
|  | mkdir -p "${OUTPUT_DIR}" | ||||||
|  | source "${SOURCE_DIR}/activate-nastja-modules" | ||||||
|  | 
 | ||||||
|  | srun "${SOURCE_DIR}/nastja/build-nocuda/nastja" \ | ||||||
|  |   -c "${SOURCE_DIR}/ma/experiments/generated/varied-fillings-${IDENT}.json" \ | ||||||
|  |   -o "${OUTPUT_DIR}" | ||||||
							
								
								
									
										109
									
								
								experiments/configs/genesis-noecm.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										109
									
								
								experiments/configs/genesis-noecm.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,109 @@ | |||||||
|  | { | ||||||
|  |   "#Testing": { | ||||||
|  |     "description": "Cellular Potts Model with dynamic ECM" | ||||||
|  |   }, | ||||||
|  |   "Application": "Cells", | ||||||
|  |   "Geometry": { | ||||||
|  |     "blocksize": [20, 40, 40], | ||||||
|  |     "blockcount": [4, 2, 2] | ||||||
|  |   }, | ||||||
|  |   "Settings": { | ||||||
|  |     "timesteps": 250, | ||||||
|  |     "randomseed": 42 | ||||||
|  |   }, | ||||||
|  |   "Filling": { | ||||||
|  |     "cells": [ | ||||||
|  |       { | ||||||
|  |         "_comment": "This is for the dynamic ECM", | ||||||
|  |         "shape": "cube", | ||||||
|  |         "box": [ | ||||||
|  |           [0, 0, 0], | ||||||
|  |           [79, 79, 79] | ||||||
|  |         ], | ||||||
|  |         "value": 0, | ||||||
|  |         "celltype": 0 | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         "shape": "cube", | ||||||
|  |         "box": [ | ||||||
|  |           [41, 35, 10], | ||||||
|  |           [45, 39, 15] | ||||||
|  |         ], | ||||||
|  |         "celltype": 2 | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         "shape": "cube", | ||||||
|  |         "box": [ | ||||||
|  |           [40, 15, 14], | ||||||
|  |           [47, 22, 20] | ||||||
|  |         ], | ||||||
|  |         "celltype": 2 | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         "shape": "cube", | ||||||
|  |         "box": [ | ||||||
|  |           [40, 20, 20], | ||||||
|  |           [47, 27, 26] | ||||||
|  |         ], | ||||||
|  |         "celltype": 3 | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         "shape": "cube", | ||||||
|  |         "box": [ | ||||||
|  |           [38, 20, 60], | ||||||
|  |           [45, 27, 66] | ||||||
|  |         ], | ||||||
|  |         "celltype": 3 | ||||||
|  |       } | ||||||
|  |     ] | ||||||
|  |   }, | ||||||
|  |   "CellsInSilico": { | ||||||
|  |     "liquid": 1, | ||||||
|  |     "adhesion": { | ||||||
|  |       "matrix": [ | ||||||
|  |         [0, 0,  0, 0], | ||||||
|  |         [0, 0,  0, 0], | ||||||
|  |         [0, 0, 10, 5], | ||||||
|  |         [0, 0,  5, 5] | ||||||
|  |       ] | ||||||
|  |     }, | ||||||
|  |     "temperature": 15, | ||||||
|  |     "volume": { | ||||||
|  |       "default": { | ||||||
|  |         "storage": "const", | ||||||
|  |         "value": 2000 | ||||||
|  |       }, | ||||||
|  |       "lambda": { | ||||||
|  |         "storage": "const", | ||||||
|  |         "value": 10 | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     "surface": { | ||||||
|  |       "default": { | ||||||
|  |         "storage": "const", | ||||||
|  |         "value": 800 | ||||||
|  |       }, | ||||||
|  |       "lambda": { | ||||||
|  |         "storage": "const", | ||||||
|  |         "value": 10 | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     "cleaner": { | ||||||
|  |       "killdistance": 100 | ||||||
|  |     }, | ||||||
|  |     "checkerboard": "00", | ||||||
|  |     "energyfunctions": ["Volume00", "Surface00", "Adhesion00"], | ||||||
|  |     "centerofmass": { | ||||||
|  |       "steps": 10 | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   "Writers": { | ||||||
|  |     "ParallelVTK_Cells": { | ||||||
|  |       "writer": "ParallelVtkImage", | ||||||
|  |       "outputtype": "UInt32", | ||||||
|  |       "field": "cells", | ||||||
|  |       "steps": 1 | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   "WriteActions": ["ParallelVTK_Cells"] | ||||||
|  | } | ||||||
							
								
								
									
										0
									
								
								experiments/generated/.gitkeep
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								experiments/generated/.gitkeep
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										54
									
								
								experiments/scripts/gen/varied_fillings.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								experiments/scripts/gen/varied_fillings.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,54 @@ | |||||||
|  | #!/usr/bin/env python | ||||||
|  | 
 | ||||||
|  | import json | ||||||
|  | import sys | ||||||
|  | 
 | ||||||
|  | from functools import reduce | ||||||
|  | from operator import mul | ||||||
|  | from pathlib import Path | ||||||
|  | 
 | ||||||
|  | percent_filled = float(sys.argv[1]) | ||||||
|  | template_path = Path("templates/varied-fillings.json") | ||||||
|  | 
 | ||||||
|  | initial_cell_size = 4200 | ||||||
|  | 
 | ||||||
|  | with template_path.open(encoding="utf-8") as template_file: | ||||||
|  |     config = json.load(template_file) | ||||||
|  | 
 | ||||||
|  | dims = [ | ||||||
|  |     size * count | ||||||
|  |     for size, count | ||||||
|  |     in zip(config["Geometry"]["blocksize"], config["Geometry"]["blockcount"]) | ||||||
|  | ] | ||||||
|  | total_volume = reduce(mul, dims, 1) | ||||||
|  | target_volume = total_volume * percent_filled / 100 | ||||||
|  | n_cells = int(target_volume // initial_cell_size) | ||||||
|  | # If n_cells is odd, second type gets one more cell | ||||||
|  | n_cells_first_type = n_cells // 2 | ||||||
|  | n_cells_second_type = n_cells - n_cells_first_type | ||||||
|  | edge_length = int(target_volume ** (1 / 3)) | ||||||
|  | offsets = [ | ||||||
|  |     (dims[0] - edge_length) // 2, | ||||||
|  |     (dims[1] - edge_length) // 2, | ||||||
|  |     (dims[2] - edge_length) // 2 | ||||||
|  | ] | ||||||
|  | 
 | ||||||
|  | print(f"Target volume: {target_volume} ({percent_filled}%, edge length: {edge_length}), # of cells: {n_cells}", file=sys.stderr) | ||||||
|  | 
 | ||||||
|  | if target_volume > 0: | ||||||
|  |     config["Filling"]["cells"].append({ | ||||||
|  |         "shape": "cube", | ||||||
|  |         "pattern": "voronoi", | ||||||
|  |         "box": [ | ||||||
|  |             offsets, | ||||||
|  |             [ | ||||||
|  |                 min(offsets[0] + edge_length, dims[0] - 1), | ||||||
|  |                 min(offsets[1] + edge_length, dims[1] - 1), | ||||||
|  |                 min(offsets[2] + edge_length, dims[2] - 1) | ||||||
|  |             ] | ||||||
|  |         ], | ||||||
|  |         "count": n_cells, | ||||||
|  |         "celltype": [0, 0, n_cells_first_type, n_cells_second_type] | ||||||
|  |     }) | ||||||
|  | 
 | ||||||
|  | json.dump(config, sys.stdout, indent=2) | ||||||
							
								
								
									
										99
									
								
								experiments/templates/varied-fillings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								experiments/templates/varied-fillings.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,99 @@ | |||||||
|  | { | ||||||
|  |   "#Testing": { | ||||||
|  |     "description": "Cellular Potts Model with dynamic ECM" | ||||||
|  |   }, | ||||||
|  |   "Application": "Cells", | ||||||
|  |   "Geometry": { | ||||||
|  |     "blocksize": [30, 30, 40], | ||||||
|  |     "blockcount": [4, 4, 3] | ||||||
|  |   }, | ||||||
|  |   "Settings": { | ||||||
|  |     "timesteps": 500, | ||||||
|  |     "randomseed": 42 | ||||||
|  |   }, | ||||||
|  |   "Filling": { | ||||||
|  |     "cells": [ | ||||||
|  |       { | ||||||
|  |         "_comment": "This is for the dynamic ECM", | ||||||
|  |         "shape": "cube", | ||||||
|  |         "box": [ | ||||||
|  |           [0, 0, 0], | ||||||
|  |           [119, 119, 119] | ||||||
|  |         ], | ||||||
|  |         "value": 0, | ||||||
|  |         "celltype": 0 | ||||||
|  |       } | ||||||
|  |     ] | ||||||
|  |   }, | ||||||
|  |   "CellsInSilico": { | ||||||
|  |     "liquid": 1, | ||||||
|  |     "adhesion": { | ||||||
|  |       "matrix": [ | ||||||
|  |         [ 0, 0,  0, 10], | ||||||
|  |         [ 0, 0,  0, 10], | ||||||
|  |         [10, 0, 40,  5], | ||||||
|  |         [10, 0,  5, 40] | ||||||
|  |       ] | ||||||
|  |     }, | ||||||
|  |     "temperature": 15, | ||||||
|  |     "volume": { | ||||||
|  |       "default": { | ||||||
|  |         "storage": "const", | ||||||
|  |         "value": 5000 | ||||||
|  |       }, | ||||||
|  |       "lambda": { | ||||||
|  |         "storage": "const", | ||||||
|  |         "value": 10 | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     "surface": { | ||||||
|  |       "default": { | ||||||
|  |         "storage": "const", | ||||||
|  |         "value": 1000 | ||||||
|  |       }, | ||||||
|  |       "lambda": { | ||||||
|  |         "storage": "const", | ||||||
|  |         "value": 10 | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     "cleaner": { | ||||||
|  |       "killdistance": 100 | ||||||
|  |     }, | ||||||
|  |     "checkerboard": "00", | ||||||
|  |     "energyfunctions": ["Volume00", "Surface00", "Adhesion00", "DynamicECM00"], | ||||||
|  |     "centerofmass": { | ||||||
|  |       "steps": 10 | ||||||
|  |     }, | ||||||
|  |     "dynamicecm": { | ||||||
|  |       "enabled": true, | ||||||
|  |       "stepsPerMcs": 200, | ||||||
|  |       "pushSteps": 10, | ||||||
|  |       "pushWeight": 2, | ||||||
|  |       "ecmCellID": 0, | ||||||
|  |       "deltat": 0.1, | ||||||
|  |       "eta": 0.25, | ||||||
|  |       "k0": 0.1, | ||||||
|  |       "k1": 0.1, | ||||||
|  |       "c": 4, | ||||||
|  |       "alpha": 2, | ||||||
|  |       "d": 0.3, | ||||||
|  |       "phi": 1 | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   "Writers": { | ||||||
|  |     "ParallelVTK_Cells": { | ||||||
|  |       "writer": "ParallelVtkImage", | ||||||
|  |       "outputtype": "UInt32", | ||||||
|  |       "field": "cells", | ||||||
|  |       "steps": 5 | ||||||
|  |     }, | ||||||
|  |     "ParallelVTK_Displacement": { | ||||||
|  |       "writer": "ParallelVtkImage", | ||||||
|  |       "outputtype": "Float32", | ||||||
|  |       "field": "dynamicecm", | ||||||
|  |       "components": [0, 1, 2], | ||||||
|  |       "steps": 5 | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   "WriteActions": ["ParallelVTK_Cells", "ParallelVTK_Displacement"] | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user