Commit 5d5b6d5d authored by COULAUD Olivier's avatar COULAUD Olivier

Mmove Utils/noDist in Obsolete

parent ae20c7f1
This diff is collapsed.
This diff is collapsed.
/*
* genarateDistributions.cpp
*
* Created on: 23 mars 2014
* Author: Olivier Coulaud
*/
// Keep in private GIT
// @SCALFMM_PRIVATE
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
//
#include "Utils/FGlobal.hpp"
#include "Utils/FPoint.hpp"
#include "Files/FFmaGenericLoader.hpp"
#include "Utils/FParameters.hpp"
#include "Utils/FCompareResults.hpp"
#include "Utils/FParameterNames.hpp"
//
/// \file compare2files.cpp
//!
//! \brief compare2files: Gives the error between
//!
//! Driver to transform a FMA format and/or to build a visualization file<br>
//! For a description of the FMA format see FFmaGenericLoader<br>
//! <b> General arguments:</b>
//! \param -help (-h) to see the parameters available in this driver
//! \param -fmmfile1 name1: first file name to compare (with extension .fma (ascii) or bfma (binary)
//! \param -fmmfile2 name2: second file name to compare (with extension .fma (ascii) or bfma (binary)
//! \param -ewaldfile2 name2 if name2 contains the result done by the ewald method for 1/r kernel.
//!
//! Error code (return of the main)
//! -1 Number of points is different in the two files.
//!
//! \b examples
//!
//!
//! compare2files -file1 unitCubeXYZQ100.fma -file2 unitCubeXYZQ100
int main(int argc, char ** argv){
// const FParameterNames LocalParameterEwald{
// {"-ewaldfile2"},
// "-ewaldfile2 name2 if name2 contains the result done by the ewald method for 1/r kernel"
// };
FHelpDescribeAndExit(argc, argv,
"Driver to change the format of the input file.",
FParameterDefinitions::InputFileOne, FParameterDefinitions::InputFileTwow,
/*LocalParameterEwald*/);
const std::string filename1(FParameters::getStr(argc,argv,FParameterDefinitions::InputFileOne.options, "data.fma"));
const std::string filename2(FParameters::getStr(argc,argv,FParameterDefinitions::InputFileTwow.options, "data.fma"));
typedef double FReal;
FFmaGenericLoader<FReal> loader1(filename1);
FFmaGenericLoader<FReal> loader2(filename2);
//
// Allocation
//
FSize nbParticles = loader1.getNumberOfParticles();
const unsigned int nbData = loader1.getNbRecordPerline() ;
if(nbParticles != loader2.getNumberOfParticles()){
std::cerr << "Number of points is different in the two files."<<std::endl ;
return -1 ;
}
if( (nbData != 8) && (loader2.getNbRecordPerline()) ){
std::cerr << "Wrong files only " << std::min(loader2.getNbRecordPerline(),nbData)<< " to read."<<std::endl ;
return -2 ;
}
FmaRWParticle<FReal,8,8>* const particles1 = new FmaRWParticle<FReal,8,8>[nbParticles];
FmaRWParticle<FReal,8,8>* const particles2 = new FmaRWParticle<FReal,8,8>[nbParticles];
//
loader1.fillParticle(particles1,nbParticles);
loader2.fillParticle(particles2,nbParticles);
const FSize error = compareTwoArrays<FReal, FmaRWParticle<FReal,8,8>* >("TAG", nbParticles, particles1, particles2);
//
delete[] particles1 ;
delete[] particles2 ;
//
return int(error);
}
This diff is collapsed.
#!/bin/bash
#
EXEC=Utils/Release/testAccuracyChebFMM
source $HOME/.bashrc
FILE=/Users/coulaud/Dev/src/ScalFMM/scalfmmT/Data/noDist/CEA/2000REFParticules.bfma
#
rm output*
for o in {2..13}
do
${EXEC} --datehost --flags -show-params -order $o -f $FILE -depth 5 -subdepth 3 -t 1 > output-accuracy-$o
done
/*
* genarateDistributions.cpp
*
* Created on: 23 mars 2014
* Author: Olivier Coulaud
*/
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
//
#include "Utils/FGlobal.hpp"
#include "Utils/FPoint.hpp"
#include "Files/FFmaGenericLoader.hpp"
#include "Files/FDlpolyLoader.hpp"
#include "Utils/FParameters.hpp"
#include "Files/FGenerateDistribution.hpp"
#include "Utils/FParameterNames.hpp"
#include "Files/FExportWriter.hpp"
//
/// \file stamp2Fma.cpp
//!
//! \brief changeFormat: Driver to transform a stamp format to FMA format and to build a visualization file
//!
//! Driver to transform a FMA format and/or to build a visualization file<br>
//! For a description of the FMA format see FFmaGenericLoader<br>
//! <b> General arguments:</b>
//! \param -help (-h) to see the parameters available in this driver
//! \param -fin name: file name to convert (with extension .fma (ascii) or bfma (binary)
//! \param -fdlpoly name file coming from a DLpoly simulation
//!
//! \param -fout name: generic name for files (without extension) and save data
//! with following format in name.fma or name.bfma if -bin is set"
//! \param -bin save output in binary mode (name file name.bfma
//! \param -visufmt format for the visu file (vtk, vtp, cvs or cosmo). vtp is the default
//!
//!
//! \b examples
//!
//! Transform an ascii file in a binary file
//!
//! changeFormat -fin unitCubeXYZQ100.fma -fout unitCubeXYZQ100 -bin
//
//
void genDistusage() {
std::cout << "Driver to change the format of the input file"
<< std::endl;
std::cout << "Options "<< std::endl
<< " -help to see the parameters " << std::endl
<< " Input: only one option is allowed" << std::endl
<< " -fin name: file name to convert (with extension .fma (ascii) or bfma (binary) " <<std::endl
<< " -fdlpoly name: file name to convert with extension (.bin if binary file) " <<std::endl;
}
int main(int argc, char ** argv){
//
FHelpDescribeAndExit(argc, argv,
"Driver to change the format of the input file. "
"fdlpoly is not supported for now.",
FParameterDefinitions::InputFile, FParameterDefinitions::OutputFile,
FParameterDefinitions::OutputVisuFile,);
if(FParameters::existParameter(argc, argv, "-h")||FParameters::existParameter(argc, argv, "-help")|| (argc < 3 )){
genDistusage() ;
exit(-1);
}
FSize NbPoints;
typedef double FReal;
FReal * particles = nullptr ;
FFmaGenericLoader<FReal> * loader;
unsigned int nbData;
bool stampFile = false ;
if (FParameters::existParameter(argc, argv, "-fstamp")) {
stampFile = true ;
}
if (FParameters::existParameter(argc, argv, "-fin")) {
const std::string filename(FParameters::getStr(argc,argv,"-fin", "data.fma"));
if(stampFile) {
loader = new FFmaGenericLoader<FReal>(filename,false);
}
else {
loader = new FFmaGenericLoader<FReal>(filename) ;
}
//
// Allocation
//
NbPoints = loader->getNumberOfParticles();
nbData = loader->getNbRecordPerline() ;
const FSize arraySize =nbData*NbPoints;
//
particles = new FReal[arraySize] ;
std::memset(particles,0,arraySize*sizeof(FReal));
//
// Read Data
FSize j = 0 ;
for(FSize idxPart = 0 ; idxPart < NbPoints ;++idxPart, j+=nbData){
// //
loader->fillParticle(&particles[j],nbData);
// std::cout << "idxPart "<< idxPart << " ";
// for (int jj= 0 ; jj<nbData ; ++jj, ++k){
// std::cout << particles[k] << " ";
// }
// std::cout << std::endl;
}
if(stampFile) {
j=0 ;
FReal D= loader->getBoxWidth();
for(FSize idxPart = 0 ; idxPart < NbPoints ;++idxPart, j+=nbData){
particles[j] *= D ;
particles[j+1] *= D ;
particles[j+2] *= D ;
}
}
// if(FParameters::existParameter(argc, argv, "-fdlpoly")){
// FDlpolyLoader *loader = nullptr ;
// // if(FParameters::existParameter(argc, argv, "-bin")){
// // loader = new FDlpolyBinLoader(filenameEwaldIn.c_str());
// // }
// // else {
// // loader = new FDlpolyAsciiLoader(filenameEwaldIn.c_str());
// // }
// // NbPoints = loader->getNumberOfParticles() ;
// // particles = new FReal[arraySize] ;
// // std::memset(particles,0,arraySize*sizeof(FReal));
// // for(FSize idxPart = 0 ; idxPart < NbPoints ; ++idxPart){
// //
// // int index ;
// // FPoint<FReal> P ; FReal t[3];
// /// / loader->fillParticle(&P, t, &physicalValue,&index);
// // particles[(index-1)*]
// //
// // totalCharge += physicalValue ;
// }
}
else {
genDistusage() ;
return 0;
}
//
/////////////////////////////////////////////////////////////////////////
// Save data
/////////////////////////////////////////////////////////////////////////
//
// Generate file for ScalFMM FMAGenericLoader
//
if(FParameters::existParameter(argc, argv, FParameterDefinitions::OutputFile.options)){
std::string name(FParameters::getStr(argc,argv,FParameterDefinitions::OutputFile.options, "output.fma"));
FFmaGenericWriter<FReal> writer(name) ;
writer.writeHeader( loader->getCenterOfBox(), loader->getBoxWidth() , NbPoints, sizeof(FReal), nbData) ;
writer.writeArrayOfReal(particles, nbData, NbPoints);
}
//
// Generate file for visualization purpose
//
if(FParameters::existParameter(argc, argv, FParameterDefinitions::OutputVisuFile.options)){
std::string outfilename(FParameters::getStr(argc,argv,FParameterDefinitions::OutputFile.options, "output.vtp"));
driverExportData(outfilename, particles , NbPoints);
}
//
delete[] particles ;
//
return 1;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/bin/bash -v
project_dir=$HOME/Dev/src/ScalFMM/scalfmmN/BuildOMP/run1
#
# PlaFRIM environment
#
#
#
#MaxCore=20
# `cat /proc/cpuinfo |grep processor |wc -l`
# tester si linux alors
MaxCore=`getconf _NPROCESSORS_ONLN`
HOST=`hostname`
echo $HOST
EXEC="../Examples/Release/ChebyshevInterpolationFMM"
REP="Test"
FILEPERF="output-scab-Cheb-10M"
FILE="../../Data/unitCubeXYZQ20k.bfma"
FILE="casTest-20000.fma"
FILE="/projets/scalfmm/benchPlafrim/unifCube_2_10000000.bfma"
echo "=================================================================="
echo "Run "
echo " pgm: ${EXEC}"
echo " file: ${FILE}"
echo " args -depth 7 -subdepth 4 "
echo " "
echo " Host: $HOST"
echo " MaxCore: $MaxCore"
echo " File: $FILE"
echo " "
echo " Projectdir: $project_dir"
echo "=================================================================="
#
mkdir -f $project_dir
cd $project_dir
#
pwd
export OMP_PROC_BIND=true
export KMP_AFFINITY=verbose,scatter
echo $FILEPERF-${HOST}.out
echo "# Core TIME ENERGY Pot_0 Pot_5000000 Pot_9999999"> $FILEPERF-${HOST}.out
P0=1
P1=1
P2=2
for l in `seq 1 $MaxCore `;
do
OUTPUT=${FILEPERF}-${HOST}-${l}.out
echo "Running per = " ${l}
$EXEC --datehost --flags -show-params -f $FILE -depth 7 -subdepth 4 -t $l > $OUTPUT
#
TIME=`grep "@Algorithm" $OUTPUT | awk '{print $4}'`
Energy=`grep "Energy" $OUTPUT | awk '{print $2}'`
P0=`grep "Index 0 potential" $OUTPUT | awk '{print $4}'`
P1=`grep "Index 5000000 potential" $OUTPUT | awk '{print $4}'`
P2=`grep "Index 9999999 potential" $OUTPUT | awk '{print $4}'`
echo " " $l " " $TIME " " $Energy " " $P0 " " $P1 " " $P2 >> $FILEPERF-${HOST}.out
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment