Hi !

I am trying to do a simple test of parallel computing with Julia. It is a 
program which read a dataframe and write the number of columns in a text 
file.  I failed  :/  The program gives the following error. If you have an 
idea how to solve it... Thanks in advance ;)

$ julia main_parallel-001.jl 
exception on 3: ERROR: opening file tab2csv: Aucun fichier ou dossier de ce 
type
 in open at ./iostream.jl:117
 in open at ./iostream.jl:125
 in readtable at /home/fred/.julia/v0.3/DataFrames/src/dataframe/io.jl:889
 in process_table at /archives/logiciels/julia/parallel-05.jl:7
 in anonymous at multi.jl:855
 in run_work_thunk at multi.jl:621
 in anonymous at task.jl:855
exception on 2: ERROR: opening file tab2csv: Aucun fichier ou dossier de ce 
type
 in open at ./iostream.jl:117
 in open at ./iostream.jl:125
 in readtable at /home/fred/.julia/v0.3/DataFrames/src/dataframe/io.jl:889
 in process_table at /archives/logiciels/julia/parallel-05.jl:7
 in anonymous at multi.jl:855
 in run_work_thunk at multi.jl:621
 in anonymous at task.jl:855


##########################################################
# main program for parallel computing

addprocs(4)

require("parallel-05.jl")

function main()
  # process_table("tab.csv")                    # give good result
  # process_table("tab2.csv")                   # give good result
  pmap(process_table,{"tab.csv","tab2csv"})     # does not work for tab2csv
end

main()




##########################################################
# parallel-05.jl


using DataFrames


function process_table(title)
  sep='\t'
  myData = readtable(title ,separator=sep,header=false)
  m = size(myData,2)                                      # number of 
columns
  file_name = string("processed_",title)
  outfile = open(file_name, "w")
  write(outfile, "$m$sep")                                # write the 
number of columns in outfile
  close(outfile)
end

Reply via email to