in @burakbagdatli suggested using RunProgram to run another copy of JMP. Here's a toy example that works around some of the issues you might run into. It will need some tweaks to run on Mac; I only tried on Windows.
rp = [=> ];
rpIndex=0;
nrows=8;
For( i = 1, i <= nrows, i += 1,
workerFileName = Save Text File(
"$temp\deleteMe_RunsWhenLaunchedBeCareful" || Char( i ) || ".jsl",
"\[//!
instance = ]\"||char(i)||"\[;
deletefile("$temp/sentinel.txt");
dt=open("$sample_data/big class.jmp");
dt<<selectrows( instance );
start=tickseconds();
while(tickseconds()-start < 60,42); // simulate some work
savetextfile("$temp/deleteme"||char(instance)||".txt",dt:name[instance]);
exit();
]\"
);
savetextfile("$temp/sentinel.txt","");
rp[rpIndex+=1] = Run Program( executable( "jmp" ), options( {workerFileName} ) );
write("\!n",i," started...");
while(fileexists("$temp/sentinel.txt"),
wait(.1);
);
write("ok");
);
busy = 1;
While( busy,
busy = 0;
For( j = 1, j <= rpIndex, j += 1,
If( !(rp[j] << isreadEOF),
busy += 1;
)
);
write("\!n",busy," busy");
wait(.5);
);
Write( "\!ngathering results..." );
For( i = 1, i <= nrows, i += 1,
filename="$temp/deleteme"||char(i)||".txt";
write("\!n",loadtextfile(filename));
deletefile(filename);
deletefile("$temp\deleteMe_RunsWhenLaunchedBeCareful" || Char( i ) || ".jsl");
);
Write( "\!ndone" );
A separate JSL file is created for each copy of JMP; in this example JMP only needs an instance number. Each instance opens its own copy of Big Class and gets the i'th name. Answers are returned in another file with a name that includes the instance number. When all the instances finish, the answers are gathered.
The sentinel detects when a JMP instance is fully started and finished writing the preferences (etc) file. Without the sentinel, JMP might not read the preferences correctly and show all sorts of odd dialogs you'd rather not see.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.