[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] passing parameters through nested DAGs?



Thanks, Nathan.  To be sure I understand: there is no such thing as a DAG template that accepts VARS like submit files do.  I can add scripts to my parent dag to create the child dags dynamically, but ultimately I do need separate physical dag files for each parameter combination?

-----Original Message-----
From: condor-users-bounces@xxxxxxxxxxx [mailto:condor-users-bounces@xxxxxxxxxxx] On Behalf Of Nathan Panike
Sent: Wednesday, May 23, 2012 10:53 AM
To: Condor-Users Mail List
Subject: Re: [Condor-users] passing parameters through nested DAGs?

On Wed, May 23, 2012 at 09:29:58AM -0700, Triplett, Sara wrote:
> Hi all,
> 
> I am very new to working directly with Condor and am trying to learn more about building DAGs.  I have a workflow that can be represented with nested DAGs, and I'm wondering if there is something like VARS that works with DAGs.  I have a master DAG that needs to call several other DAGs, and each of these is identical except that they need to pass distinct parameters to the submit files they call.  For example:
> 
> # File name: dagA.dag
> JOB FirstJob template.sub
> JOB SecondJob othertemplate.sub
> VARS FirstJob myparam="A"
> VARS SecondJob myparam="A"
> 
> # File name: dagB.dag
> JOB FirstJob template.sub
> JOB SecondJob othertemplate.sub
> VARS FirstJob myparam="B"
> VARS SecondJob myparam="B"
> 
> And so on.  Is there some elegant way to have one "template" DAG file that takes and passes myparam through to the called .sub files?  Or do I actually need separate DAG files?

Here is a recipe to do what you want. You will adapt it to your needs.

The dag file would be something like

subdag external A dagA.dag
script pre A pre.sh $JOB
subdag external B dagB.dag
script pre B pre.sh $JOB
(and so on)

Then pre.sh would be

#!/bin/bash
cat > dag${1}.dag <<HERESCRIPT
JOB FirstJob template.sub
JOB SecondJob othertemplate.sub
VARS FirstJob myparam="$1"
VARS SecondJob myparam="$1"
HERESCRIPT

Nathan Panike
_______________________________________________
Condor-users mailing list
To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/condor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/condor-users/
==============================================================================
The information in this e-mail and any attachments are for the sole
use of the intended recipient and may contain privileged or
confidential information.  Delivery to other than the intended
recipient shall not be deemed to waive any privilege.  Any
unauthorized use, disclosure, copying or distribution of this
message or attachment is strictly prohibited.  If you believe that
you have received this e-mail in error, please contact the sender
immediately and delete the e-mail and all of its attachments.
==============================================================================