[Swift-user] Expanding arrays in app function command lines

Michael Wilde wilde at mcs.anl.gov
Mon Jan 26 12:37:15 CST 2009


I want to pass an array of parameter strings (name/value pairs) to an 
app and have the parameters get expanded on the app command line in the 
order that they are indexed in the array.

What seems to happen instead is that they are being passed in 
semi-random order (but seems to be the same every time).

The app cmd line template is:

runoops @fasta @secseq @pdb @pdt @rmsd jobnum cfgParams[*]  stdout=@log;

The cfgParams formal parameter declared as: string cfgParams[]
is passed the array "config" as a value:

string config [];

config[0] = "TEMP UPDATE INTERVAL";         config[1]="10"; 

config[2] = "SMOOTH DEVIATION COEFFICIENT"; config[3]="0.80001";

What gets sent to the command line is:

[0.80001, SMOOTH DEVIATION COEFFICIENT, TEMP UPDATE INTERVAL, 10]

This seems to come out in this order (3,2,0,1) every time, but what I 
was expecting was:

[TEMP UPDATE INTERVAL, 10, SMOOTH DEVIATION COEFFICIENT, 0.80001]

Actually I wanted each param to be passed as a separate command-line 
arg, but the current format is ok.

In this particular case I can work around the random order by putting 
the name and value in the same string and break it up in the application 
script.

But in general, the ability to expand an array of strings into the 
command line is useful and I think should be done in array member order.

Can/should this be changed to behave like that?

The current version of the full script is attached.

- Mike


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: oops3.swift
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20090126/c99061dc/attachment.ksh>


More information about the Swift-user mailing list