Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripting parameter: for + conditional #15

Open
rgrima opened this issue Aug 2, 2024 · 1 comment
Open

Scripting parameter: for + conditional #15

rgrima opened this issue Aug 2, 2024 · 1 comment

Comments

@rgrima
Copy link

rgrima commented Aug 2, 2024

Hello

I am trying to define an experiment using JUBE, where I test a different amount of nodes:
<parameter name="nodes" type="int">1,2,4,8,16</parameter>

I would also like to test a different combination of processes and threads:
<parameter name="taskspernode" type="int">1,2,4,8,14,28,56,112</parameter>

This works properly. It also can be written as an scripting parameter:
<parameter name="taskspernode" mode="python">",".join([ str(i) for i in [1,2,4,8,14,28,56,112] ])</parameter>

But, I cannot use conditionals inside this loop. For instance, I would like to limit the total number of processes:
<parameter name="taskspernode" type="int" mode="python">",".join([ str(i) for i in [1,2,4,8,14,28,56,112] if $nodes*i<=768])</parameter>

I get an error message from jube:
not well-formed (invalid token): line 45, column 124

@thobreuer
Copy link
Collaborator

Some characters are not allowed inside an XML script or at least not inside a tag-option. Here are some of the typcial replacments:

  • < : &lt;
  • > : &gt;
  • & : &amp;
  • " : &quot;
  • ' : &apos;

see FAQ: https://apps.fz-juelich.de/jsc/jube/docu/faq.html#xml-character-handling

Please try the following:
<parameter name="taskspernode" type="int" mode="python">",".join([ str(i) for i in [1,2,4,8,14,28,56,112] if ${nodes}*i &lt;=768])</parameter>

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

No branches or pull requests

2 participants