PhysiCell icon indicating copy to clipboard operation
PhysiCell copied to clipboard

updated scripts to build, run, test all sample projects

Open rheiland opened this issue 1 year ago • 7 comments
trafficstars

  • this bash script compiles all (non-intracellular) sample projects and creates user_projects of each, preparing for the next step of running (brief) simulations of each.

rheiland avatar Jun 05 '24 08:06 rheiland

I'm trying this out to test the arg parser and noticing the template project produces a file called template (on non-Windows) and the mechano-sample produces a file called mechano-sample. Subsequent runs of the script (after addressing an issue, e.g.) then seem to confuse the make targets of template and mechano-sample for the newly created executables. this causes the make template command to not load up the config files for the template project because it's looking at the template executable.

Right now, I'm just appending an underscore to the executable name. bonus: that could be used to more easily delete at command line? Better is probably to prefix with an underscore so sorting puts them together.

affected projects:

  • template
  • mechano-sample
  • rules-sample
  • physimess-sample

drbergman avatar Jun 06 '24 03:06 drbergman

Thanks very much! Pushed a fix. May go with a prefix or suffix underscore in the future, but for now staying with more traditional naming scheme. The header of the script lists all execs' names too.

rheiland avatar Jun 06 '24 06:06 rheiland

I am still more familiar with python than bash. Anyhow, along the same line, I thought it might be wise to write a Photon script that generates the Makefiles for all the sample and sample_inracellular projects. So I included this here into the discussion.

like this, it would be more or less easy to have a unified Makefile, or do changes to the unified Makefile structure. because there are already many sample projects and I think there will become more. if projects have specific needs for their make files, they could be included in the script in an "if project in {project_a, project_b, ...} block".

elmbeech avatar Jun 11 '24 12:06 elmbeech

I just pushed beta/test_run_samples.py to this PR which does what it says. It runs most sample projects after modifying each one's config file to only use 1 thread, brief max_time, and suffixed output dirs. The idea would be to run this on the previous release and the new [pre]release and compare results.

rheiland avatar Jun 11 '24 13:06 rheiland

Amazing! This will be so nice for testing!! Did you consider calling the bash script from the python script to make sure the user_projects are properly populated? It seems that would be useful, but would be interested in your thoughts. I'm sure I could add that with copilot really easily in the bash script if you think that's a good idea.

drbergman avatar Jun 11 '24 13:06 drbergman

I think I'd like to keep them as separate scripts for now. I guess I should add comments in each to make it clear.

rheiland avatar Jun 11 '24 13:06 rheiland

Just added a 3rd and final(?) script for testing: beta/test_diffs_svg.py. So, the order to run test scripts are:

  • beta/test_build_samples.sh (copy it to the root dir; see instructions in its header. Generates dirs in /user_projects)
  • python beta/test_run_samples.py # compiles/runs all projects in /user_projects generated from previous; edits models' xml so max_time is short, omp_num_threads=1, output folder is unique
  • python beta/test_diffs_svg.py <dir1> <dir2> # checks for bitwise equality of .svg files from two different repos/models, generated by previous script

rheiland avatar Jun 26 '24 21:06 rheiland

There appear to be no conflicts.

MathCancer avatar Aug 28 '24 14:08 MathCancer