# How to use external source file in fixed source calculation?

**URL:** <https://openmc.discourse.group/t/how-to-use-external-source-file-in-fixed-source-calculation/996>\
**Category:** User Support\
**Created:** [February 7, 2021, 12:40pm UTC](https://openmc.discourse.group/t/how-to-use-external-source-file-in-fixed-source-calculation/996 "2021-02-07T12:40:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [February 24, 2021, 4:46am UTC](https://openmc.discourse.group/t/how-to-use-external-source-file-in-fixed-source-calculation/996/4 "2021-02-24T04:46:30Z")

</div>

The internal format used for source sites recently changed (there is now a `surf_id` attribute that is used for surface source reading/writing). I’m not sure how you are creating the ADS source file, but if you are using `openmc.write_source_file`, you should make sure that you use that function from the same version of OpenMC that is used to eventually read the source file.

Either way, running into a segfault is not ideal behavior. I’m working on adding a check on the source file format to ensure that it matches what OpenMC expects. If it doesn’t match, an error message explaining what is wrong with it will be displayed.

---

_[View the full topic](https://openmc.discourse.group/t/how-to-use-external-source-file-in-fixed-source-calculation/996)._
