Skip to content

Conversation

@monicagiraldochica
Copy link
Contributor

Sorry, i deleted the branch by mistake. This is the same pull request as previously.

The app was re-writing any command that the user might type under the SBATCH (or other) heather. I fixed it so that when the script area is re-written, it only re-writes the heather (SBATCH lines) and not any additional commands.

@mnakao
Copy link
Contributor

mnakao commented Jan 11, 2026

Thank you very much for the pull request.
I tested the change and found that it does not work correctly when the script section contains lines other than #! and #SBATCH.
For example, if the script section in sample_apps/Slurm/form.yml is defined as follows, the final mpirun line is not visible:

script: |
  #!/bin/bash
  #SBATCH -p #{partition}
  #SBATCH -n #{cores_memory_1}
  #SBATCH --mem #{cores_memory_2}G
  #SBATCH -t #{time_1}:#{time_2}:00
  #SBATCH --array=#{array_1}-#{array_2}
  #SBATCH --mail-user=#{email}
  #SBATCH --mail-type=#{mail_option}

  mpirun -np 1 ./a.out

In addition, Open Composer generates lines that do not start with #! or #SBATCH as well, but the current implementation does not seem to handle those cases.

@monicagiraldochica
Copy link
Contributor Author

Thank you very much for the pull request. I tested the change and found that it does not work correctly when the script section contains lines other than #! and #SBATCH. For example, if the script section in sample_apps/Slurm/form.yml is defined as follows, the final mpirun line is not visible:

script: |
  #!/bin/bash
  #SBATCH -p #{partition}
  #SBATCH -n #{cores_memory_1}
  #SBATCH --mem #{cores_memory_2}G
  #SBATCH -t #{time_1}:#{time_2}:00
  #SBATCH --array=#{array_1}-#{array_2}
  #SBATCH --mail-user=#{email}
  #SBATCH --mail-type=#{mail_option}

  mpirun -np 1 ./a.out

In addition, Open Composer generates lines that do not start with #! or #SBATCH as well, but the current implementation does not seem to handle those cases.

Hi, thank you for your quick reply! I believe this is fixable. At MCW we only insert #SBATCH lines as part of the heather. So, it was my mistake that I didn't think about all other cases! Oops! But I'll think about other cases and update my pull request, unless I see that you publish an update before with that issue resolved. If it helps, that should require an edit in the helper function that I added. If you're interested, you could let me know all the possible cases in which a line is part of the heather (which are the lines that should be replaced on every update). For example: starts with #SBATCH, starts with #!. And I can edit the helper function. Unless you guys know already how to do the fix or have a more efficient way to do it. I'll give it some thought!

@mnakao
Copy link
Contributor

mnakao commented Jan 13, 2026

Hi, thank you very much for your reply and for your willingness to improve the implementation - we really appreciate your help.

Could you clarify what you mean by “heather”? Do you mean the script header? I just want to make sure I understand it correctly.

After receiving your PR, I also spent some time thinking about the implementation on my side, but unfortunately I couldn’t come up with a clean or clearly better solution either. So your input and ideas are very helpful.

At the very least, all of the samples shown in the following documentation need to work correctly with the final implementation: https://riken-rccs.github.io/OpenComposer/docs/application.html#sample

If you think updating the helper function you added is the right direction, I’m happy to discuss the possible cases together. Thanks again for your cooperation, and I look forward to your thoughts or an updated PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants