Commit 862d7cb0 authored by COULAUD Olivier's avatar COULAUD Olivier

Add a generic mangling mechanism for fortran subroutine names. (Needed for...

Add a generic mangling mechanism for fortran subroutine names. (Needed for power8). Default is the name with underscore.
Morse should automatically select the good one soon
Fix bug with last modification on particle type enum
parent fa303b6c
......@@ -321,6 +321,13 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
##############################################################################
#
if( SCALFMM_USE_BLAS )
# include(FortranCInterface)
# # Define a Fortran interface file (FCMangle.hpp)
# FortranCInterface_HEADER( ${CMAKE_CURRENT_SOURCE_DIR}/Src/FCMangle.hpp
# MACRO_NAMESPACE "PM_"
# SYMBOL_NAMESPACE "PM_"
# SYMBOLS init testPPM:init)
set(SCALFMM_BLAS_ADD_ ON) # A enlever lorsque MORSE detectera le mangling fortan
message(STATUS "CMAKE_CXX_COMPILER_ID STREQUAL ${CMAKE_CXX_COMPILER_ID}")
option( SCALFMM_USE_MKL_AS_BLAS "Set to ON to use MKL CBLAS" OFF )
......
......@@ -28,7 +28,10 @@
#cmakedefine SCALFMM_USE_BLAS
#cmakedefine SCALFMM_USE_MKL_AS_BLAS
// Fortran Mangling
#cmakedefine SCALFMM_BLAS_ADD_
#cmakedefine SCALFMM_BLAS_UPCASE
#cmakedefine SCALFMM_BLAS_NOCHANGE
////////////////////////////////////////////////////////
// FFT
///////////////////////////////////////////////////////
......
This diff is collapsed.
/*
* FFortranMangling.hpp
*
* Created on: 6 juin 2016
* Author: coulaud
*/
#ifndef SRC_UTILS_FFORTRANMANGLING_HPP_
#define SRC_UTILS_FFORTRANMANGLING_HPP_
#include "ScalFmmConfig.h"
#ifdef SCALFMM_BLAS_ADD_
/* Mangling for Fortran subroutine symbols with underscores. */
#define FortranName(name,NAME) name##_
#elif defined(SCALFMM_BLAS_UPCASE)
/* Mangling for Fortran subroutine symbols in uppercase and without underscores */
#define FortranName(name,NAME) NAME
#elif defined(SCALFMM_BLAS_NOCHANGE)
/* Mangling for Fortran subroutine symbols without no change. */
#define FortranName(name,NAME) name
#else
#error("Fortran MANGLING NOT DEFINED")
#endif
// blas 1
#define Fddot FortranName(ddot,DDOT)
#define Fdscal FortranName(dscal,DSCAL)
#define Fdcopy FortranName(dcopy,DCOPY)
#define Fdaxpy FortranName(daxpy,DAXPY)
#define Fsdot FortranName(sdot,SDOT)
#define Fsscal FortranName(sscal,SSCAL)
#define Fscopy FortranName(scopy,SCOPY)
#define Fsaxpy FortranName(saxpy,SAXPY)
#define Fcscal FortranName(cscal,CSCAL)
#define Fccopy FortranName(ccopy,CCOPY)
#define Fcaxpy FortranName(caxpy,CAXPY)
#define Fzscal FortranName(zscal,ZSCAL)
#define Fzcopy FortranName(zcopy,ZCOPY)
#define Fzaxpy FortranName(zaxpy,ZAXPY)
// blas 2
#define Fdgemv FortranName(dgemv,DGEMV)
#define Fsgemv FortranName(sgemv,SGEMV)
#define Fcgemv FortranName(cgemv,CGEMV)
#define Fzgemv FortranName(zgemv,ZGEMV)
// blas 3
#define Fdgemm FortranName(dgemm,DGEMM)
#define Fsgemm FortranName(sgemm,SGEMM)
#define Fcgemm FortranName(cgemm,CGEMM)
#define Fzgemm FortranName(zgemm,ZGEMM)
// lapack
#define Fdgesvd FortranName(dgesvd,DGESVD)
#define Fdgeqrf FortranName(dgeqrf,DGEQRF)
#define Fdgeqp3 FortranName(dgeqp3,DGEQP3)
#define Fdorgqr FortranName(dorgqr,DORGQR)
#define Fdormqr FortranName(dormqr,DORMQR)
#define Fdpotrf FortranName(dpotrf,DPOTRF)
#define Fsgesvd FortranName(sgesvd,SGESVD)
#define Fsgeqrf FortranName(sgeqrf,SGEQRF)
#define Fsgeqp3 FortranName(sgeqp3,SGEQP3)
#define Fsorgqr FortranName(sorgqr,SORGQR)
#define Fsormqr FortranName(sormqr,SORMQR)
#define Fspotrf FortranName(spotrf,SPOTRF)
#define Fcgesvd FortranName(cgesvd,CGESVD)
#define Fcgeqrf FortranName(cgeqrf,CGEQRF)
#define Fcgeqp3 FortranName(cgeqp3,CGEQP3)
#define Fcorgqr FortranName(corgqr,CORGQR)
#define Fcormqr FortranName(cormqr,CORMQR)
#define Fcpotrf FortranName(cpotrf,CPOTRF)
#define Fzgesvd FortranName(zgesvd,ZGESVD)
#define Fzgeqrf FortranName(zgeqrf,ZGEQRF)
#define Fzgeqp3 FortranName(zgeqp3,ZGEQP3)
#define Fzorgqr FortranName(zorgqr,ZORGQR)
#define Fzormqr FortranName(zormqr,ZORMQR)
#define Fzpotrf FortranName(zpotrf,ZPOTRF)
#endif /* SRC_UTILS_FFORTRANMANGLING_HPP_ */
......@@ -152,7 +152,7 @@ struct TempMainStruct{
{
// Insert sources
FParticleType particleType, source = FParticleTypeSource;
FParticleType particleType, source = FParticleType::FParticleTypeSource;
for(FSize idxPart = 0 ; idxPart < nbSRC ; ++idxPart){
loader.fillParticle(&particlePosition, &particleType);
// std::cout << idxPart << " " << particlePosition << " type " << particleType
......@@ -175,9 +175,9 @@ struct TempMainStruct{
// int nbTargets = 256;
for(FSize idxPart = 0 ; idxPart < nbTargets; ++idxPart){
particlePosition2.incX(dx);
std::cout << idxPart << " " <<particlePosition2.getX()/dimLeaf<< " " << particlePosition2 << " type " << FParticleTypeTarget
std::cout << idxPart << " " <<particlePosition2.getX()/dimLeaf<< " " << particlePosition2 << " type " << static_cast<int>(FParticleType::FParticleTypeTarget)
<< " " <<physicalValue<<std::endl;
tree.insert(particlePosition2, FParticleTypeTarget,idxPart,physicalValue );
tree.insert(particlePosition2, FParticleType::FParticleTypeTarget,idxPart,physicalValue );
}
}
......
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 3 10:28:29 2016
@author: coulaud
"""
import random
import numpy
import math
meshFile="Vega_Z09_RR1_sans_fils.geod"
fmmFile="Vega_Z09_RR1_sans_fils.fma"
ptfile = open(fmmFile,'w')
ptfile.write("8 4 \n")
Fichier = open(meshFile,'r')
line = Fichier.readline()
line = Fichier.readline()
# mear size triangles an points
line = Fichier.readline()
size = line.rstrip('\n\r').split()
print(line)
Npt = int(size[1])
NT = int(size[0])
x = numpy.zeros([Npt,3])
for i in range(Npt):
line = Fichier.readline()
size = line.rstrip('\n\r').split()
x[i,0] = float(size[1])
x[i,1] = float(size[2])
x[i,2] = float(size[3])
a = numpy.amin(x,axis=0)
b = numpy.amax(x,axis=0)
print(a)
print(b)
length = math.ceil(max(b-a))
centre= (a+b)/2
print('Centre: ',centre)
print('length: ',length,max(b-a))
ptfile.write(str(Npt)+' ' + str((length)/2) + ' '+ str(centre[0])
+ ' '+ str(centre[1])+ ' '+ str(centre[2]) +"\n" )
for i in range(Npt):
rho = 2*random.random()-1
str1 = str(x[i,0])+ ' ' + str(x[i,1])+' ' +str(x[i,2])+ ' ' + str(rho) +"\n"
ptfile.write(str1)
ptfile.close()
\ No newline at end of file
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