def setup_file_dest(params, clearDestination=True):
if RANK == <NUM_LIT:0>:<EOL><INDENT>if not os.path.isdir(params.savefolder):<EOL><INDENT>os.mkdir(params.savefolder)<EOL>assert(os.path.isdir(params.savefolder))<EOL><DEDENT>else:<EOL><INDENT>if clearDestination:<EOL><INDENT>print('<STR_LIT>' % params.savefolder)<EOL>while os.path.isdir(params.savefolder):<EOL><INDENT>try:<EOL><INDENT>os.system('<STR_LIT>' % params.savefolder)<EOL><DEDENT>except:<EOL><INDENT>shutil.rmtree(params.savefolder)<EOL><DEDENT><DEDENT>os.mkdir(params.savefolder)<EOL>assert(os.path.isdir(params.savefolder))<EOL><DEDENT><DEDENT>if not os.path.isdir(params.sim_scripts_path):<EOL><INDENT>print('<STR_LIT>' % params.sim_scripts_path)<EOL>os.mkdir(params.sim_scripts_path)<EOL><DEDENT>if not os.path.isdir(params.cells_path):<EOL><INDENT>print('<STR_LIT>' % params.cells_path)<EOL>os.mkdir(params.cells_path)<EOL><DEDENT>if not os.path.isdir(params.figures_path):<EOL><INDENT>print('<STR_LIT>' % params.figures_path)<EOL>os.mkdir(params.figures_path)<EOL><DEDENT>if not os.path.isdir(params.populations_path):<EOL><INDENT>print('<STR_LIT>' % params.populations_path)<EOL>os.mkdir(params.populations_path)<EOL><DEDENT>try:<EOL><INDENT>if not os.path.isdir(params.raw_nest_output_path):<EOL><INDENT>print('<STR_LIT>' % params.raw_nest_output_path)<EOL>os.mkdir(params.raw_nest_output_path)<EOL><DEDENT><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>if not os.path.isdir(params.spike_output_path):<EOL><INDENT>print('<STR_LIT>' % params.spike_output_path)<EOL>os.mkdir(params.spike_output_path)<EOL><DEDENT>for f in ['<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>', <EOL>'<STR_LIT>',<EOL>'<STR_LIT>']:<EOL><INDENT>if os.path.isfile(f):<EOL><INDENT>if not os.path.exists(os.path.join(params.sim_scripts_path, f)):<EOL><INDENT>shutil.copy(f, os.path.join(params.sim_scripts_path, f))<EOL>os.chmod(os.path.join(params.sim_scripts_path, f),<EOL>stat.S_IREAD)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>COMM.Barrier()<EOL>
Function to set up the file catalog structure for simulation output


Parameters
----------  
params : object 
    e.g., `cellsim16popsParams.multicompartment_params()`
clear_dest : bool 
    Savefolder will be cleared if already existing.


Returns
-------
None