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

[Condor-users] using unix "cat" in standard universe



Hi,

I have here a simple C program that fills a file "incremental.dat"
with successive calls to the "cat" shell command with "system("...")"
calls. At each iteration, "the file "tmp.dat" contains a single line,
that is then added to the "incremental.dat" file using the unix shell
">>" command. The program is compiled using condor_compile gcc ...
under Linux. When submitted to the Condor cluster, this program
doesn't behave as I expect: the "incremental.dat" is not returned at
all, even if it is constructed by the program on the remote executuion
node. So I've used the transfer_output_files option, but now the file
is always returned empty. Any idea on how to obtain the correctly
filled file created remotely. As a side note, when run locally, the
program behaves as expected.

Thanks,
Pasquale

------ condor_cat.c ------

#include <stdio.h>
#include <stdlib.h>

int main() {

 unsigned int k;

 FILE * fp;

 for (k=0; k<10; ++k) {

   fp = fopen("tmp.dat","w");
   fprintf(fp,"%i\n",k);
   fclose(fp);

   system("cat tmp.dat >> incremental.dat");

 }

 return 0;
}

-------- condor_cat.submit ----------

executable = condor_cat
universe   = standard
output     = condor_cat.out
error      = condor_cat.error
log        = condor_cat.log
WhenToTransferOutput  = ON_EXIT
transfer_output_files = incremental.dat
queue